Merge lp:~powersj/ubuntu-test-cases/server into lp:ubuntu-test-cases/server

Proposed by Joshua Powers
Status: Merged
Merge reported by: Joshua Powers
Merged at revision: not available
Proposed branch: lp:~powersj/ubuntu-test-cases/server
Merge into: lp:ubuntu-test-cases/server
Diff against target: 47 lines (+7/-13)
1 file modified
testsuites/lxc/test_lxc_simple/lxctest.py (+7/-13)
To merge this branch: bzr merge lp:~powersj/ubuntu-test-cases/server
Reviewer Review Type Date Requested Status
Max Brustkern (community) Needs Information
Ubuntu Server Developers Pending
Review via email: mp+301703@code.launchpad.net

Description of the change

All LXC tests are currently failing across all three releases and both architectures. There are two issues that are test specific, not LXC or ISO related:

1) The LXC tests try to spin up images of various Ubuntu releases. The releases that are used are hard coded for specific versions that are now archived and no longer available. To fix this I have changed to the code to use distro_info python module to find all the supported Ubuntu releases.

2) The LXC API test appears to require sudo privileges. When running as a normal users it fails at creating the container, therefore I have added sudo to the command.

These changes should at least get the test going again, if not allow them to pass.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

The distro_info changes look excellent. By default, all tests are run as root anyway, so I'm interested in why we need sudo in addition to that. Did you run this using the utah client (utah), the full utah process (run_utah_tests.py), or some other method?

review: Needs Information
Revision history for this message
Joshua Powers (powersj) wrote :

Now that I look at the failing test logs further it does look like the effective user id is root. I am trying to come up with a way to triage this further.

My original process was that I downloaded the API test and ran on local Xenial VM. When I ran as a normal user I got the following output:

Creating rootfs using 'download', arch=amd64
Traceback (most recent call last):
  File "src/python-lxc/examples/api_test.py", line 71, in <module>
    assert(container.defined)
AssertionError

Which is the same error showing up in the test output. This occurs when trying to create a container and then verify it:

print("Creating rootfs using 'download', arch=%s" % arch)
container.create("download", 0,
                 {"dist": "ubuntu",
                  "release": "trusty",
                  "arch": arch})

assert(container.defined)

However on my local machine when I run as root I do not have any errors and the API test completes successfully.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

Yeah, utah will run as root unless the user line in the config is set to something else, so you can probably drop the sudo, and then I think this should be good to go.

lp:~powersj/ubuntu-test-cases/server updated
106. By Joshua Powers

Merging kernel size update

107. By Joshua Powers

Updating lxc tests to use distro-info over hardcoded values.

108. By Joshua Powers

Updating preseeds with new syntax.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'testsuites/lxc/test_lxc_simple/lxctest.py'
2--- testsuites/lxc/test_lxc_simple/lxctest.py 2013-03-05 14:17:23 +0000
3+++ testsuites/lxc/test_lxc_simple/lxctest.py 2016-08-01 21:09:40 +0000
4@@ -1,5 +1,6 @@
5 #!/usr/bin/python
6
7+import distro_info
8 import os
9 import platform
10 import subprocess
11@@ -13,7 +14,7 @@
12
13
14 class Lxc:
15- def __init__(self, template="ubuntu", relnum="12.04", release=None,
16+ def __init__(self, template="ubuntu", release=None,
17 config=None, name=None):
18 self.name = name
19 if not name:
20@@ -166,22 +167,15 @@
21 elif self.arch == "armv7l":
22 self.arch = "armel"
23
24- if self.arch == "armel" or self.arch == "armhf":
25- self.tests = [["ubuntu", 12.04, "precise"],
26- ["ubuntu", 13.04, "raring"]]
27- else:
28- self.tests = [["ubuntu", 8.04, "lucid"],
29- ["ubuntu", 12.04, "precise"],
30- ["ubuntu", 13.04, "raring"],
31- #["ubuntu-cloud", 8.04, "lucid"],
32- #["ubuntu-cloud", 12.04, "precise"],
33- ]
34+ ubuntuinfo = distro_info.UbuntuDistroInfo()
35+ ubuntusupported = ubuntuinfo.supported()
36+ self.tests = [['ubuntu', u] for u in ubuntusupported]
37
38 def runTest(self):
39- for (t, relnum, r) in self.tests:
40+ for (t, r) in self.tests:
41 try:
42 test = "initialization"
43- l = Lxc(template=t, relnum=relnum, release=r)
44+ l = Lxc(template=t, release=r)
45 test = "destroy preexisting"
46 l.Destroy(ignorefail=True)
47 test = "create"

Subscribers

People subscribed via source and target branches

to all changes: