summaryrefslogtreecommitdiff
path: root/tests/sources
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2019-11-23 00:51:56 +0900
committerJavier Jardón <jjardon@gnome.org>2020-01-17 04:20:09 +0000
commit45507ccc97bed1fce5749ae0c01c098a8ecd265c (patch)
tree6651e729b48280c498de1bf370b12f2907f08a6c /tests/sources
parenta5b2396539e1621eef75a035b12c1c4266b5c9fe (diff)
downloadbuildstream-45507ccc97bed1fce5749ae0c01c098a8ecd265c.tar.gz
Remove "deb" surce plugin, it has beem moved to bst-plugins-experimentaljjardon/move_deb_source
Diffstat (limited to 'tests/sources')
-rw-r--r--tests/sources/deb.py166
-rw-r--r--tests/sources/deb/a_deb.debbin7624 -> 0 bytes
-rw-r--r--tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/README0
-rw-r--r--tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/changelog.Debian.gzbin37 -> 0 bytes
-rw-r--r--tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/copyright0
-rw-r--r--tests/sources/deb/explicit-basedir/content/share/lua/5.1/clod.lua0
l---------tests/sources/deb/explicit-basedir/content/share/lua/5.2/clod.lua1
-rw-r--r--tests/sources/deb/explicit-basedir/target.bst7
-rw-r--r--tests/sources/deb/fetch/content/usr/share/doc/lua-clod/README0
-rw-r--r--tests/sources/deb/fetch/content/usr/share/doc/lua-clod/changelog.Debian.gzbin37 -> 0 bytes
-rw-r--r--tests/sources/deb/fetch/content/usr/share/doc/lua-clod/copyright0
-rw-r--r--tests/sources/deb/fetch/content/usr/share/lua/5.1/clod.lua0
l---------tests/sources/deb/fetch/content/usr/share/lua/5.2/clod.lua1
-rw-r--r--tests/sources/deb/fetch/target-lz.bst6
-rw-r--r--tests/sources/deb/fetch/target.bst6
-rw-r--r--tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/README0
-rw-r--r--tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/changelog.Debian.gzbin37 -> 0 bytes
-rw-r--r--tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/copyright0
-rw-r--r--tests/sources/deb/no-basedir/content/usr/share/lua/5.1/clod.lua0
l---------tests/sources/deb/no-basedir/content/usr/share/lua/5.2/clod.lua1
-rw-r--r--tests/sources/deb/no-basedir/target.bst7
-rw-r--r--tests/sources/deb/no-ref/a/b/d1
-rw-r--r--tests/sources/deb/no-ref/a/c1
-rw-r--r--tests/sources/deb/no-ref/target.bst5
24 files changed, 0 insertions, 202 deletions
diff --git a/tests/sources/deb.py b/tests/sources/deb.py
deleted file mode 100644
index 96060a1a4..000000000
--- a/tests/sources/deb.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Pylint doesn't play well with fixtures and dependency injection from pytest
-# pylint: disable=redefined-outer-name
-
-import os
-import shutil
-
-import pytest
-
-from buildstream._exceptions import ErrorDomain
-from buildstream import _yaml
-from buildstream.testing import cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_ARPY
-from . import list_dir_contents
-
-DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "deb",)
-
-deb_name = "a_deb.deb"
-
-
-def generate_project(project_dir, tmpdir):
- project_file = os.path.join(project_dir, "project.conf")
- _yaml.roundtrip_dump({"name": "foo", "aliases": {"tmpdir": "file:///" + str(tmpdir)}}, project_file)
-
-
-def _copy_deb(start_location, tmpdir):
- source = os.path.join(start_location, deb_name)
- destination = os.path.join(str(tmpdir), deb_name)
- shutil.copyfile(source, destination)
-
-
-# Test that without ref, consistency is set appropriately.
-@pytest.mark.skipif(HAVE_ARPY is False, reason="arpy is not available")
-@pytest.mark.datafiles(os.path.join(DATA_DIR, "no-ref"))
-def test_no_ref(cli, tmpdir, datafiles):
- project = str(datafiles)
- generate_project(project, tmpdir)
- assert cli.get_element_state(project, "target.bst") == "no reference"
-
-
-# Test that when I fetch a nonexistent URL, errors are handled gracefully and a retry is performed.
-@pytest.mark.skipif(HAVE_ARPY is False, reason="arpy is not available")
-@pytest.mark.datafiles(os.path.join(DATA_DIR, "fetch"))
-def test_fetch_bad_url(cli, tmpdir, datafiles):
- project = str(datafiles)
- generate_project(project, tmpdir)
-
- # Try to fetch it
- result = cli.run(project=project, args=["source", "fetch", "target.bst"])
- assert "FAILURE Try #" in result.stderr
- result.assert_main_error(ErrorDomain.STREAM, None)
- result.assert_task_error(ErrorDomain.SOURCE, None)
-
-
-@pytest.mark.skipif(HAVE_ARPY is False, reason="arpy is not available")
-@pytest.mark.datafiles(os.path.join(DATA_DIR, "fetch"))
-def test_fetch_bad_ref(cli, tmpdir, datafiles):
- project = str(datafiles)
- generate_project(project, tmpdir)
-
- # Copy test deb to tmpdir
- _copy_deb(DATA_DIR, tmpdir)
-
- # Try to fetch it
- result = cli.run(project=project, args=["source", "fetch", "target.bst"])
- result.assert_main_error(ErrorDomain.STREAM, None)
- result.assert_task_error(ErrorDomain.SOURCE, None)
-
-
-# Test that when tracking with a ref set, there is a warning
-@pytest.mark.skipif(HAVE_ARPY is False, reason="arpy is not available")
-@pytest.mark.datafiles(os.path.join(DATA_DIR, "fetch"))
-def test_track_warning(cli, tmpdir, datafiles):
- project = str(datafiles)
- generate_project(project, tmpdir)
-
- # Copy test deb to tmpdir
- _copy_deb(DATA_DIR, tmpdir)
-
- # Track it
- result = cli.run(project=project, args=["source", "track", "target.bst"])
- result.assert_success()
- assert "Potential man-in-the-middle attack!" in result.stderr
-
-
-# Test that a staged checkout matches what was tarred up, with the default first subdir
-@pytest.mark.skipif(HAVE_ARPY is False, reason="arpy is not available")
-@pytest.mark.datafiles(os.path.join(DATA_DIR, "fetch"))
-def test_stage_default_basedir(cli, tmpdir, datafiles):
- project = str(datafiles)
- generate_project(project, tmpdir)
- checkoutdir = os.path.join(str(tmpdir), "checkout")
-
- # Copy test deb to tmpdir
- _copy_deb(DATA_DIR, tmpdir)
-
- # Track, fetch, build, checkout
- result = cli.run(project=project, args=["source", "track", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["source", "fetch", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["build", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkoutdir])
- result.assert_success()
-
- # Check that the content of the first directory is checked out (base-dir: '')
- original_dir = os.path.join(str(datafiles), "content")
- original_contents = list_dir_contents(original_dir)
- checkout_contents = list_dir_contents(checkoutdir)
- assert checkout_contents == original_contents
-
-
-# Test that a staged checkout matches what was tarred up, with an empty base-dir
-@pytest.mark.skipif(HAVE_ARPY is False, reason="arpy is not available")
-@pytest.mark.datafiles(os.path.join(DATA_DIR, "no-basedir"))
-def test_stage_no_basedir(cli, tmpdir, datafiles):
- project = str(datafiles)
- generate_project(project, tmpdir)
- checkoutdir = os.path.join(str(tmpdir), "checkout")
-
- # Copy test deb to tmpdir
- _copy_deb(DATA_DIR, tmpdir)
-
- # Track, fetch, build, checkout
- result = cli.run(project=project, args=["source", "track", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["source", "fetch", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["build", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkoutdir])
- result.assert_success()
-
- # Check that the full content of the tarball is checked out (base-dir: '')
- original_dir = os.path.join(str(datafiles), "content")
- original_contents = list_dir_contents(original_dir)
- checkout_contents = list_dir_contents(checkoutdir)
- assert checkout_contents == original_contents
-
-
-# Test that a staged checkout matches what was tarred up, with an explicit basedir
-@pytest.mark.skipif(HAVE_ARPY is False, reason="arpy is not available")
-@pytest.mark.datafiles(os.path.join(DATA_DIR, "explicit-basedir"))
-def test_stage_explicit_basedir(cli, tmpdir, datafiles):
- project = str(datafiles)
- generate_project(project, tmpdir)
- checkoutdir = os.path.join(str(tmpdir), "checkout")
-
- # Copy test deb to tmpdir
- _copy_deb(DATA_DIR, tmpdir)
-
- # Track, fetch, build, checkout
- result = cli.run(project=project, args=["source", "track", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["source", "fetch", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["build", "target.bst"])
- result.assert_success()
- result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkoutdir])
- result.assert_success()
-
- # Check that the content of the first directory is checked out (base-dir: '')
- original_dir = os.path.join(str(datafiles), "content")
- original_contents = list_dir_contents(original_dir)
- checkout_contents = list_dir_contents(checkoutdir)
- assert checkout_contents == original_contents
diff --git a/tests/sources/deb/a_deb.deb b/tests/sources/deb/a_deb.deb
deleted file mode 100644
index c8fef9117..000000000
--- a/tests/sources/deb/a_deb.deb
+++ /dev/null
Binary files differ
diff --git a/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/README b/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/README
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/README
+++ /dev/null
diff --git a/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/changelog.Debian.gz b/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/changelog.Debian.gz
deleted file mode 100644
index a9090a51c..000000000
--- a/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/changelog.Debian.gz
+++ /dev/null
Binary files differ
diff --git a/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/copyright b/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/copyright
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/explicit-basedir/content/share/doc/lua-clod/copyright
+++ /dev/null
diff --git a/tests/sources/deb/explicit-basedir/content/share/lua/5.1/clod.lua b/tests/sources/deb/explicit-basedir/content/share/lua/5.1/clod.lua
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/explicit-basedir/content/share/lua/5.1/clod.lua
+++ /dev/null
diff --git a/tests/sources/deb/explicit-basedir/content/share/lua/5.2/clod.lua b/tests/sources/deb/explicit-basedir/content/share/lua/5.2/clod.lua
deleted file mode 120000
index 79531e49d..000000000
--- a/tests/sources/deb/explicit-basedir/content/share/lua/5.2/clod.lua
+++ /dev/null
@@ -1 +0,0 @@
-../5.1/clod.lua \ No newline at end of file
diff --git a/tests/sources/deb/explicit-basedir/target.bst b/tests/sources/deb/explicit-basedir/target.bst
deleted file mode 100644
index a75881151..000000000
--- a/tests/sources/deb/explicit-basedir/target.bst
+++ /dev/null
@@ -1,7 +0,0 @@
-kind: import
-description: The kind of this element is irrelevant.
-sources:
-- kind: deb
- url: tmpdir:/a_deb.deb
- ref: foo
- base-dir: 'usr'
diff --git a/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/README b/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/README
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/README
+++ /dev/null
diff --git a/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/changelog.Debian.gz b/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/changelog.Debian.gz
deleted file mode 100644
index 040dd15a7..000000000
--- a/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/changelog.Debian.gz
+++ /dev/null
Binary files differ
diff --git a/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/copyright b/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/copyright
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/fetch/content/usr/share/doc/lua-clod/copyright
+++ /dev/null
diff --git a/tests/sources/deb/fetch/content/usr/share/lua/5.1/clod.lua b/tests/sources/deb/fetch/content/usr/share/lua/5.1/clod.lua
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/fetch/content/usr/share/lua/5.1/clod.lua
+++ /dev/null
diff --git a/tests/sources/deb/fetch/content/usr/share/lua/5.2/clod.lua b/tests/sources/deb/fetch/content/usr/share/lua/5.2/clod.lua
deleted file mode 120000
index 79531e49d..000000000
--- a/tests/sources/deb/fetch/content/usr/share/lua/5.2/clod.lua
+++ /dev/null
@@ -1 +0,0 @@
-../5.1/clod.lua \ No newline at end of file
diff --git a/tests/sources/deb/fetch/target-lz.bst b/tests/sources/deb/fetch/target-lz.bst
deleted file mode 100644
index b0569129e..000000000
--- a/tests/sources/deb/fetch/target-lz.bst
+++ /dev/null
@@ -1,6 +0,0 @@
-kind: import
-description: The kind of this element is irrelevant.
-sources:
-- kind: tar
- url: tmpdir:/a.tar.lz
- ref: foo
diff --git a/tests/sources/deb/fetch/target.bst b/tests/sources/deb/fetch/target.bst
deleted file mode 100644
index 919e66a37..000000000
--- a/tests/sources/deb/fetch/target.bst
+++ /dev/null
@@ -1,6 +0,0 @@
-kind: import
-description: The kind of this element is irrelevant.
-sources:
-- kind: deb
- url: tmpdir:/a_deb.deb
- ref: foo
diff --git a/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/README b/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/README
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/README
+++ /dev/null
diff --git a/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/changelog.Debian.gz b/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/changelog.Debian.gz
deleted file mode 100644
index be777e65f..000000000
--- a/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/changelog.Debian.gz
+++ /dev/null
Binary files differ
diff --git a/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/copyright b/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/copyright
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/no-basedir/content/usr/share/doc/lua-clod/copyright
+++ /dev/null
diff --git a/tests/sources/deb/no-basedir/content/usr/share/lua/5.1/clod.lua b/tests/sources/deb/no-basedir/content/usr/share/lua/5.1/clod.lua
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/sources/deb/no-basedir/content/usr/share/lua/5.1/clod.lua
+++ /dev/null
diff --git a/tests/sources/deb/no-basedir/content/usr/share/lua/5.2/clod.lua b/tests/sources/deb/no-basedir/content/usr/share/lua/5.2/clod.lua
deleted file mode 120000
index 79531e49d..000000000
--- a/tests/sources/deb/no-basedir/content/usr/share/lua/5.2/clod.lua
+++ /dev/null
@@ -1 +0,0 @@
-../5.1/clod.lua \ No newline at end of file
diff --git a/tests/sources/deb/no-basedir/target.bst b/tests/sources/deb/no-basedir/target.bst
deleted file mode 100644
index 69fcd700c..000000000
--- a/tests/sources/deb/no-basedir/target.bst
+++ /dev/null
@@ -1,7 +0,0 @@
-kind: import
-description: The kind of this element is irrelevant.
-sources:
-- kind: deb
- url: tmpdir:/a_deb.deb
- ref: foo
- base-dir: ''
diff --git a/tests/sources/deb/no-ref/a/b/d b/tests/sources/deb/no-ref/a/b/d
deleted file mode 100644
index 4bcfe98e6..000000000
--- a/tests/sources/deb/no-ref/a/b/d
+++ /dev/null
@@ -1 +0,0 @@
-d
diff --git a/tests/sources/deb/no-ref/a/c b/tests/sources/deb/no-ref/a/c
deleted file mode 100644
index f2ad6c76f..000000000
--- a/tests/sources/deb/no-ref/a/c
+++ /dev/null
@@ -1 +0,0 @@
-c
diff --git a/tests/sources/deb/no-ref/target.bst b/tests/sources/deb/no-ref/target.bst
deleted file mode 100644
index 89b639662..000000000
--- a/tests/sources/deb/no-ref/target.bst
+++ /dev/null
@@ -1,5 +0,0 @@
-kind: import
-description: The kind of this element is irrelevant.
-sources:
-- kind: deb
- url: tmpdir:/a_deb.deb