Merge lp:~allenap/maas/remove-squashfs into lp:~maas-committers/maas/trunk

Proposed by Gavin Panella
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 1347
Proposed branch: lp:~allenap/maas/remove-squashfs
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 427 lines (+4/-271)
11 files modified
contrib/maas-http.conf (+0/-6)
contrib/preseeds_v2/generic (+0/-9)
contrib/preseeds_v2/preseed_master (+0/-3)
etc/maas/import_pxe_files (+0/-1)
etc/maas/import_squashfs (+0/-6)
scripts/maas-import-pxe-files (+0/-27)
scripts/maas-import-squashfs (+0/-172)
setup.py (+1/-3)
src/maasserver/preseed.py (+1/-12)
src/maasserver/tests/test_preseed.py (+2/-29)
src/provisioningserver/tests/test_maas_import_pxe_files.py (+0/-3)
To merge this branch: bzr merge lp:~allenap/maas/remove-squashfs
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Dave Walker (community) Needs Fixing
Review via email: mp+133954@code.launchpad.net

Commit message

Remove all install-via-squashfs support.

To post a comment you must log in.
Revision history for this message
Dave Walker (davewalker) wrote :

This doesn't comment a bug, or rational for removing this support.

review: Needs Fixing
Revision history for this message
Gavin Panella (allenap) wrote :

> This doesn't comment a bug, or rational for removing this support.

Good point. I've linked to 3 related bugs.

Rationale: this feature is not ready.

It has no automated tests, is attracting a disproportionate number of bugs, and doesn't work by most/all accounts. It should not have been landed in the first place. For an optimisation it's causing too many issues, so we (Julian, Raphael, Martin, myself) agreed this morning to remove it. We can reintroduce it, or its successor, once it's rock-solid outside of MAAS.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Dave, as Gavin says this feature is utterly broken right now, has no tests and I personally have never seen it work properly. I would be happy to re-instate it when the above are fixed, but I am under the impression (correct me if wrong) that you guys are working on something else anyway? In addition, I remember being told at UDS that it doesn't really speed up installation much over the d-i method.

I'll approve the change here on condition that Dave is ok with it too, based on my comments.

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

