-
Notifications
You must be signed in to change notification settings - Fork 507
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
fix: broken authorized keys bootstrap test #18400
Conversation
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.
It works on my machine, but I'm not sure this change actually fixes the problem you described.
@@ -28,10 +28,11 @@ run_bootstrap_authorized_keys_loaded() { | |||
ssh-keygen -t ed25519 -f "$extra_key_file" -C "[email protected]" -P "" | |||
|
|||
HOME="${SUB_TEST_DIR}" | |||
JUJU_DATA="${juju_home_dir}" |
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.
Are you sure this works? This variable is not actually being exported here, just set locally. I don't think the juju cli would be aware of it.
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.
Hence the shell check error:
| In tests/suites/authorized_keys/bootstrap.sh line 77:
| JUJU_DATA="${juju_home_dir}"
| ^-------^ SC2034 (warning): JUJU_DATA appears unused. Verify use (or export if used externally).
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.
Fixed up.
bootstrap_additional_args=(--config "'authorized-keys=$(cat ${extra_key_file_pub})'") | ||
export BOOTSTRAP_ADDITIONAL_ARGS="${bootstrap_additional_args[*]}" | ||
export BOOTSTRAP_REUSE=false | ||
bootstrap "authorized-keys-default" "$log_file" | ||
bootstrap "authorized-keys-loaded" "$log_file" |
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.
Why change the controller name?
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.
It was wrong and causing another issue. It should reflect the name of the test. Just a bad copy and paste i fixed as a drive by.
2674b57
to
9b08995
Compare
/build |
d281894
to
c28c2c7
Compare
This commit fixes broken authorized keys test for bootstrap. It has been a problem that the authorized_keys bootstrap tests have been failing in our CI environment and not on local machines when testing. The reason for this failaure is due to our CI environment having set the JUJU_DATA env variable. This set of tests needs to be able to hijack the Juju home data directory to establish a controlled environment. Because the CI system had this env set Juju was using the wrong directory for it's data. The fix is to make sure that we set this variable for the duration of the test to the value we want.
c28c2c7
to
9b1268f
Compare
/build |
/merge |
This commit fixes broken authorized keys test for bootstrap. It has been a problem that the authorized_keys bootstrap tests have been failing in our CI environment and not on local machines when testing.
The reason for this failaure is due to our CI environment having set the JUJU_DATA env variable. This set of tests needs to be able to hijack the Juju home data directory to establish a controlled environment.
Because the CI system had this env set Juju was using the wrong directory for it's data. The fix is to make sure that we set this variable for the duration of the test to the value we want.
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
We can confirm this fix with the following steps:
JUJU_DATA=foobar ./main.sh -v authorized_keys test_bootstrap_authorized_keys
If the tests run successfully then everything is resolved.
Documentation changes
Jira card: JUJU-6889