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()
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()
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]')