diff options
author | Shahwat Dalal <sdalal29@bloomberg.net> | 2019-07-30 14:37:18 +0100 |
---|---|---|
committer | Shahwat Dalal <sdalal29@bloomberg.net> | 2019-09-05 11:12:25 +0100 |
commit | a0a8015177306efda0823175945ce54342e03e45 (patch) | |
tree | a1e463c52ab3ee11dc0164d2e3c79bcdaf264fcb /tests | |
parent | 07e35b3c688b4b105285550fa5a2bf216952df10 (diff) | |
download | buildstream-a0a8015177306efda0823175945ce54342e03e45.tar.gz |
tests/tar: Add test for unreadable and unwritable content tar source
This test was added to consider the edge case when a unreadable file is being
added to CAS.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sources/tar.py | 8 | ||||
-rw-r--r-- | tests/sources/tar/read-only/content/c.tar.gz | bin | 0 -> 128 bytes |
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/sources/tar.py b/tests/sources/tar.py index 9a5559d47..fac6f3f8b 100644 --- a/tests/sources/tar.py +++ b/tests/sources/tar.py @@ -279,9 +279,10 @@ def test_stage_default_basedir_lzip(cli, tmpdir, datafiles, srcdir): # Test that tarballs with read-only files work # a - contains read-only files in a writable directory # b - root directory has read-only permission +# c - contains one file that has no read nor write permissions. Base-dir set to '' to extract root of tarball @pytest.mark.datafiles(os.path.join(DATA_DIR, 'read-only')) -@pytest.mark.parametrize("tar_name", ["a", "b"]) -def test_read_only_dir(cli, tmpdir, datafiles, tar_name): +@pytest.mark.parametrize("tar_name, base_dir", [("a", "*"), ("b", '*'), ("c", '')]) +def test_read_only_dir(cli, tmpdir, datafiles, tar_name, base_dir): try: project = str(datafiles) generate_project(project, tmpdir) @@ -295,7 +296,8 @@ def test_read_only_dir(cli, tmpdir, datafiles, tar_name): { 'kind': 'tar', 'url': 'tmpdir:/{}'.format(tar_file), - 'ref': 'foo' + 'ref': 'foo', + 'base-dir': base_dir } ] }, bst_path) diff --git a/tests/sources/tar/read-only/content/c.tar.gz b/tests/sources/tar/read-only/content/c.tar.gz Binary files differnew file mode 100644 index 000000000..016a5a218 --- /dev/null +++ b/tests/sources/tar/read-only/content/c.tar.gz |