示例#1
0
 def test_unify_existing_internal_namespaces(self, discover_external_namespaces, listdir, unlink):
     discover_external_namespaces.return_value = [('pid', 'net:[12345]')]
     listdir.return_value = ['net:[12345]']
     unify_internal_namespaces()
     unlink.assert_not_called()
示例#2
0
 def test_unify_existing_internal_namespaces_created_from_ip_netns(self, discover_external_namespaces, listdir, unlink):
     discover_external_namespaces.return_value = []
     listdir.return_value = ['namespace']
     unify_internal_namespaces()
     unlink.assert_not_called()
示例#3
0
 def test_unify_non_existing_internal_namespaces(self, discover_external_namespaces, listdir, unlink):
     discover_external_namespaces.return_value = []
     listdir.return_value = ['net:[12345]']
     unify_internal_namespaces()
     unlink.assert_called_once_with('/var/run/netns/net:[12345]')