Merge lp:~psivaa/ubuntu-test-cases/desktop_de into lp:~javier.collado/ubuntu-test-cases/desktop

Proposed by Para Siva
Status: Merged
Approved by: Javier Collado
Approved revision: 38
Merged at revision: 35
Proposed branch: lp:~psivaa/ubuntu-test-cases/desktop_de
Merge into: lp:~javier.collado/ubuntu-test-cases/desktop
Diff against target: 150 lines (+117/-0)
6 files modified
preseeds/default_de.cfg (+38/-0)
runlists/default_de.run (+8/-0)
scripts/default_de.sh (+10/-0)
testsuites/usit/archive_location/tc_control (+9/-0)
testsuites/usit/archive_location/test.py (+51/-0)
testsuites/usit/tslist.run (+1/-0)
To merge this branch: bzr merge lp:~psivaa/ubuntu-test-cases/desktop_de
Reviewer Review Type Date Requested Status
Javier Collado Approve
Max Brustkern (community) Approve
Para Siva (community) Needs Resubmitting
Review via email: mp+143878@code.launchpad.net

Description of the change

This is to add German language default installation test. The test is almost identical to the standard (English) installation test except the locale and the location variation. Gernam specific script and the preseed files are added and the default (English) runlist is used. The tests succeed in the local run but fails right now on the QA lab due to an ubiquity bug, lp:1098577 which is now fix commited and awaiting release.

To post a comment you must log in.
Revision history for this message
Javier Collado (javier.collado) wrote :

Isn't really very important, but comparing the default preseed and the one for
the German locale, I see this:

$ diff preseeds/default{,_de}.cfg
21c21
< d-i debian-installer/locale string en_US.UTF-8
---
> d-i debian-installer/locale string de_DE.UTF-8
30c30
< d-i time/zone string Etc/UTC
---
> d-i time/zone string US/Eastern

I don't think the time zone has any effect in the test case, but I guess is
more appropriate to use a more common value like 'Europe/Berlin'.

Revision history for this message
Para Siva (psivaa) wrote :

Thanks for the comment. The timezone was selected to suite the location where the tests are run. In fact we would not have discovered the bug above (lp:1098577) had we used Europe/Berlin. So in my view use of US/Eastern is the best selection.

36. By Para Siva

Adding a post installation test to check for the correct archive location for non-English installations

37. By Para Siva

Adding runlist for german installation tests

38. By Para Siva

Adding the archive location test in tslist

Revision history for this message
Para Siva (psivaa) wrote :

Thanks for the conversation Javier regarding adding a post installation test to specifically test the archive location. The test has now been added now and a separate runlist, default_de.run has also been added with the added test. The tslist.run has also been edited to include the new test which was necessary for the local run.

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

This looks reasonable to me.

review: Approve
Revision history for this message
Javier Collado (javier.collado) wrote :

Looks good, thanks.