Daviey seems to be okay with this now (#maas, freenode) so I think we can move ahead.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

So let me get this straight... the reason of the removal is because its causing too many issues (bugs).

What are those?

1. One bug report I see linked is server side and is *not* An ssue with this feature.
2. Another report is an issue of not having updated a file with the release we want to import which is not even related to the script maas-import-squashfs but also affects maas-import-pxe-files and maas-import-ephemerals. and this bug would have still being there even of the feature wouldnt have existed.
3. Legitimate maas-import-squashfs.

So from above.. how in the world this feature is attracting a disproportionate number of bugs if only 1 of them is related.... with a fix that should only take a couple lines of code???

So i think t is not fair to argue that this causes more issues than anything else.

While it does lack tests.. so that's other import script that we have also seen broken in worse ways. This scripts is rock solid outside Maas and not because there's one minor bug it isn't. Otherwise other things wouldn't be rock solid for same or even worse bugs found in released versions of Maas.

Revision history for this message
Gavin Panella (allenap) wrote :

> So let me get this straight... the reason of the removal is because its
> causing too many issues (bugs).
>
> What are those?
>
> 1. One bug report I see linked is server side and is *not* An ssue with this
> feature.
> 2. Another report is an issue of not having updated a file with the release we
> want to import which is not even related to the script maas-import-squashfs
> but also affects maas-import-pxe-files and maas-import-ephemerals. and this
> bug would have still being there even of the feature wouldnt have existed.
> 3. Legitimate maas-import-squashfs.

Removing squashfs support means we can close two of these bugs, and
the third becomes a trivial fix.

>
> So from above..  how in the world this feature is attracting a
> disproportionate number of bugs if only 1 of them is related.... with a fix
> that should only take a couple lines of code???

For the size and benefit of the feature - i.e. a ~1 minute speedier
install - it's attracting a disproportionately high number of
bugs. That's my impression - I haven't tried to quantify it - but I'm
not alone in thinking this.

> So i think t is not fair to argue that this causes more issues than
> anything else.

I'm not saying that. I'm saying that it's more trouble than it's worth
right now. We don't *need* it, so it's better to move it out so that
we can work on - and SRU - a less-featureful but more stable product.

What is broken is the lack of tests. "Untested code is broken code" is
a principle that the Launchpad teams have all tried to follow for
years. It would be good to reintroduce this feature later on, or FPI,
but not in its current form.

>
> While it does lack tests.. so that's other import script that we have also
> seen broken in worse ways. This scripts is rock solid outside Maas and not
> because there's one minor bug it isn't. Otherwise other things wouldn't be
> rock solid for same or even worse bugs found in released versions of Maas.

Bugs filed is not a measure of quality.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

> > 1. One bug report I see linked is server side and is *not* An ssue with this
> > feature.
> > 2. Another report is an issue of not having updated a file with the release
> we
> > want to import which is not even related to the script maas-import-squashfs
> > but also affects maas-import-pxe-files and maas-import-ephemerals. and this
> > bug would have still being there even of the feature wouldnt have existed.
> > 3. Legitimate maas-import-squashfs.
>
> Removing squashfs support means we can close two of these bugs, and
> the third becomes a trivial fix.

Closing 1 doesn't change the fact that it is still an issue om the server side. If for some reason the PXE images would be unavailable from the server, then the same bug would apply to maas-import-pxe-files, or to maas-import-ephemerals for such case. That's even if we didn't have the support for squashfs. Either way, the bug reported by Diogo was only seen in the lab that maybe had bad mirrors, because it was proven that at other locations the bug wasn't present.

2 is a bug which is unrelated with squashfs support because this bug affects maas-import-pxe-files and maas-import-ephemerals. Removing the support doesn't fix it, because the bug will still be present even if there was no squashfs support. In fact, there's was a bug in MAAS that affected installations using squashfs, not because of the support but because of a bug in MAAS.

3. Simple fix.

>
> For the size and benefit of the feature - i.e. a ~1 minute speedier
> install - it's attracting a disproportionately high number of
> bugs. That's my impression - I haven't tried to quantify it - but I'm
> not alone in thinking this.

2 minute to be exact.

> What is broken is the lack of tests. "Untested code is broken code" is
> a principle that the Launchpad teams have all tried to follow for
> years. It would be good to reintroduce this feature later on, or FPI,
> but not in its current form.

Right, but I was just pointing out that it isn't the only thing untested that maas ships, is it? However, its been placed as a strong reason for dropping the support.

>
> Bugs filed is not a measure of quality.

Exactly, number of bugs is not a measure of quality; yet, the statement for removal of the feature is based on "disproportionate number of bugs" and "doesn't work by most/all accounts", which are both based and backed by 3 bug reports linked to this MP. However, both statements IMHO are incorrect.

Cheers

Revision history for this message
Gavin Panella (allenap) wrote :

On 13 November 2012 17:11, Andres Rodriguez <...> wrote:
...
>> For the size and benefit of the feature - i.e. a ~1 minute speedier
>> install - it's attracting a disproportionately high number of
>> bugs. That's my impression - I haven't tried to quantify it - but I'm
>> not alone in thinking this.
>
> 2 minute to be exact.

It's still an optimisation; it's neither needed for correct operation,
nor is it such a huge improvement that we could call it a killer
feature. FPI may qualify as the latter.

>
>
>> What is broken is the lack of tests. "Untested code is broken code" is
>> a principle that the Launchpad teams have all tried to follow for
>> years. It would be good to reintroduce this feature later on, or FPI,
>> but not in its current form.
>
> Right, but I was just pointing out that it isn't the only thing
> untested that maas ships, is it? However, its been placed as a
> strong reason for dropping the support.

Most parts that ship are tested; if something isn't tested it's a bug.

Notably the maas-import-* scripts are almost untested (there are basic
tests in provisioningserver.tests.test_maas_import_pxe_files, though
these just check the "happy path"; they don't demonstrate what happens
when there's an error).

I'd like to either massively increase test coverage for these scripts,
or remove them.

I'm not sure we have the time to improve test coverage, given that
writing tests often involves refactoring to make code testable, and
that we have no baseline to refactor against except for manual QA...
because there are almost no existing tests.

We need maas-import-pxe-files, -ephemerals and -isos, so we can't
remove them. However, we don't *need* squashfs support, so we don't
need maas-import-squashfs. Given that the feature does not work, and
that it needs non-trivial investment to get it working and covered by
tests, there's really no good argument for keeping it in trunk right
now.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On 14/11/12 03:55, Gavin Panella wrote:
> We need maas-import-pxe-files, -ephemerals and -isos, so we can't
> remove them. However, we don't *need* squashfs support, so we don't
> need maas-import-squashfs. Given that the feature does not work, and
> that it needs non-trivial investment to get it working and covered by
> tests, there's really no good argument for keeping it in trunk right
> now.

This is the key point for me. squashfs brings little relative
improvement for the amount of untested code that we're carrying to make
it happen. The risk of failure versus the return is quite bad.

We'll be very happy to work with the server team to make FPI well
engineered and tested.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'contrib/maas-http.conf'
--- contrib/maas-http.conf 2012-10-10 09:30:11 +0000
+++ contrib/maas-http.conf 2012-11-12 16:27:31 +0000
@@ -51,12 +51,6 @@
51 SetHandler None51 SetHandler None
52</Directory>52</Directory>
5353
54# Serve squashfs images
55Alias /MAAS/static/images/ /var/lib/maas/tftp/
56<Directory /var/lib/maas/tftp/>
57 SetHandler None
58</Directory>
59
60# Serve files from staticfiles.54# Serve files from staticfiles.
61Alias /MAAS/static/ /usr/share/maas/web/static/55Alias /MAAS/static/ /usr/share/maas/web/static/
62<Directory /usr/share/maas/web/static/>56<Directory /usr/share/maas/web/static/>
6357
=== modified file 'contrib/preseeds_v2/generic'
--- contrib/preseeds_v2/generic 2012-11-08 11:23:19 +0000
+++ contrib/preseeds_v2/generic 2012-11-12 16:27:31 +0000
@@ -1,14 +1,5 @@
1{{inherit "preseed_master"}}1{{inherit "preseed_master"}}
22
3{{def squashfs_image}}
4{{if node.distro_series in {'quantal'} and node.architecture in {'i386/generic', 'amd64/generic'} and use_squashfs is True }}
5d-i preseed/early_command string anna-install live-installer
6d-i live-installer/enable boolean true
7d-i live-installer/mode select normal
8d-i live-installer/net-image string http://{{server_host}}/MAAS/static/images/{{node.architecture}}/{{node.distro_series}}/filesystem/filesystem.squashfs
9{{endif}}
10{{enddef}}
11
12{{def proxy}}3{{def proxy}}
13d-i mirror/country string manual4d-i mirror/country string manual
14{{if node.architecture in {'i386/generic', 'amd64/generic'} }}5{{if node.architecture in {'i386/generic', 'amd64/generic'} }}
156
=== modified file 'contrib/preseeds_v2/preseed_master'
--- contrib/preseeds_v2/preseed_master 2012-10-02 19:08:05 +0000
+++ contrib/preseeds_v2/preseed_master 2012-11-12 16:27:31 +0000
@@ -3,9 +3,6 @@
3# * Cloud-init for bare-metal3# * Cloud-init for bare-metal
4# * Cloud-init preseed data4# * Cloud-init preseed data
55
6# Squashfs Installation
7{{self.squashfs_image}}
8
9# Locale6# Locale
10d-i debian-installer/locale string en_US.UTF-87d-i debian-installer/locale string en_US.UTF-8
118
129
=== modified file 'etc/maas/import_pxe_files'
--- etc/maas/import_pxe_files 2012-10-25 13:25:46 +0000
+++ etc/maas/import_pxe_files 2012-11-12 16:27:31 +0000
@@ -17,4 +17,3 @@
17#ARCHES="amd64/generic i386/generic armhf/highbank"17#ARCHES="amd64/generic i386/generic armhf/highbank"
18#LOCALE="en_US"18#LOCALE="en_US"
19#IMPORT_EPHEMERALS=119#IMPORT_EPHEMERALS=1
20#IMPORT_SQUASHFS=1
2120
=== removed file 'etc/maas/import_squashfs'
--- etc/maas/import_squashfs 2012-09-29 03:12:23 +0000
+++ etc/maas/import_squashfs 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1## get default settings from import_pxe_files
2[ ! -f /etc/maas/import_pxe_files ] || . /etc/maas/import_pxe_files
3
4#SQUASHFS_ARCHIVE="https://cdimage.ubuntu.com"
5#RELEASES="quantal"
6#ARCHES="amd64 i386"
70
=== modified file 'scripts/maas-import-pxe-files'
--- scripts/maas-import-pxe-files 2012-11-08 14:37:46 +0000
+++ scripts/maas-import-pxe-files 2012-11-12 16:27:31 +0000
@@ -42,14 +42,6 @@
42# directory. A wget command line will work here, but curl will do as well.42# directory. A wget command line will work here, but curl will do as well.
43DOWNLOAD=${DOWNLOAD:-wget --no-verbose}43DOWNLOAD=${DOWNLOAD:-wget --no-verbose}
4444
45# Whether to download squashfs images as well: "1" for yes, "0" for no.
46# Default is yes.
47IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
48
49# Whether to download squashfs images as well: "1" for yes, "0" for no.
50# Default is yes.
51IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
52
53# Whether to download ephemeral images as well: "1" for yes, "0" for no.45# Whether to download ephemeral images as well: "1" for yes, "0" for no.
54# Default is yes.46# Default is yes.
55IMPORT_EPHEMERALS=${IMPORT_EPHEMERALS:-1}47IMPORT_EPHEMERALS=${IMPORT_EPHEMERALS:-1}
@@ -198,24 +190,6 @@
198}190}
199191
200192
201# Download and install the squashfs root images.
202import_squashfs_images() {
203 if test "$IMPORT_SQUASHFS" != "0"
204 then
205 maas-import-squashfs
206 fi
207}
208
209
210# Download and install the squashfs root images.
211import_squashfs_images() {
212 if test "$IMPORT_SQUASHFS" != "0"
213 then
214 maas-import-squashfs
215 fi
216}
217
218
219# Download and install the ephemeral images.193# Download and install the ephemeral images.
220import_ephemeral_images() {194import_ephemeral_images() {
221 if test "$IMPORT_EPHEMERALS" != "0"195 if test "$IMPORT_EPHEMERALS" != "0"
@@ -232,7 +206,6 @@
232206
233 update_pre_boot_loader207 update_pre_boot_loader
234 import_install_images208 import_install_images
235 import_squashfs_images
236 import_ephemeral_images209 import_ephemeral_images
237}210}
238211
239212
=== removed file 'scripts/maas-import-squashfs'
--- scripts/maas-import-squashfs 2012-10-02 19:08:05 +0000
+++ scripts/maas-import-squashfs 1970-01-01 00:00:00 +0000
@@ -1,172 +0,0 @@
1#!/bin/bash
2#
3# maas-import-squashfs - sync and import squashfs images
4#
5# Copyright (C) 2012 Canonical
6#
7# Authors:
8# Andres Rodriguez <andres.rodriguez@canonical.com>
9#
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as
12# published by the Free Software Foundation, version 3 of the License.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU Affero General Public License for more details.
18#
19# You should have received a copy of the GNU Affero General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22# Exit immediately if a command exits with a non-zero status.
23set -o errexit
24# Treat unset variables as an error when substituting.
25set -o nounset
26
27# Load settings if available.
28settings="/etc/maas/import_squashfs"
29[ -r $settings ] && . $settings
30local_settings="$(pwd)/$settings"
31[ -r $local_settings ] && . $local_settings
32
33# Download locations for Ubuntu releases.
34#http://cdimage.ubuntu.com/ubuntu-server/daily/current/
35SQUASHFS_ARCHIVE=${ARCHIVE:-http://cdimage.ubuntu.com/}
36
37# Ubuntu releases that are to be downloaded.
38SUPPORTED_RELEASES=""
39for supported in $(distro-info --supported)
40do
41 if [ $(expr "$supported" \>= "quantal") -eq 1 ]; then
42 SUPPORTED_RELEASES="${SUPPORTED_RELEASES:-}${supported} "
43 fi
44done
45
46EFFECTIVE_RELEASES=""
47if [ -z "$RELEASES" ]; then
48 RELEASES=${RELEASES:-$SUPPORTED_RELEASES}
49else
50 for release in $RELEASES
51 do
52 [[ "$SUPPORTED_RELEASES" =~ "${release}" ]] && EFFECTIVE_RELEASES="${EFFECTIVE_RELEASES:-}${release} "
53 done
54 RELEASES="$EFFECTIVE_RELEASES"
55fi
56
57# The current Ubuntu release.
58STABLE_RELEASE=$(distro-info --stable)
59
60# Supported architectures.
61ARCHES=${ARCHES:-amd64/generic i386/generic}
62
63# Command line to download a resource at a given URL into the current
64# directory. A wget command line will work here, but curl will do as well.
65DOWNLOAD=${DOWNLOAD:-wget --no-verbose}
66
67# Whether to download squashfs images as well: "1" for yes, "0" for no.
68# Default is yes.
69IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
70
71# Put together a full URL for where the installer files for architecture $1
72# and release $2 can be downloaded.
73compose_installer_download_url() {
74 local arch=$1 release=$2
75
76 case $arch in
77 amd64/*|i386/*)
78 local installer_url="$SQUASHFS_ARCHIVE/ubuntu-server/daily/current"
79 echo $installer_url
80 ;;
81 *)
82 echo "Unknown architecture: $arch" >&2
83 exit 1
84 ;;
85 esac
86}
87
88# Return a list of files for architecture $1 and release $2 that need to be
89# downloaded
90compose_installer_download_files() {
91 local arch=$1 release=$2
92
93 case $arch in
94 amd64/*|i386/*)
95 echo "$release-server-${arch%%/*}.squashfs"
96 ;;
97 *)
98 echo "Unknown architecture: $arch" >&2
99 exit 1
100 ;;
101 esac
102}
103
104# Rename downloaded files for architecture $1 and release $2 into the form that
105# MAAS expects them
106rename_installer_download_files() {
107 local arch=$1 release=$2
108
109 case $arch in
110 amd64/*|i386/*)
111 mv $release-server-${arch%%/*}.squashfs filesystem.squashfs
112 ;;
113 *)
114 echo "Unknown architecture: $arch" >&2
115 exit 1
116 ;;
117 esac
118}
119
120# Download kernel/initrd for installing Ubuntu release $2 for
121# architecture $1 and install it into the TFTP directory hierarchy.
122update_install_files() {
123 local arch=$1 release=$2
124 local files=$(compose_installer_download_files $arch $release)
125 local url=$(compose_installer_download_url $arch $release)
126 local file
127
128 mkdir "install"
129 pushd "install" >/dev/null
130 for file in $files
131 do
132 $DOWNLOAD $url/$file
133 done
134 rename_installer_download_files $arch $release
135 popd >/dev/null
136
137 maas-provision install-pxe-image \
138 --arch="${arch%%/*}" --subarch="${arch#*/}" \
139 --release=$release --purpose="filesystem" \
140 --image="install"
141}
142
143
144# Download and install the "install" images.
145import_install_images() {
146 local arch release DOWNLOAD_DIR
147
148 DOWNLOAD_DIR=$(mktemp -d)
149 echo "Downloading to temporary location $DOWNLOAD_DIR."
150 pushd -- $DOWNLOAD_DIR
151
152 for arch in $ARCHES
153 do
154 for release in $RELEASES
155 do
156 update_install_files $arch $release
157 done
158 done
159
160 popd
161 rm -rf -- $DOWNLOAD_DIR
162}
163
164
165main() {
166 # All files we create here are public. The TFTP user will need to be
167 # able to read them.
168 umask a+r
169 import_install_images
170}
171
172main
1730
=== modified file 'setup.py'
--- setup.py 2012-11-08 06:34:48 +0000
+++ setup.py 2012-11-12 16:27:31 +0000
@@ -58,7 +58,6 @@
58 'etc/maas_cluster.conf',58 'etc/maas_cluster.conf',
59 'etc/txlongpoll.yaml',59 'etc/txlongpoll.yaml',
60 'contrib/maas_local_celeryconfig.py',60 'contrib/maas_local_celeryconfig.py',
61 'etc/maas/import_squashfs',
62 'contrib/maas_local_celeryconfig_cluster.py',61 'contrib/maas_local_celeryconfig_cluster.py',
63 'etc/maas/import_ephemerals',62 'etc/maas/import_ephemerals',
64 'etc/maas/import_pxe_files',63 'etc/maas/import_pxe_files',
@@ -77,8 +76,7 @@
77 'contrib/preseeds_v2/enlist_userdata',76 'contrib/preseeds_v2/enlist_userdata',
78 'contrib/preseeds_v2/preseed_master']),77 'contrib/preseeds_v2/preseed_master']),
79 ('/usr/sbin',78 ('/usr/sbin',
80 ['scripts/maas-import-squashfs',79 ['scripts/maas-import-ephemerals',
81 'scripts/maas-import-ephemerals',
82 'scripts/maas-import-pxe-files']),80 'scripts/maas-import-pxe-files']),
83 ],81 ],
8482
8583
=== modified file 'src/maasserver/preseed.py'
--- src/maasserver/preseed.py 2012-11-09 09:12:01 +0000
+++ src/maasserver/preseed.py 2012-11-12 16:27:31 +0000
@@ -29,10 +29,7 @@
29 NODE_STATUS,29 NODE_STATUS,
30 PRESEED_TYPE,30 PRESEED_TYPE,
31 )31 )
32from maasserver.models import (32from maasserver.models import Config
33 BootImage,
34 Config,
35 )
36from maasserver.server_address import get_maas_facing_server_host33from maasserver.server_address import get_maas_facing_server_host
37from maasserver.utils import absolute_reverse34from maasserver.utils import absolute_reverse
38import tempita35import tempita
@@ -246,20 +243,12 @@
246 'preseed_data': compose_preseed(node),243 'preseed_data': compose_preseed(node),
247 'node_disable_pxe_url': node_disable_pxe_url,244 'node_disable_pxe_url': node_disable_pxe_url,
248 'node_disable_pxe_data': node_disable_pxe_data,245 'node_disable_pxe_data': node_disable_pxe_data,
249 'use_squashfs': is_squashfs_image_present(node),
250 }246 }
251 context.update(node_context)247 context.update(node_context)
252248
253 return context249 return context
254250
255251
256def is_squashfs_image_present(node):
257 """Whether or not the SquashFS image can be used during installation."""
258 arch, subarch = node.architecture.split("/")
259 return BootImage.objects.have_image(
260 node.nodegroup, arch, subarch, node.get_distro_series(), "filesystem")
261
262
263def render_preseed(node, prefix, release=''):252def render_preseed(node, prefix, release=''):
264 """Find and load a `PreseedTemplate` for the given node.253 """Find and load a `PreseedTemplate` for the given node.
265254
266255
=== modified file 'src/maasserver/tests/test_preseed.py'
--- src/maasserver/tests/test_preseed.py 2012-11-09 09:45:28 +0000
+++ src/maasserver/tests/test_preseed.py 2012-11-12 16:27:31 +0000
@@ -37,7 +37,6 @@
37 get_preseed_context,37 get_preseed_context,
38 get_preseed_filenames,38 get_preseed_filenames,
39 get_preseed_template,39 get_preseed_template,
40 is_squashfs_image_present,
41 load_preseed_template,40 load_preseed_template,
42 PreseedTemplate,41 PreseedTemplate,
43 render_preseed,42 render_preseed,
@@ -328,9 +327,8 @@
328 ['node', 'release', 'metadata_enlist_url',327 ['node', 'release', 'metadata_enlist_url',
329 'server_host', 'server_url', 'preseed_data',328 'server_host', 'server_url', 'preseed_data',
330 'node_disable_pxe_url', 'node_disable_pxe_data',329 'node_disable_pxe_url', 'node_disable_pxe_data',
331 'use_squashfs', 'main_archive_hostname',330 'main_archive_hostname', 'main_archive_directory',
332 'main_archive_directory', 'ports_archive_hostname',331 'ports_archive_hostname', 'ports_archive_directory'],
333 'ports_archive_directory'],
334 context)332 context)
335333
336 def test_get_preseed_context_if_node_None(self):334 def test_get_preseed_context_if_node_None(self):
@@ -371,31 +369,6 @@
371 ))369 ))
372370
373371
374class TestSquashFSAvailable(TestCase):
375 """Tests for `is_squashfs_image_present`."""
376
377 # Scenario defaults.
378 arch = "i386"
379 subarch = "generic"
380 series = "quantal"
381 purpose = "filesystem"
382
383 scenarios = (
384 ("mismatch-arch", dict(arch="amd64", present=False)),
385 ("mismatch-subarch", dict(subarch="special", present=False)),
386 ("mismatch-series", dict(series="precise", present=False)),
387 ("mismatch-purpose", dict(purpose="moonraking", present=False)),
388 ("match", dict(present=True)),
389 )
390
391 def test_squashfs_available(self):
392 node = factory.make_node(
393 architecture="i386/generic", distro_series="quantal")
394 BootImage.objects.register_image(
395 node.nodegroup, self.arch, self.subarch, self.series, self.purpose)
396 self.assertEqual(self.present, is_squashfs_image_present(node))
397
398
399class TestPreseedTemplate(TestCase):372class TestPreseedTemplate(TestCase):
400 """Tests for class:`PreseedTemplate`."""373 """Tests for class:`PreseedTemplate`."""
401374
402375
=== modified file 'src/provisioningserver/tests/test_maas_import_pxe_files.py'
--- src/provisioningserver/tests/test_maas_import_pxe_files.py 2012-11-08 06:34:48 +0000
+++ src/provisioningserver/tests/test_maas_import_pxe_files.py 2012-11-12 16:27:31 +0000
@@ -161,9 +161,6 @@
161 # Suppress running of maas-import-ephemerals. It gets too161 # Suppress running of maas-import-ephemerals. It gets too
162 # intimate with the system to test here.162 # intimate with the system to test here.
163 'IMPORT_EPHEMERALS': '0',163 'IMPORT_EPHEMERALS': '0',
164 # Suppress running of maas-import-squashfs. It gets too
165 # intimate with the system to test here.
166 'IMPORT_SQUASHFS': '0',
167 }164 }
168 env.update(self.config_fixture.environ)165 env.update(self.config_fixture.environ)
169 if arch is not None:166 if arch is not None: