Add test for volumes

This commit is contained in:
David Boreham 2023-05-21 07:33:48 -06:00
parent 982052bf87
commit 80ecf63425

View File

@ -19,12 +19,30 @@ echo "Version reported is: ${reported_version_string}"
echo "Cloning repositories into: $CERC_REPO_BASE_DIR" echo "Cloning repositories into: $CERC_REPO_BASE_DIR"
rm -rf $CERC_REPO_BASE_DIR rm -rf $CERC_REPO_BASE_DIR
mkdir -p $CERC_REPO_BASE_DIR mkdir -p $CERC_REPO_BASE_DIR
# Test pulling a stack # Test bringing the test container up and down
# with and without volume removal
$TEST_TARGET_SO --stack test setup-repositories $TEST_TARGET_SO --stack test setup-repositories
# Test building the a stack container
$TEST_TARGET_SO --stack test build-containers $TEST_TARGET_SO --stack test build-containers
$TEST_TARGET_SO --stack test deploy-system up $TEST_TARGET_SO --stack test deploy up
# TODO: test that we can use the deployed container somehow $TEST_TARGET_SO --stack test deploy down
# Clean up # The next time we bring the container up the volume will be old (from the previous run above)
$TEST_TARGET_SO --stack test deploy-system down $TEST_TARGET_SO --stack test deploy up
log_output_1=$( $TEST_TARGET_SO --stack test deploy logs )
if [[ "$log_output_1" == *"Filesystem is old"* ]]; then
echo "Retain volumes test: passed"
else
echo "Retain volumes test: FAILED"
exit 1
fi
$TEST_TARGET_SO --stack test deploy down --delete-volumes
# Now when we bring the container up the volume will be new again
$TEST_TARGET_SO --stack test deploy up
log_output_2=$( $TEST_TARGET_SO --stack test deploy logs )
if [[ "$log_output_2" == *"Filesystem is fresh"* ]]; then
echo "Delete volumes test: passed"
else
echo "Delete volumes test: FAILED"
exit 1
fi
$TEST_TARGET_SO --stack test deploy down --delete-volumes
echo "Test passed" echo "Test passed"