X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fceph-detect-init%2Fintegration%2Ftest_main.py;fp=src%2Fceph%2Fsrc%2Fceph-detect-init%2Fintegration%2Ftest_main.py;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=c5b6a20e5ecc11d22086288c4318f04a83532fdd;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/ceph-detect-init/integration/test_main.py b/src/ceph/src/ceph-detect-init/integration/test_main.py deleted file mode 100644 index c5b6a20..0000000 --- a/src/ceph/src/ceph-detect-init/integration/test_main.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (C) 2015 SUSE LINUX GmbH -# Copyright (C) 2015 -# -# Author: Owen Synge -# Author: Loic Dachary -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library Public License as published by -# the Free Software Foundation; either version 2, 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 Library Public License for more details. -# -import logging -import shutil -import subprocess -import testtools - -from ceph_detect_init import main - -logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', - level=logging.DEBUG) - - -def run(os): - name = 'ceph-detect-init-' + os - shutil.rmtree(name, ignore_errors=True) - script = """\ -docker build -t {name} --file integration/{os}.dockerfile . -toplevel=$(git rev-parse --show-toplevel) -mkdir {name} -cat > {name}/try.sh < {name}/init -EOF - -docker run -v $toplevel:$toplevel -w $(pwd) --user $(id -u) {name} bash -x {name}/try.sh -""".format(name=name, - os=os) - subprocess.check_call(script, shell=True) - init = open(name + '/init').read().strip() - shutil.rmtree(name) - return init - - -class TestCephDetectInit(testtools.TestCase): - - def test_alpine_3_4(self): - self.assertEqual('openrc', run('alpine-3.4')) - - def test_centos_6(self): - self.assertEqual('sysvinit', run('centos-6')) - - def test_centos_7(self): - self.assertEqual('sysvinit', run('centos-7')) - - def test_ubuntu_12_04(self): - self.assertEqual('upstart', run('ubuntu-12.04')) - - def test_ubuntu_14_04(self): - self.assertEqual('upstart', run('ubuntu-14.04')) - - def test_ubuntu_15_04(self): - self.assertEqual('upstart', run('ubuntu-15.04')) - - def test_debian_squeeze(self): - self.assertEqual('sysvinit', run('debian-squeeze')) - - def test_debian_wheezy(self): - self.assertEqual('sysvinit', run('debian-wheezy')) - - def test_debian_jessie(self): - self.assertEqual('sysvinit', run('debian-jessie')) - - def test_debian_sid(self): - self.assertEqual('sysvinit', run('debian-sid')) - - def test_fedora_21(self): - self.assertEqual('sysvinit', run('fedora-21')) - - def test_opensuse_13_1(self): - self.assertEqual('systemd', run('opensuse-13.1')) - - def test_opensuse_13_2(self): - self.assertEqual('systemd', run('opensuse-13.2')) - -# Local Variables: -# compile-command: "cd .. ; .tox/py27/bin/py.test integration/test_main.py" -# End: