Merge lp:~vorlon/ubuntu/xenial/juju/test-improvements into lp:~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta4

Proposed by Steve Langasek
Status: Merged
Merged at revision: 110
Proposed branch: lp:~vorlon/ubuntu/xenial/juju/test-improvements
Merge into: lp:~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta4
Diff against target: 31 lines (+3/-5)
2 files modified
debian/tests/manual-provider (+1/-0)
debian/tests/normal-user.sh (+2/-5)
To merge this branch: bzr merge lp:~vorlon/ubuntu/xenial/juju/test-improvements
Reviewer Review Type Date Requested Status
Martin Packman Pending
Review via email: mp+292218@code.launchpad.net

Description of the change

Minor adjustments to test runners to make them less fussy about the environment, so you can repeat tests without having to tear down the testbed (useful for debugging)

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I think this breaks the manual provider tests because the jujutest user now has /bin/false for a shell.

111. By Steve Langasek

make sure jujutest still gets a valid shell, so that ssh works

112. By Steve Langasek

And make the manual provider's ssh key setup idempotent

Revision history for this message
Steve Langasek (vorlon) wrote :

On Tue, Apr 19, 2016 at 03:54:16AM -0000, Michael Hudson-Doyle wrote:
> I think this breaks the manual provider tests because the jujutest user now has /bin/false for a shell.

Hmm, indeed. Pushed a couple of further fixes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/tests/manual-provider'
--- debian/tests/manual-provider 2016-03-22 16:27:15 +0000
+++ debian/tests/manual-provider 2016-04-19 06:40:01 +0000
@@ -9,6 +9,7 @@
9ip=`ip -o -4 addr show|awk '{print $4}'|cut -f1 -d/|grep -v '^127.0.0.1$'|head -1`9ip=`ip -o -4 addr show|awk '{print $4}'|cut -f1 -d/|grep -v '^127.0.0.1$'|head -1`
1010
11mkdir -pm700 ~/.ssh11mkdir -pm700 ~/.ssh
12rm -f ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
12ssh-keygen -f ~/.ssh/id_rsa -N ''13ssh-keygen -f ~/.ssh/id_rsa -N ''
13cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys14cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
14ssh-keyscan "$ip" >> ~/.ssh/known_hosts15ssh-keyscan "$ip" >> ~/.ssh/known_hosts
1516
=== modified file 'debian/tests/normal-user.sh'
--- debian/tests/normal-user.sh 2016-04-14 22:49:27 +0000
+++ debian/tests/normal-user.sh 2016-04-19 06:40:01 +0000
@@ -9,13 +9,10 @@
99
10# Author: Robie Basak <robie.basak@canonical.com>10# Author: Robie Basak <robie.basak@canonical.com>
1111
12adduser --disabled-password --gecos '' jujutest12adduser --system --shell /bin/sh --disabled-password --gecos '' jujutest
13adduser jujutest lxd || true13adduser jujutest lxd || true
1414
15# Allow jujutest to sudo back to root (this is what juju expects)15# Allow jujutest to sudo back to root (this is what juju expects)
16echo 'jujutest ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/jujutest16echo 'jujutest ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/jujutest
1717
18sudo -iu jujutest sh <<EOT18su jujutest -l -c "cd '$PWD'; $@"
19cd "$PWD"
20$@
21EOT

Subscribers

People subscribed via source and target branches