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
1=== modified file 'debian/tests/manual-provider'
2--- debian/tests/manual-provider 2016-03-22 16:27:15 +0000
3+++ debian/tests/manual-provider 2016-04-19 06:40:01 +0000
4@@ -9,6 +9,7 @@
5 ip=`ip -o -4 addr show|awk '{print $4}'|cut -f1 -d/|grep -v '^127.0.0.1$'|head -1`
6
7 mkdir -pm700 ~/.ssh
8+rm -f ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
9 ssh-keygen -f ~/.ssh/id_rsa -N ''
10 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
11 ssh-keyscan "$ip" >> ~/.ssh/known_hosts
12
13=== modified file 'debian/tests/normal-user.sh'
14--- debian/tests/normal-user.sh 2016-04-14 22:49:27 +0000
15+++ debian/tests/normal-user.sh 2016-04-19 06:40:01 +0000
16@@ -9,13 +9,10 @@
17
18 # Author: Robie Basak <robie.basak@canonical.com>
19
20-adduser --disabled-password --gecos '' jujutest
21+adduser --system --shell /bin/sh --disabled-password --gecos '' jujutest
22 adduser jujutest lxd || true
23
24 # Allow jujutest to sudo back to root (this is what juju expects)
25 echo 'jujutest ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/jujutest
26
27-sudo -iu jujutest sh <<EOT
28-cd "$PWD"
29-$@
30-EOT
31+su jujutest -l -c "cd '$PWD'; $@"

Subscribers

People subscribed via source and target branches