~bbaqar/charms/trusty/plumgrid-director/config-changed-fix

« back to all changes in this revision

Viewing changes to unit_tests/test_pg_dir_hooks.py

  • Committer: bbaqar at plumgrid
  • Date: 2015-08-16 19:04:53 UTC
  • Revision ID: bbaqar@plumgrid.com-20150816190453-zzosp2sb9fh770py
Adding PLUMgrid License Posting from charm

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    'ensure_mtu',
29
29
    'add_lcm_key',
30
30
    'determine_packages',
 
31
    'post_pg_license'
31
32
]
32
33
NEUTRON_CONF_DIR = "/etc/neutron"
33
34
 
55
56
        ])
56
57
        self.load_iovisor.assert_called_with()
57
58
        self.ensure_mtu.assert_called_with()
 
59
        self.post_pg_license.assert_called_with()
58
60
        self.add_lcm_key.assert_called_with()
59
61
 
60
62
    def test_config_changed_hook(self):
61
63
        _pkgs = ['plumgrid-lxc', 'iovisor-dkms']
 
64
        self.add_lcm_key.return_value = 0
 
65
        self.post_pg_license.return_value = 0
62
66
        self.determine_packages.return_value = [_pkgs]
63
67
        self._call_hook('config-changed')
64
68
        self.stop_pg.assert_called_with()
69
73
        ])
70
74
        self.load_iovisor.assert_called_with()
71
75
        self.ensure_mtu.assert_called_with()
72
 
        self.add_lcm_key.assert_called_with()
 
76
 
73
77
        self.CONFIGS.write_all.assert_called_with()
74
78
        self.restart_pg.assert_called_with()
75
79
 
76
 
 
77
80
    def test_stop(self):
78
81
        _pkgs = ['plumgrid-lxc', 'iovisor-dkms']
79
82
        self._call_hook('stop')