Code review comment for lp:~qzhang/lava-dispatcher/test-abrek

Revision history for this message
Paul Larson (pwlars) wrote :

We talked about this a bit on irc, and in previous email threads, but I wanted to capture it here too. Abrek should be installed from bzr, and done while booted into the master image. To accomplish this, we previously talked about having a small extension to the job format that would, as part of deployment, tell it to install "extra" things. one of the supported "extras" to install could be abrek, and one of the parameters it could take is the name of the test you would like to install under abrek. This way, after deploying the image, we can have it chroot into the newly-installed image, pull the latest abrek branch, install dependencies, and run abrek install [testname]

25 + rc = self.client.run_shell_command(
26 + 'abrek list-installed | grep %s' % test_name,
27 + response = test_name, timeout=10)
We don't need to check for this. We should only be installing tests once on a fresh image, so there shouldn't be any tests installed already.

58 - self.proc.expect(response, timeout=timeout)
59 + id = self.proc.expect(response, timeout=timeout)
60 + if id == 0:
61 + return True
62 + else:
63 + return False
64 + return True
I don't think this is going to do what you think. Either it get's the only response it knows about, or, it will timeout and raise an exception. If you try to use run_shell_command and gave it a response to look for, and didn't get an exception, then you know it worked.

« Back to merge proposal