~lamont/maas/bug-1599223-2.0

« back to all changes in this revision

Viewing changes to src/provisioningserver/pserv_services/tests/test_tftp.py

  • Committer: MAAS Lander
  • Author(s): Newell Jensen
  • Date: 2016-06-30 21:59:41 UTC
  • mfrom: (5140.2.1 maas-2.0)
  • Revision ID: maas_lander-20160630215941-brx72e8pfi6cbg3t
[r=newell-jensen][bug=][author=newell-jensen] his branch fixes a regression for powerNV where the "b'ppc64el/" was getting hardcoded into the dhcpd.conf. Additionally, it updates how the tftp root path is handled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    UDPServer,
50
50
)
51
51
from provisioningserver.rpc.exceptions import BootConfigNoResponse
 
52
from provisioningserver.rpc.region import GetBootConfig
52
53
from provisioningserver.testing.boot_images import (
53
54
    make_boot_image_params,
54
55
    make_image,
504
505
        # ArchitectureRegistry is not stable, so we permit either here.
505
506
        self.assertIn(observed_params["arch"], ["armhf", "arm64"])
506
507
 
 
508
    def test_get_kernel_params_filters_out_unnecessary_arguments(self):
 
509
        params_okay = {
 
510
            name.decode("ascii"): factory.make_name("value")
 
511
            for name, _ in GetBootConfig.arguments
 
512
        }
 
513
        params_other = {
 
514
            factory.make_name("name"): factory.make_name("value")
 
515
            for _ in range(3)
 
516
        }
 
517
        params_all = params_okay.copy()
 
518
        params_all.update(params_other)
 
519
 
 
520
        client_service = Mock()
 
521
        client = client_service.getClient.return_value
 
522
        client.localIdent = params_okay["system_id"]
 
523
        backend = TFTPBackend(self.make_dir(), client_service)
 
524
        backend.fetcher = Mock()
 
525
 
 
526
        backend.get_kernel_params(params_all)
 
527
 
 
528
        self.assertThat(
 
529
            backend.fetcher, MockCalledOnceWith(
 
530
                client, GetBootConfig, **params_okay))
 
531
 
507
532
 
508
533
class TestTFTPService(MAASTestCase):
509
534