summaryrefslogtreecommitdiff
path: root/packages/python-google-compute-engine/google_compute_engine/distro_lib/debian_8/tests/utils_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/python-google-compute-engine/google_compute_engine/distro_lib/debian_8/tests/utils_test.py')
-rw-r--r--packages/python-google-compute-engine/google_compute_engine/distro_lib/debian_8/tests/utils_test.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/packages/python-google-compute-engine/google_compute_engine/distro_lib/debian_8/tests/utils_test.py b/packages/python-google-compute-engine/google_compute_engine/distro_lib/debian_8/tests/utils_test.py
index f714ba8..7f92795 100644
--- a/packages/python-google-compute-engine/google_compute_engine/distro_lib/debian_8/tests/utils_test.py
+++ b/packages/python-google-compute-engine/google_compute_engine/distro_lib/debian_8/tests/utils_test.py
@@ -27,12 +27,28 @@ class UtilsTest(unittest.TestCase):
self.mock_setup = mock.create_autospec(utils.Utils)
@mock.patch('google_compute_engine.distro_lib.helpers.CallDhclientIpv6')
- def testEnableIpv6(self, mock_call):
+ @mock.patch('google_compute_engine.distro_lib.helpers.CallEnableRouteAdvertisements')
+ def testEnableIpv6(self, mock_call_enable_ra, mock_call_dhclient):
mocks = mock.Mock()
- mocks.attach_mock(mock_call, 'call')
+ mocks.attach_mock(mock_call_dhclient, 'dhclient')
+ mocks.attach_mock(mock_call_enable_ra, 'enable_ra')
utils.Utils.EnableIpv6(self.mock_setup, ['A', 'B'], self.mock_logger)
- expected_calls = [mock.call.call(['A', 'B'], mock.ANY)]
+ expected_calls = [
+ mock.call.enable_ra(['A', 'B'], mock.ANY),
+ mock.call.dhclient(['A', 'B'], mock.ANY),
+ ]
+ self.assertEqual(mocks.mock_calls, expected_calls)
+
+ @mock.patch('google_compute_engine.distro_lib.helpers.CallDhclientIpv6')
+ def testDisableIpv6(self, mock_call_dhclient):
+ mocks = mock.Mock()
+ mocks.attach_mock(mock_call_dhclient, 'dhclient')
+
+ utils.Utils.DisableIpv6(self.mock_setup, ['A', 'B'], self.mock_logger)
+ expected_calls = [
+ mock.call.dhclient(['A', 'B'], mock.ANY, None, release_lease=True),
+ ]
self.assertEqual(mocks.mock_calls, expected_calls)
@mock.patch('google_compute_engine.distro_lib.helpers.CallDhclient')