From c6568b78e46be5eadeec71714e516ca2e9161326 Mon Sep 17 00:00:00 2001 From: Brian Lamar Date: Tue, 4 Sep 2012 13:33:12 -0400 Subject: [PATCH] Skip tests in OSX due to readlink compat Although greadlink can be installed on OSX, there is not compatibility in the code so the tests should be skipped until OpenStack supports running this code on OSX/BSD. Fixes bug 1037835 Change-Id: Iddaba950f9f8b3823bd62b59b36e08aff4a979f8 --- nova/tests/test_virt.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nova/tests/test_virt.py b/nova/tests/test_virt.py index 8646b86b1cbb..166e87d8b478 100644 --- a/nova/tests/test_virt.py +++ b/nova/tests/test_virt.py @@ -16,6 +16,7 @@ # under the License. import os +import platform from nova import exception from nova import flags @@ -165,22 +166,26 @@ class TestVirtDiskPaths(test.TestCase): self.stubs.Set(utils, 'execute', nonroot_execute) + @test.skip_unless(platform.mac_ver()[0] == '', "Unable to test on OSX") def test_check_safe_path(self): ret = disk_api._join_and_check_path_within_fs('/foo', 'etc', 'something.conf') self.assertEquals(ret, '/foo/etc/something.conf') + @test.skip_unless(platform.mac_ver()[0] == '', "Unable to test on OSX") def test_check_unsafe_path(self): self.assertRaises(exception.Invalid, disk_api._join_and_check_path_within_fs, '/foo', 'etc/../../../something.conf') + @test.skip_unless(platform.mac_ver()[0] == '', "Unable to test on OSX") def test_inject_files_with_bad_path(self): self.assertRaises(exception.Invalid, disk_api._inject_file_into_fs, '/tmp', '/etc/../../../../etc/passwd', 'hax') + @test.skip_unless(platform.mac_ver()[0] == '', "Unable to test on OSX") def test_inject_metadata(self): with utils.tempdir() as tmpdir: meta_objs = [{"key": "foo", "value": "bar"}]