Skip to content

Commit

Permalink
create model for subtests
Browse files Browse the repository at this point in the history
  • Loading branch information
evanson committed Sep 6, 2022
1 parent 423338a commit b01db70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/suites/relations/task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ test_relations() {
test_relation_data_exchange
test_relation_departing_unit
test_relation_list_app

destroy_controller "test-relations"
}
14 changes: 7 additions & 7 deletions tests/suites/storage/charm_storage.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# This subtest tests that juju can create storage pools for the different storage providers
# and can deploy a charm and make use of the already provisioned different storage types.
run_charm_storage() {
echo

model_name="test-storage"
model_name="charm-storage"
file="${TEST_DIR}/test-${model_name}.log"

ensure "${model_name}" "${file}"

echo "Assess create-storage-pool"
juju create-storage-pool -m "${model_name}" loopy loop size=1G
Expand Down Expand Up @@ -42,9 +47,7 @@ run_charm_storage() {
# remove the application
juju remove-application dummy-storage-fs
wait_for "{}" ".applications"

# Assess charm storage with the filesystem storage provider

echo "Assessing block loop disk 1"
juju deploy ./testcharms/charms/dummy-storage-lp --series="jammy" --storage disks=loop,1G
wait_for "dummy-storage-lp" ".applications"
Expand All @@ -57,7 +60,6 @@ run_charm_storage() {
# assert the attached unit state
juju list-storage --format json | jq '.storage[] | .attachments |.units[] | .life' | check "alive"
echo "Block loop disk 1 PASSED"

echo "Assessing add storage block loop disk 2"
juju add-storage -m "${model_name}" dummy-storage-lp/0 disks=1
# assert the storage kind name
Expand All @@ -72,7 +74,6 @@ run_charm_storage() {
# remove the application
juju remove-application dummy-storage-lp
wait_for "{}" ".applications"

echo "Assessing filesystem tmpfs"
juju deploy -m "${model_name}" ./testcharms/charms/dummy-storage-tp --series jammy --storage data=tmpfs,1G
wait_for "dummy-storage-tp" ".applications"
Expand All @@ -88,7 +89,6 @@ run_charm_storage() {
# remove the application
juju remove-application dummy-storage-tp
wait_for "{}" ".applications"

echo "Assessing filesystem"
juju deploy -m "${model_name}" ./testcharms/charms/dummy-storage-np --series jammy --storage data=1G
wait_for "dummy-storage-np" ".applications"
Expand All @@ -106,7 +106,6 @@ run_charm_storage() {
wait_for "{}" ".applications"
# We remove storage data/4 since in Juju 2.3+ it is persistent. Otherwise it will interfere with the next test's results
juju remove-storage data/4

echo "Assessing multiple filesystem, block, rootfs, loop"
juju deploy -m "${model_name}" ./testcharms/charms/dummy-storage-mp --series jammy --storage data=1G
wait_for "dummy-storage-mp" ".applications"
Expand All @@ -124,6 +123,7 @@ run_charm_storage() {
wait_for "{}" ".applications"
echo "All charm storage tests PASSED"

destroy_model "${model_name}"
}

test_charm_storage() {
Expand Down

0 comments on commit b01db70

Please sign in to comment.