Merge lp:~smoser/maas/rename-patch into lp:~maas-maintainers/maas/packaging

Proposed by Scott Moser
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 89
Merged at revision: 87
Proposed branch: lp:~smoser/maas/rename-patch
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 176 lines (+73/-77)
4 files modified
debian/changelog (+1/-1)
debian/patches/04-add-maas-integration.py (+0/-75)
debian/patches/series (+0/-1)
tests/maas-integration.py (+72/-0)
To merge this branch: bzr merge lp:~smoser/maas/rename-patch
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+124506@code.launchpad.net

Commit message

Fix daily package build.

Description of the change

Fix daily package build.

In a previous commit (revno 86), I had moved tests/maas-integration.py out of the
tree and into a patch, as debian packaging should not modify files outside of
debian/ directly (debuild --source-option=--abort-on-upstream-changes).

However, apparently that makes the daily builder hit a bug [1,2] as discussed at [3].

So, for now I'm putting this back in as it was, as that previously built.

--
[1] https://code.launchpad.net/~maas-maintainers/+archive/dailybuilds/+recipebuild/307084
[2] https://launchpadlibrarian.net/115990138/buildlog.txt.gz
[3] http://irclogs.ubuntu.com/2012/09/14/%23bzr.html

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-09-14 17:55:18 +0000
+++ debian/changelog 2012-09-14 20:02:23 +0000
@@ -1,4 +1,4 @@
1maas (0.1+bzr1001+dfsg-0ubuntu3) UNRELEASED; urgency=low1maas (0.1+bzr1002+dfsg-0ubuntu3) UNRELEASED; urgency=low
22
3 [ Scott Moser ]3 [ Scott Moser ]
4 * debian/maas-dhcp.{install,apparmor,postrm} install apparmor profile into4 * debian/maas-dhcp.{install,apparmor,postrm} install apparmor profile into
55
=== removed file 'debian/patches/04-add-maas-integration.py'
--- debian/patches/04-add-maas-integration.py 2012-09-14 18:13:33 +0000
+++ debian/patches/04-add-maas-integration.py 1970-01-01 00:00:00 +0000
@@ -1,75 +0,0 @@
1--- /dev/null
2+++ b/tests/maas-integration.py
3@@ -0,0 +1,72 @@
4+# TODO
5+# - send ipmi commands to turn on/off nodes
6+# - run import pxe files
7+# - check node states once they're on/off
8+# - check node state changes (declared -> commissionig -> ready)
9+import os
10+from subprocess import check_output
11+import sys
12+from unittest import TestCase
13+
14+from pyvirtualdisplay import Display
15+from sst.actions import (
16+ assert_url, assert_text_contains, assert_title_contains, click_button,
17+ get_element, go_to, write_textfield)
18+
19+
20+sys.path.insert(0, "/usr/share/maas")
21+os.environ['DJANGO_SETTINGS_MODULE'] = 'maas.settings'
22+from maasserver.models import User
23+
24+MAAS_URL = "http://10.98.0.13/MAAS"
25+ADMIN_USER = "admin"
26+PASSWORD = "test"
27+
28+
29+class TestMAASIntegration(TestCase):
30+
31+ def setUp(self):
32+ self.display = Display(visible=0, size=(1280, 1024))
33+ self.display.start()
34+
35+ def tearDown(self):
36+ self.display.stop()
37+
38+ def createadmin(self):
39+ """Run sudo maas createsuperuser."""
40+ cmd_output = check_output(
41+ ["sudo", "maas", "createsuperuser", "--username=%s" % ADMIN_USER,
42+ "--email=example@canonical.com", "--noinput"])
43+ ## Set password for admin user.
44+ try:
45+ admin = User.objects.get(username=ADMIN_USER)
46+ except User.DoesNotExist:
47+ admin = User(username=ADMIN_USER)
48+ admin.set_password(PASSWORD)
49+ admin.save()
50+ return cmd_output
51+
52+ def installation(self):
53+ # Check the installation worked.
54+ go_to(MAAS_URL)
55+ assert_text_contains(
56+ get_element(tag="body"), "No admin user has been created yet")
57+
58+ def createadmin_and_login(self):
59+ ## Creates the admin user.
60+ output = self.createadmin()
61+ self.assertEqual(output, 'Superuser created successfully.')
62+ ## Login with the newly created admin user
63+ go_to(MAAS_URL)
64+ assert_text_contains(
65+ get_element(tag="body"), "Login to lenovo-RD230-01 MAAS")
66+ write_textfield("id_username", ADMIN_USER)
67+ write_textfield("id_password", PASSWORD)
68+ click_button("Login")
69+ assert_url("MAAS/")
70+ assert_title_contains("Dashboard")
71+
72+ def test_integration(self):
73+ # Run the integration tests in order.
74+ self.installation()
75+ self.createadmin_and_login()
760
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-09-14 18:13:33 +0000
+++ debian/patches/series 2012-09-14 20:02:23 +0000
@@ -1,4 +1,3 @@
101-fix-database-settings.patch101-fix-database-settings.patch
202-pserv-config.patch202-pserv-config.patch
303-txlongpoll-config.patch303-txlongpoll-config.patch
404-add-maas-integration.py
54
=== added directory 'tests'
=== added file 'tests/maas-integration.py'
--- tests/maas-integration.py 1970-01-01 00:00:00 +0000
+++ tests/maas-integration.py 2012-09-14 20:02:23 +0000
@@ -0,0 +1,72 @@
1# TODO
2# - send ipmi commands to turn on/off nodes
3# - run import pxe files
4# - check node states once they're on/off
5# - check node state changes (declared -> commissionig -> ready)
6import os
7from subprocess import check_output
8import sys
9from unittest import TestCase
10
11from pyvirtualdisplay import Display
12from sst.actions import (
13 assert_url, assert_text_contains, assert_title_contains, click_button,
14 get_element, go_to, write_textfield)
15
16
17sys.path.insert(0, "/usr/share/maas")
18os.environ['DJANGO_SETTINGS_MODULE'] = 'maas.settings'
19from maasserver.models import User
20
21MAAS_URL = "http://10.98.0.13/MAAS"
22ADMIN_USER = "admin"
23PASSWORD = "test"
24
25
26class TestMAASIntegration(TestCase):
27
28 def setUp(self):
29 self.display = Display(visible=0, size=(1280, 1024))
30 self.display.start()
31
32 def tearDown(self):
33 self.display.stop()
34
35 def createadmin(self):
36 """Run sudo maas createsuperuser."""
37 cmd_output = check_output(
38 ["sudo", "maas", "createsuperuser", "--username=%s" % ADMIN_USER,
39 "--email=example@canonical.com", "--noinput"])
40 ## Set password for admin user.
41 try:
42 admin = User.objects.get(username=ADMIN_USER)
43 except User.DoesNotExist:
44 admin = User(username=ADMIN_USER)
45 admin.set_password(PASSWORD)
46 admin.save()
47 return cmd_output
48
49 def installation(self):
50 # Check the installation worked.
51 go_to(MAAS_URL)
52 assert_text_contains(
53 get_element(tag="body"), "No admin user has been created yet")
54
55 def createadmin_and_login(self):
56 ## Creates the admin user.
57 output = self.createadmin()
58 self.assertEqual(output, 'Superuser created successfully.')
59 ## Login with the newly created admin user
60 go_to(MAAS_URL)
61 assert_text_contains(
62 get_element(tag="body"), "Login to lenovo-RD230-01 MAAS")
63 write_textfield("id_username", ADMIN_USER)
64 write_textfield("id_password", PASSWORD)
65 click_button("Login")
66 assert_url("MAAS/")
67 assert_title_contains("Dashboard")
68
69 def test_integration(self):
70 # Run the integration tests in order.
71 self.installation()
72 self.createadmin_and_login()

Subscribers

People subscribed via source and target branches