-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JUJU-1198] Rewrite to bash-based nw-destroy-model-lxd #14436
[JUJU-1198] Rewrite to bash-based nw-destroy-model-lxd #14436
Conversation
tests/suites/model/destroy.sh
Outdated
|
||
echo "Destroy model 'model-new'" | ||
destroy_model "model-new" | ||
juju switch :model-destroy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We technically don't need the colon here
And also, this is incorrect I believe. The original test asserts that if the active model is destroyed, you are automatically switched to another
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agreed about the colon. But I've concerns about automatic switching:
https://pastebin.canonical.com/p/99Y9R7jQ7b/
Here is the origin (python-based) test:
juju/acceptancetests/assess_destroy_model.py
Lines 47 to 53 in 137a772
destroy_model(client, new_client) | |
log.info('Juju successfully dropped its current model. ' | |
'Switching to {} to complete test'.format(current_model)) | |
switch_model(client, current_model, controller) | |
log.info('SUCCESS') |
juju models --format json | jq -r '."current-model"' | check model-destroy | ||
|
||
destroy_model "model-destroy" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small bit of coverage missing
juju/acceptancetests/assess_destroy_model.py
Lines 68 to 70 in ac9ddca
if not_found_error in e.stderr: | |
log.info("Model fully removed") | |
break |
The python based test ensures that the created model can't be found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destroy_model "model-new"
is_destroyed=$(juju models --format json | jq -r '.models[] | select(."short-name" == "model-new")')
if [[ -z ${is_destroyed} ]]; then is_destroyed=true; fi
check_contains "${is_destroyed}" true
Added explicit model deletion check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
#14488 ``` Merge branch '2.9' into develop # Conflicts: # .github/workflows/smoke.yml # apiserver/common/tools_test.go # apiserver/facades/client/application/application_unit_test.go # apiserver/facades/client/application/mock_test.go # apiserver/facades/client/application/package_test.go # apiserver/facades/client/cloud/cloudV2_test.go # apiserver/facades/client/cloud/cloud_test.go # caas/kubernetes/provider/application/application.go # cmd/juju/commands/upgradecontroller_test.go # cmd/juju/commands/upgrademodel.go # cmd/juju/commands/upgrademodel_test.go # cmd/juju/controller/kill.go # go.mod # go.sum # scripts/win-installer/setup.iss # snap/snapcraft.yaml # tests/suites/deploy/bundles/lxd-profile-bundle.yaml # tests/suites/deploy/bundles/telegraf_bundle.yaml # tests/suites/deploy/bundles/trusted_bundle.yaml # tests/suites/deploy/deploy_charms.sh # tests/suites/network/network_health.sh # tests/suites/ovs_maas/ovs_netplan_config.sh # tests/suites/spaces_ec2/juju_bind.sh # tests/suites/spaces_ec2/upgrade_charm_with_bind.sh # tests/suites/upgrade/streams.sh # upgrades/operations.go # upgrades/upgrade_test.go # version/version.go ``` Includes PRs: - #14424 - #14428 - #14430 - #14431 - #14427 - #14433 - #14434 - #14437 - #14439 - #14440 - #14442 - #14445 - #14446 - #14444 - #14448 - #14453 - #14436 - #14459 - #14462 - #14458 - #14418 - #14419 - #14463 - #14464 - #14455 - #14449 - #14465 - #14470 - #14473 - #14476 - #14468 - #14383 - #14483
This patch adds destroy model test to the model suite in bash-based tests.
Original (python-based) tests live here.
Checklist
[ ] Go unit tests, with comments saying what you're testing[ ] Integration tests, with comments saying what you're testing[ ] doc.go added or updated in changed packagesQA steps
cd tests ./main.sh -v -p lxd model test_model_destroy