summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cachekey/cachekey.py3
-rw-r--r--tests/cachekey/project/sources/ostree1.bst6
-rw-r--r--tests/cachekey/project/target.bst1
-rw-r--r--tests/cachekey/project/target.expected2
-rwxr-xr-xtests/conftest.py2
-rw-r--r--tests/sources/ostree.py60
-rw-r--r--tests/testutils/repo/ostree.py48
-rw-r--r--tests/testutils/site.py2
8 files changed, 3 insertions, 121 deletions
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index 671bbb3a1..2e8c29805 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -47,7 +47,7 @@ import pytest
from buildstream.testing.runcli import cli # pylint: disable=unused-import
from buildstream.plugin import CoreWarnings
from buildstream import _yaml
-from tests.testutils.site import HAVE_BZR, HAVE_GIT, HAVE_OSTREE, IS_LINUX, MACHINE_ARCH
+from tests.testutils.site import HAVE_BZR, HAVE_GIT, IS_LINUX, MACHINE_ARCH
##############################################
@@ -155,7 +155,6 @@ DATA_DIR = os.path.join(
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(HAVE_BZR is False, reason="bzr is not available")
@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
-@pytest.mark.skipif(HAVE_OSTREE is False, reason="ostree is not available")
@pytest.mark.datafiles(DATA_DIR)
def test_cache_key(datafiles, cli):
project = str(datafiles)
diff --git a/tests/cachekey/project/sources/ostree1.bst b/tests/cachekey/project/sources/ostree1.bst
deleted file mode 100644
index 766fdecb0..000000000
--- a/tests/cachekey/project/sources/ostree1.bst
+++ /dev/null
@@ -1,6 +0,0 @@
-kind: import
-sources:
-- kind: ostree
- url: https://example.com/repo
- ref: ccc885b96749f9d1774c7fa0c3262a9a3694e2d2643d1f8d420f5d23adf5db48
- track: testing/x86_64
diff --git a/tests/cachekey/project/target.bst b/tests/cachekey/project/target.bst
index 8c5c12723..cabf3f7bf 100644
--- a/tests/cachekey/project/target.bst
+++ b/tests/cachekey/project/target.bst
@@ -10,7 +10,6 @@ depends:
- sources/git3.bst
- sources/local1.bst
- sources/local2.bst
-- sources/ostree1.bst
- sources/patch1.bst
- sources/patch2.bst
- sources/patch3.bst
diff --git a/tests/cachekey/project/target.expected b/tests/cachekey/project/target.expected
index c6214eb23..a56b64970 100644
--- a/tests/cachekey/project/target.expected
+++ b/tests/cachekey/project/target.expected
@@ -1 +1 @@
-faf895b1292cdcba9724c337c70442aedc350bf053b9df937da2515a8cb69e5a \ No newline at end of file
+6099e17150d3ab573569bfcdcdf19358ddbe0f2b597de5931a545559dd4ebc34
diff --git a/tests/conftest.py b/tests/conftest.py
index 31b86e301..138ae0745 100755
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -29,7 +29,6 @@ from buildstream.testing.integration import integration_cache # pylint: disable
from tests.testutils.repo.git import Git
from tests.testutils.repo.bzr import Bzr
-from tests.testutils.repo.ostree import OSTree
from tests.testutils.repo.tar import Tar
from tests.testutils.repo.zip import Zip
@@ -124,7 +123,6 @@ def ensure_platform_cache_is_clean():
#################################################
register_repo_kind('git', Git)
register_repo_kind('bzr', Bzr)
-register_repo_kind('ostree', OSTree)
register_repo_kind('tar', Tar)
register_repo_kind('zip', Zip)
diff --git a/tests/sources/ostree.py b/tests/sources/ostree.py
deleted file mode 100644
index aefad68fa..000000000
--- a/tests/sources/ostree.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2018 Bloomberg Finance LP
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library. If not, see <http://www.gnu.org/licenses/>.
-#
-# Authors: William Salmon <will.salmon@codethink.co.uk>
-#
-
-# Pylint doesn't play well with fixtures and dependency injection from pytest
-# pylint: disable=redefined-outer-name
-
-import os
-import pytest
-
-from buildstream._exceptions import ErrorDomain
-from buildstream import _yaml
-from buildstream.testing import cli # pylint: disable=unused-import
-from buildstream.testing import create_repo
-
-DATA_DIR = os.path.join(
- os.path.dirname(os.path.realpath(__file__)),
- 'ostree',
-)
-
-
-@pytest.mark.datafiles(os.path.join(DATA_DIR, 'template'))
-def test_submodule_track_no_ref_or_track(cli, tmpdir, datafiles):
- project = str(datafiles)
-
- # Create the repo from 'repofiles' subdir
- repo = create_repo('ostree', str(tmpdir))
- repo.create(os.path.join(project, 'repofiles'))
-
- # Write out our test target
- ostreesource = repo.source_config(ref=None)
- ostreesource.pop('track')
- element = {
- 'kind': 'import',
- 'sources': [
- ostreesource
- ]
- }
-
- _yaml.dump(element, os.path.join(project, 'target.bst'))
-
- # Track will encounter an inconsistent submodule without any ref
- result = cli.run(project=project, args=['show', 'target.bst'])
- result.assert_main_error(ErrorDomain.SOURCE, "missing-track-and-ref")
- result.assert_task_error(None, None)
diff --git a/tests/testutils/repo/ostree.py b/tests/testutils/repo/ostree.py
deleted file mode 100644
index c43f39ef2..000000000
--- a/tests/testutils/repo/ostree.py
+++ /dev/null
@@ -1,48 +0,0 @@
-import subprocess
-
-import pytest
-
-from buildstream.testing import Repo
-from .. import site
-
-
-class OSTree(Repo):
-
- def __init__(self, directory, subdir):
- if not site.HAVE_OSTREE_CLI or not site.HAVE_OSTREE:
- pytest.skip("ostree cli is not available")
-
- super(OSTree, self).__init__(directory, subdir)
- self.ostree = site.OSTREE_CLI
-
- def create(self, directory):
- subprocess.call([self.ostree, 'init',
- '--repo', self.repo,
- '--mode', 'archive-z2'])
- subprocess.call([self.ostree, 'commit',
- '--repo', self.repo,
- '--branch', 'master',
- '--subject', 'Initial commit',
- directory])
-
- latest = self.latest_commit()
-
- return latest
-
- def source_config(self, ref=None):
- config = {
- 'kind': 'ostree',
- 'url': 'file://' + self.repo,
- 'track': 'master'
- }
- if ref is not None:
- config['ref'] = ref
-
- return config
-
- def latest_commit(self):
- return subprocess.check_output([
- self.ostree, 'rev-parse',
- '--repo', self.repo,
- 'master'
- ], universal_newlines=True).strip()
diff --git a/tests/testutils/site.py b/tests/testutils/site.py
index 17c84cd8d..ef315efd6 100644
--- a/tests/testutils/site.py
+++ b/tests/testutils/site.py
@@ -32,7 +32,7 @@ except ProgramNotFoundError:
HAVE_OSTREE_CLI = False
try:
- from buildstream import _ostree # pylint: disable=unused-import
+ from bst_plugins_experimental.sources import _ostree # pylint: disable=unused-import
HAVE_OSTREE = True
except (ImportError, ValueError):
HAVE_OSTREE = False