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
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-09-14 17:55:18 +0000
3+++ debian/changelog 2012-09-14 20:02:23 +0000
4@@ -1,4 +1,4 @@
5-maas (0.1+bzr1001+dfsg-0ubuntu3) UNRELEASED; urgency=low
6+maas (0.1+bzr1002+dfsg-0ubuntu3) UNRELEASED; urgency=low
7
8 [ Scott Moser ]
9 * debian/maas-dhcp.{install,apparmor,postrm} install apparmor profile into
10
11=== removed file 'debian/patches/04-add-maas-integration.py'
12--- debian/patches/04-add-maas-integration.py 2012-09-14 18:13:33 +0000
13+++ debian/patches/04-add-maas-integration.py 1970-01-01 00:00:00 +0000
14@@ -1,75 +0,0 @@
15---- /dev/null
16-+++ b/tests/maas-integration.py
17-@@ -0,0 +1,72 @@
18-+# TODO
19-+# - send ipmi commands to turn on/off nodes
20-+# - run import pxe files
21-+# - check node states once they're on/off
22-+# - check node state changes (declared -> commissionig -> ready)
23-+import os
24-+from subprocess import check_output
25-+import sys
26-+from unittest import TestCase
27-+
28-+from pyvirtualdisplay import Display
29-+from sst.actions import (
30-+ assert_url, assert_text_contains, assert_title_contains, click_button,
31-+ get_element, go_to, write_textfield)
32-+
33-+
34-+sys.path.insert(0, "/usr/share/maas")
35-+os.environ['DJANGO_SETTINGS_MODULE'] = 'maas.settings'
36-+from maasserver.models import User
37-+
38-+MAAS_URL = "http://10.98.0.13/MAAS"
39-+ADMIN_USER = "admin"
40-+PASSWORD = "test"
41-+
42-+
43-+class TestMAASIntegration(TestCase):
44-+
45-+ def setUp(self):
46-+ self.display = Display(visible=0, size=(1280, 1024))
47-+ self.display.start()
48-+
49-+ def tearDown(self):
50-+ self.display.stop()
51-+
52-+ def createadmin(self):
53-+ """Run sudo maas createsuperuser."""
54-+ cmd_output = check_output(
55-+ ["sudo", "maas", "createsuperuser", "--username=%s" % ADMIN_USER,
56-+ "--email=example@canonical.com", "--noinput"])
57-+ ## Set password for admin user.
58-+ try:
59-+ admin = User.objects.get(username=ADMIN_USER)
60-+ except User.DoesNotExist:
61-+ admin = User(username=ADMIN_USER)
62-+ admin.set_password(PASSWORD)
63-+ admin.save()
64-+ return cmd_output
65-+
66-+ def installation(self):
67-+ # Check the installation worked.
68-+ go_to(MAAS_URL)
69-+ assert_text_contains(
70-+ get_element(tag="body"), "No admin user has been created yet")
71-+
72-+ def createadmin_and_login(self):
73-+ ## Creates the admin user.
74-+ output = self.createadmin()
75-+ self.assertEqual(output, 'Superuser created successfully.')
76-+ ## Login with the newly created admin user
77-+ go_to(MAAS_URL)
78-+ assert_text_contains(
79-+ get_element(tag="body"), "Login to lenovo-RD230-01 MAAS")
80-+ write_textfield("id_username", ADMIN_USER)
81-+ write_textfield("id_password", PASSWORD)
82-+ click_button("Login")
83-+ assert_url("MAAS/")
84-+ assert_title_contains("Dashboard")
85-+
86-+ def test_integration(self):
87-+ # Run the integration tests in order.
88-+ self.installation()
89-+ self.createadmin_and_login()
90
91=== modified file 'debian/patches/series'
92--- debian/patches/series 2012-09-14 18:13:33 +0000
93+++ debian/patches/series 2012-09-14 20:02:23 +0000
94@@ -1,4 +1,3 @@
95 01-fix-database-settings.patch
96 02-pserv-config.patch
97 03-txlongpoll-config.patch
98-04-add-maas-integration.py
99
100=== added directory 'tests'
101=== added file 'tests/maas-integration.py'
102--- tests/maas-integration.py 1970-01-01 00:00:00 +0000
103+++ tests/maas-integration.py 2012-09-14 20:02:23 +0000
104@@ -0,0 +1,72 @@
105+# TODO
106+# - send ipmi commands to turn on/off nodes
107+# - run import pxe files
108+# - check node states once they're on/off
109+# - check node state changes (declared -> commissionig -> ready)
110+import os
111+from subprocess import check_output
112+import sys
113+from unittest import TestCase
114+
115+from pyvirtualdisplay import Display
116+from sst.actions import (
117+ assert_url, assert_text_contains, assert_title_contains, click_button,
118+ get_element, go_to, write_textfield)
119+
120+
121+sys.path.insert(0, "/usr/share/maas")
122+os.environ['DJANGO_SETTINGS_MODULE'] = 'maas.settings'
123+from maasserver.models import User
124+
125+MAAS_URL = "http://10.98.0.13/MAAS"
126+ADMIN_USER = "admin"
127+PASSWORD = "test"
128+
129+
130+class TestMAASIntegration(TestCase):
131+
132+ def setUp(self):
133+ self.display = Display(visible=0, size=(1280, 1024))
134+ self.display.start()
135+
136+ def tearDown(self):
137+ self.display.stop()
138+
139+ def createadmin(self):
140+ """Run sudo maas createsuperuser."""
141+ cmd_output = check_output(
142+ ["sudo", "maas", "createsuperuser", "--username=%s" % ADMIN_USER,
143+ "--email=example@canonical.com", "--noinput"])
144+ ## Set password for admin user.
145+ try:
146+ admin = User.objects.get(username=ADMIN_USER)
147+ except User.DoesNotExist:
148+ admin = User(username=ADMIN_USER)
149+ admin.set_password(PASSWORD)
150+ admin.save()
151+ return cmd_output
152+
153+ def installation(self):
154+ # Check the installation worked.
155+ go_to(MAAS_URL)
156+ assert_text_contains(
157+ get_element(tag="body"), "No admin user has been created yet")
158+
159+ def createadmin_and_login(self):
160+ ## Creates the admin user.
161+ output = self.createadmin()
162+ self.assertEqual(output, 'Superuser created successfully.')
163+ ## Login with the newly created admin user
164+ go_to(MAAS_URL)
165+ assert_text_contains(
166+ get_element(tag="body"), "Login to lenovo-RD230-01 MAAS")
167+ write_textfield("id_username", ADMIN_USER)
168+ write_textfield("id_password", PASSWORD)
169+ click_button("Login")
170+ assert_url("MAAS/")
171+ assert_title_contains("Dashboard")
172+
173+ def test_integration(self):
174+ # Run the integration tests in order.
175+ self.installation()
176+ self.createadmin_and_login()

Subscribers

People subscribed via source and target branches