Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

amulet test fails sometimes #5

Open
kwmonroe opened this issue Jun 8, 2016 · 2 comments
Open

amulet test fails sometimes #5

kwmonroe opened this issue Jun 8, 2016 · 2 comments

Comments

@kwmonroe
Copy link
Contributor

kwmonroe commented Jun 8, 2016

The test_java test isn't very smart:

https://github.com/juju-solutions/layer-openjdk/blob/master/tests/01-deploy.py#L26

The problem is, when we run this command on a unit unknown to our ~/.ssh/known_hosts, we get this garbage shoved in to the output:

2016-06-08 01:33:59 DEBUG FAILED (failures=1)

2016-06-08 01:33:59 DEBUG running java -version 2>&1

2016-06-08 01:33:59 DEBUG output from cmd: Warning: Permanently added '172.31.4.128' (ECDSA) to the list of known hosts.

2016-06-08 01:34:00 DEBUG Exit Code: 1

A good run would instead look like this:

2016-06-08 02:34:27 DEBUG OK

2016-06-08 02:34:27 DEBUG running java -version 2>&1

2016-06-08 02:34:27 DEBUG output from cmd: openjdk version "1.8.0_91"

2016-06-08 02:34:27 DEBUG OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-0ubuntu4~14.04-b14)

2016-06-08 02:34:27 DEBUG OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

2016-06-08 02:34:27 DEBUG Exit Code: 0

The fix should be simple enough... Adjust the cmd from this:

java -version 2>&1

to

java -version 2>&1 | grep version

Which would be good because it would scrub the output of any ssh warnings, and would ensure a version string comes back from "java -version". We only care that the grep comes back non-zero.

@kwmonroe
Copy link
Contributor Author

kwmonroe commented Jun 9, 2016

On closer inspection, the warning should not have caused the command to return non-zero. There may be something else afoot here, though the stricter output grep shouldn't harm anything.

@johnsca johnsca reopened this Jun 9, 2016
@johnsca
Copy link
Contributor

johnsca commented Jun 9, 2016

Re-opened for further investigation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants