Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

functional: poweroff machine using machinectl instead of systemctl #1587

Merged

Conversation

dongsupark
Copy link
Contributor

So far ReplaceMember has been checking for error, by looking up an explicit string "Success" in stderr from "systemctl -M <ID> poweroff". However, with systemd v229 or newer, systemctl poweroff does not print out "Success" even if poweroff succeeded. This causes TestKnownHostsVerification to always return error like:

  --- FAIL: TestKnownHostsVerification (2.66s)
      client_test.go:60: Failed replacing machine: poweroff failed:

Fix it by changing the systemctl call to "machinectl poweroff <ID>", which should return error correctly. This would be better in the long run, than checking for messages in stderr.

Fixes: #1586

@jonboulle
Copy link
Contributor

Can't remember why we couldn't use this in the first place - but this LGTM if the tests pass.

So far ReplaceMember has been checking for error, by looking up an
explicit string "Success" in stderr from "systemctl -M <ID> poweroff".
However, with systemd v229 or newer, systemctl poweroff does not print
out "Success" even if poweroff succeeded. This causes
TestKnownHostsVerification to always return error like:

  --- FAIL: TestKnownHostsVerification (2.66s)
      client_test.go:60: Failed replacing machine: poweroff failed:

Fix it by changing the systemctl call to "machinectl poweroff <ID>",
which should return error correctly. This would be better in the long
run, than checking for messages in stderr.

Fixes: coreos#1586
@dongsupark dongsupark force-pushed the dongsu/poweroff-check-error-fxtests branch from bc2844a to 81c220a Compare May 23, 2016 18:43
@dongsupark
Copy link
Contributor Author

Yesterday I did a minor update by changing error message. Functional tests also passed. I'll merge it soon.

@dongsupark
Copy link
Contributor Author

Merged #1587.

@dongsupark dongsupark deleted the dongsu/poweroff-check-error-fxtests branch May 24, 2016 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants