~evilnick/maas/1.2-docs-tidyup+preseed

« back to all changes in this revision

Viewing changes to src/provisioningserver/tests/test_kernel_opts.py

[r=julian-edwards][bug=][author=jameinel] Expose the new kernel options to the pxeconfig api.

Add the extra options to KernelParameters, and return them when the tftp server places its request.
Tweak the tftp server so that it adds the new parameters to the commandline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
                "overlayroot=tmpfs",
134
134
                "ip=::::%s:BOOTIF" % params.hostname]))
135
135
 
 
136
    def test_commissioning_compose_kernel_command_line_inc_extra_opts(self):
 
137
        extra_opts = "special console=ABCD -- options to pass"
 
138
        params = make_kernel_parameters(extra_opts=extra_opts)
 
139
        cmdline = compose_kernel_command_line(params)
 
140
        # There should be a blank space before the options, but otherwise added
 
141
        # verbatim.
 
142
        self.assertThat(cmdline, Contains(' ' + extra_opts))
 
143
 
 
144
    def test_commissioning_compose_kernel_command_line_handles_extra_opts_None(self):
 
145
        params = make_kernel_parameters(extra_opts=None)
 
146
        cmdline = compose_kernel_command_line(params)
 
147
        self.assertNotIn(cmdline, "None")
 
148
 
136
149
    def test_compose_kernel_command_line_inc_common_opts(self):
137
150
        # Test that some kernel arguments appear on both commissioning
138
151
        # and install command lines.