In the version I'm merging, I've applied a few changes to read sources file
just once and to fix a couple of pep8/pep257 warnings.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'preseeds/default_de.cfg'
2--- preseeds/default_de.cfg 1970-01-01 00:00:00 +0000
3+++ preseeds/default_de.cfg 2013-01-18 17:54:21 +0000
4@@ -0,0 +1,38 @@
5+#
6+# Copyright (C) 2010, Canonical Ltd (http://www.canonical.com/)
7+#
8+# This file is part of ubuntu-server-iso-testing.
9+#
10+# ubuntu-server-iso-testing is free software: you can redistribute it
11+# and/or modify it under the terms of the GNU General Public License
12+# as published by the Free Software Foundation, either version 3 of
13+# the License, or (at your option) any later version.
14+#
15+# ubuntu-server-iso-testing is distributed in the hope that it will
16+# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+# GNU General Public License for more details.
19+#
20+# You should have received a copy of the GNU General Public License
21+# along with ubuntu-server-iso-testing. If not, see
22+# <http://www.gnu.org/licenses/>.
23+#
24+
25+d-i debian-installer/locale string de_DE.UTF-8
26+d-i netcfg/get_hostname string utah-example
27+d-i partman-auto/method string regular
28+#need this for desktop
29+d-i partman/choose_partition select Finish partitioning and write changes to disk
30+#need this for cobbler
31+d-i partman/confirm boolean true
32+#need this for non-desktop
33+d-i partman/confirm_nooverwrite boolean true
34+d-i time/zone string US/Eastern
35+d-i passwd/user-fullname string UTAH
36+d-i passwd/username string utah
37+d-i passwd/user-password password !ubuntu123
38+d-i passwd/user-password-again password !ubuntu123
39+d-i pkgsel/include string openssh-server python-yaml bzr git gdebi-core
40+#need this for non-desktop
41+d-i finish-install/reboot_in_progress note
42+d-i preseed/late_command string chroot /target sh -c 'chmod g+w /var/lib/utah/testsuites; apt-get install -y --force-yes imagemagick'; [ "$?" -eq "0" ]
43
44=== added file 'runlists/default_de.run'
45--- runlists/default_de.run 1970-01-01 00:00:00 +0000
46+++ runlists/default_de.run 2013-01-18 17:54:21 +0000
47@@ -0,0 +1,8 @@
48+testsuites:
49+ - name: usit
50+ fetch_method: bzr-export
51+ fetch_location: lp:~javier.collado/ubuntu-test-cases/desktop/testsuites/usit
52+ include_tests:
53+ - read_write
54+ - dbus_machine_id
55+ - archive_location
56
57=== added file 'scripts/default_de.sh'
58--- scripts/default_de.sh 1970-01-01 00:00:00 +0000
59+++ scripts/default_de.sh 2013-01-18 17:54:21 +0000
60@@ -0,0 +1,10 @@
61+#!/bin/sh
62+# Run default scenario
63+SCRIPT_DIR=$(readlink -e $(dirname $0))
64+BRANCH_DIR=${BRANCH_DIR:-lp:~javier.collado/ubuntu-test-cases/desktop}
65+PRESEED=$BRANCH_DIR/preseeds/default_de.cfg
66+RUNLIST=$BRANCH_DIR/runlists/default_de.run
67+
68+. $SCRIPT_DIR/base.sh
69+parse_args "$@"
70+echo $CMD
71
72=== added directory 'testsuites/usit/archive_location'
73=== added file 'testsuites/usit/archive_location/tc_control'
74--- testsuites/usit/archive_location/tc_control 1970-01-01 00:00:00 +0000
75+++ testsuites/usit/archive_location/tc_control 2013-01-18 17:54:21 +0000
76@@ -0,0 +1,9 @@
77+description: Sources.list should match archive according to the timezone
78+dependencies: none
79+action: |
80+ 1. Check if the archive location matches the timezone and not the locale
81+expected_results: |
82+ 1. Archive location matches the timezone and not the locale
83+type: userland
84+command: ./test.py
85+run_as: utah
86
87=== added file 'testsuites/usit/archive_location/test.py'
88--- testsuites/usit/archive_location/test.py 1970-01-01 00:00:00 +0000
89+++ testsuites/usit/archive_location/test.py 2013-01-18 17:54:21 +0000
90@@ -0,0 +1,51 @@
91+#!/usr/bin/python
92+#
93+# Copyright (C) 2013, Canonical Ltd (http://www.canonical.com/)
94+#
95+# This file is part of ubuntu-test-cases.
96+#
97+# ubuntu-test-cases is free software: you can redistribute it
98+# and/or modify it under the terms of the GNU General Public License
99+# as published by the Free Software Foundation, either version 3 of
100+# the License, or (at your option) any later version.
101+#
102+# ubuntu-test-cases is distributed in the hope that it will
103+# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
104+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105+# GNU General Public License for more details.
106+#
107+# You should have received a copy of the GNU General Public License
108+# along with ubuntu-test-cases. If not, see
109+# <http://www.gnu.org/licenses/>.
110+
111+"""Archive location should only match the timezone and not the locale"""
112+
113+import logging
114+import os.path
115+import unittest
116+
117+
118+class ArchiveLocationTest(unittest.TestCase):
119+ SOURCES_FILE = '/etc/apt/sources.list'
120+
121+ # Timezone is US/Eastern. Hence correct archive is us.archive.ubuntu.com
122+ # de.archive.ubuntu.com is incorrect even when the locale is de_DE.UTF-8
123+ RIGHT_LOC = 'us.archive.ubuntu.com'
124+ WRONG_LOC = 'de.archive.ubuntu.com'
125+
126+ def test_archive_location(self):
127+ """Test sources.list contains correct archive settings"""
128+ logging.info('Checking that arcive location is ({!r})'
129+ .format(self.RIGHT_LOC))
130+ self.assertTrue(self.RIGHT_LOC in open(self.SOURCES_FILE).read(),
131+ 'Archive is not US specific')
132+
133+ logging.info('Checking that arcive location is NOT ({!r})'
134+ .format(self.WRONG_LOC))
135+ self.assertTrue(self.WRONG_LOC not in open(self.SOURCES_FILE).read(),
136+ 'Archive is set according to locale - German')
137+
138+if __name__ == '__main__':
139+ logging.basicConfig(level=logging.DEBUG,
140+ format='%(levelname)s: %(message)s')
141+ unittest.main()
142
143=== modified file 'testsuites/usit/tslist.run'
144--- testsuites/usit/tslist.run 2013-01-03 23:32:23 +0000
145+++ testsuites/usit/tslist.run 2013-01-18 17:54:21 +0000
146@@ -11,3 +11,4 @@
147 - test: total_disk
148 - test: disk_not_full
149 - test: out_of_memory
150+- test: archive_location

Subscribers

People subscribed via source and target branches

to all changes: