diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2016-09-29 18:28:22 +0100 |
---|---|---|
committer | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2016-10-06 12:05:56 +0100 |
commit | f66ce361bbdc6523e729806bd304db0a558e5928 (patch) | |
tree | 61122c6fd25fa9344e72389ecd90d276951e1038 /tests/test_all.py | |
parent | 50ea68400d3795ff0b970074509dac90b622ade7 (diff) | |
download | sandboxlib-f66ce361bbdc6523e729806bd304db0a558e5928.tar.gz |
Fix unit tests
- Fix missing source argument in the 'mount' command.
- Add missing datapath assigment to ensure that file is created in
the expected location.
- Remove unnecessary extra_mounts that were causing the test files
in /data to not be accessible inside the sandbox as that directory
was being overlapped with a mount bind.
Also, mention that the C library static libraries are required to be
installed for running the tests.
Diffstat (limited to 'tests/test_all.py')
-rw-r--r-- | tests/test_all.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/test_all.py b/tests/test_all.py index eed2f79..9270607 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015 Codethink Limited +# Copyright (C) 2015-2016 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -114,7 +114,7 @@ class TestWriteablePaths(object): bin_path.join('test-file-is-writable').chmod(0o755) data_path = sandbox_path.mkdir('data') - data_path.mkdir('1') + data_path = data_path.mkdir('1') data_path.join('canary').write("Please don't overwrite me.") return sandbox_path @@ -169,10 +169,7 @@ class TestWriteablePaths(object): exit, out, err = sandboxlib_executor.run_sandbox( ['test-file-is-writable', '/data/1/canary'], filesystem_root=str(writable_paths_test_sandbox), - filesystem_writable_paths='none', - extra_mounts=[ - (None, '/data', 'tmpfs') - ]) + filesystem_writable_paths='none') assert err.decode('unicode-escape') == '' assert out.decode('unicode-escape') == \ @@ -187,10 +184,7 @@ class TestWriteablePaths(object): exit, out, err = sandboxlib_executor.run_sandbox( ['test-file-is-writable', '/data/1/canary'], filesystem_root=str(writable_paths_test_sandbox), - filesystem_writable_paths=['/data'], - extra_mounts=[ - (None, '/data', 'tmpfs') - ]) + filesystem_writable_paths=['/data']) assert err.decode('unicode-escape') == '' assert out.decode('unicode-escape') == \ |