--- /dev/null
+#!/usr/bin/python -u
+# vim:fileencoding=utf-8:et:ts=4:sw=4:sts=4
+#
+# Copyright (C) 2013 Intel Corporation <markus.lehtonen@linux.intel.com>
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+"""The repocache-adm tool specific for obs-service-git-buildpackage"""
+
+import sys
+
+from repocache_adm.adm import MainCommand as BaseCommand
+from obs_service_gbp.command import read_config
+
+class MainCommand(BaseCommand):
+ """Class for the command line script"""
+ @staticmethod
+ def add_arguments(parser):
+ """Add arguments"""
+ # Parse config files
+ config = read_config()
+ # Add arguments
+ parser.set_defaults(cache_dir=config['repo-cache-dir'])
+
+
+if __name__ == '__main__':
+ sys.exit(MainCommand.main())
+
+
'service/git-buildpackage.service']),
('/etc/obs/services', ['config/git-buildpackage'])],
entry_points={
- 'console_scripts': ['repocache-adm = repocache_adm.adm:main']
+ 'console_scripts': ['repocache-adm = repocache_adm.adm:main',
+ 'obs-service-gbp-adm = obs_service_gbp.adm']
}
)
import mock
import os
import shutil
-from nose.tools import assert_raises, eq_ # pylint: disable=E0611
+from nose.tools import assert_raises, eq_, nottest # pylint: disable=E0611
+import obs_service_gbp.adm
+import repocache_adm.adm
from gbp_repocache import CachedRepo
-from repocache_adm.adm import MainCommand
from repocache_adm.common import SubcommandBase
from tests import UnitTestsBase
class TestRepocacheAdm(UnitTestsBase):
"""Test repocache-adm command line tool"""
- adm = MainCommand.main
+ adm = repocache_adm.adm.MainCommand.main
@classmethod
def setup_class(cls):
# Non-existent cache dir
eq_(self.adm(['-c', 'non-existent', 'stat']), 1)
+
+class TestGbpRepocacheAdm(TestRepocacheAdm):
+ """Test obs-service-gbp-adm command line tool"""
+
+ adm = obs_service_gbp.adm.MainCommand.main
+
+ @nottest
+ def test_not_implemented(self):
+ """Skip this test"""
+ pass
+