From: Jenkins Date: Thu, 2 Apr 2015 11:39:27 +0000 (+0000) Subject: Merge "Allow metadata proxy to log with nobody user/group" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3f45031d685a60abc3df293430db1ca458bc5620;p=openstack-build%2Fneutron-build.git Merge "Allow metadata proxy to log with nobody user/group" --- 3f45031d685a60abc3df293430db1ca458bc5620 diff --cc neutron/tests/unit/agent/linux/test_utils.py index 25e2c0c8f,ff0678ee9..709a65e0f --- a/neutron/tests/unit/agent/linux/test_utils.py +++ b/neutron/tests/unit/agent/linux/test_utils.py @@@ -198,19 -198,29 +198,30 @@@ class TestPathUtilities(base.BaseTestCa self.assertEqual(['ping', '8.8.8.8'], utils.remove_abs_path(['/usr/bin/ping', '8.8.8.8'])) - def test_cmdlines_are_equal(self): - self.assertTrue(utils.cmdlines_are_equal( - ['ping', '8.8.8.8'], - ['/usr/bin/ping', '8.8.8.8'])) - - def test_cmdlines_are_equal_different_commands(self): - self.assertFalse(utils.cmdlines_are_equal( - ['ping', '8.8.8.8'], - ['/usr/bin/ping6', '8.8.8.8'])) + def test_cmd_matches_expected_matches_abs_path(self): + cmd = ['/bar/../foo'] + self.assertTrue(utils.cmd_matches_expected(cmd, cmd)) + + def test_cmd_matches_expected_matches_script(self): + self.assertTrue(utils.cmd_matches_expected(['python', 'script'], + ['script'])) + + def test_cmd_matches_expected_doesnt_match(self): + self.assertFalse(utils.cmd_matches_expected('foo', 'bar')) + class FakeUser(object): + def __init__(self, name): + self.pw_name = name + + class TestBaseOSUtils(base.BaseTestCase): + + EUID = 123 + EUNAME = 'user' + EGID = 456 + EGNAME = 'group' + @mock.patch.object(os.path, 'isdir', return_value=False) @mock.patch.object(os, 'makedirs') def test_ensure_dir_not_exist(self, makedirs, isdir):