示例#1
0
    def test_create(self, capsys):
        teuthology_argv = [
            '--suite',
            'upgrade/hammer',
            '--dry-run',
            '--ceph',
            'master',
            '--kernel',
            'distro',
            '--flavor',
            'gcov',
            '--distro',
            'ubuntu',
            '--suite-branch',
            'hammer',
            '--email',
            '*****@*****.**',
            '--num',
            '10',
            '--limit',
            '23',
            '--subset',
            '1/2',
            '--priority',
            '101',
            '--timeout',
            '234',
            '--filter',
            'trasher',
            '--filter-out',
            'erasure-code',
            '--throttle',
            '3',
        ]
        argv = (self.options +
                ['--upload', '--archive-upload', 'user@archive:/tmp'] +
                teuthology_argv)
        args = scripts.openstack.parse_args(argv)
        teuthology = TeuthologyOpenStack(args, None, argv)
        teuthology.user_data = 'teuthology/openstack/test/user-data-test1.txt'
        teuthology.teuthology_suite = 'echo --'

        teuthology.main()
        assert 'Ubuntu 14.04' in teuthology.ssh("lsb_release -a")
        variables = teuthology.ssh(
            "grep 'substituded variables' /var/log/cloud-init.log")
        assert "nworkers=" + str(args.simultaneous_jobs) in variables
        assert "username="******"upload=--archive-upload user@archive:/tmp" in variables
        assert "clone=git clone" in variables
        assert os.environ['OS_AUTH_URL'] in variables

        out, err = capsys.readouterr()
        assert " ".join(teuthology_argv) in out

        if self.can_create_floating_ips:
            ip = teuthology.get_floating_ip(self.name)
        teuthology.teardown()
        if self.can_create_floating_ips:
            assert teuthology.get_floating_ip_id(ip) == None
示例#2
0
    def test_floating_ip(self):
        if not self.can_create_floating_ips:
            pytest.skip('unable to create floating ips')

        expected = TeuthologyOpenStack.create_floating_ip()
        ip = TeuthologyOpenStack.get_unassociated_floating_ip()
        assert expected == ip
        ip_id = TeuthologyOpenStack.get_floating_ip_id(ip)
        OpenStack().run("ip floating delete " + ip_id)
示例#3
0
    def test_floating_ip(self):
        if not self.can_create_floating_ips:
            pytest.skip('unable to create floating ips')

        expected = TeuthologyOpenStack.create_floating_ip()
        ip = TeuthologyOpenStack.get_unassociated_floating_ip()
        assert expected == ip
        ip_id = TeuthologyOpenStack.get_floating_ip_id(ip)
        misc.sh("openstack ip floating delete " + ip_id)
示例#4
0
    def test_create(self, caplog):
        teuthology_argv = [
            '--suite', 'upgrade/hammer',
            '--dry-run',
            '--ceph', 'master',
            '--kernel', 'distro',
            '--flavor', 'gcov',
            '--distro', 'ubuntu',
            '--suite-branch', 'hammer',
            '--email', '*****@*****.**',
            '--num', '10',
            '--limit', '23',
            '--subset', '1/2',
            '--priority', '101',
            '--timeout', '234',
            '--filter', 'trasher',
            '--filter-out', 'erasure-code',
            '--throttle', '3',
        ]
        archive_upload = 'user@archive:/tmp'
        argv = (self.options +
                ['--teuthology-git-url', 'TEUTHOLOGY_URL',
                 '--teuthology-branch', 'TEUTHOLOGY_BRANCH',
                 '--ceph-workbench-git-url', 'CEPH_WORKBENCH_URL',
                 '--ceph-workbench-branch', 'CEPH_WORKBENCH_BRANCH',
                 '--upload',
                 '--archive-upload', archive_upload] +
                teuthology_argv)
        args = scripts.openstack.parse_args(argv)
        teuthology_argv.extend([
            '--archive-upload', archive_upload,
            '--archive-upload-url', args.archive_upload_url,
        ])
        teuthology = TeuthologyOpenStack(args, None, argv)
        teuthology.user_data = 'teuthology/openstack/test/user-data-test1.txt'
        teuthology.teuthology_suite = 'echo --'

        teuthology.main()
        assert 0 == teuthology.ssh("lsb_release -a")
        assert 0 == teuthology.ssh("grep 'substituded variables' /var/log/cloud-init.log")
        l = caplog.text()
        assert 'Ubuntu 16.04' in l
        assert "nworkers=" + str(args.simultaneous_jobs) in l
        assert "username="******"upload=--archive-upload user@archive:/tmp" in l
        assert ("ceph_workbench="
                " --ceph-workbench-branch CEPH_WORKBENCH_BRANCH"
                " --ceph-workbench-git-url CEPH_WORKBENCH_URL") in l
        assert "clone=git clone -b TEUTHOLOGY_BRANCH TEUTHOLOGY_URL" in l
        assert os.environ['OS_AUTH_URL'] in l
        assert " ".join(teuthology_argv) in l

        if self.can_create_floating_ips:
            ip = teuthology.get_floating_ip(self.name)
        teuthology.teardown()
        if self.can_create_floating_ips:
            assert teuthology.get_floating_ip_id(ip) == None
示例#5
0
    def test_floating_ip(self):
        if not self.can_create_floating_ips:
            pytest.skip("unable to create floating ips")

        expected = TeuthologyOpenStack.create_floating_ip()
        ip = TeuthologyOpenStack.get_unassociated_floating_ip()
        assert expected == ip
        ip_id = TeuthologyOpenStack.get_floating_ip_id(ip)
        misc.sh("openstack ip floating delete " + ip_id)
示例#6
0
    def test_create(self, caplog):
        teuthology_argv = [
            "--suite",
            "upgrade/hammer",
            "--dry-run",
            "--ceph",
            "master",
            "--kernel",
            "distro",
            "--flavor",
            "gcov",
            "--distro",
            "ubuntu",
            "--suite-branch",
            "hammer",
            "--email",
            "*****@*****.**",
            "--num",
            "10",
            "--limit",
            "23",
            "--subset",
            "1/2",
            "--priority",
            "101",
            "--timeout",
            "234",
            "--filter",
            "trasher",
            "--filter-out",
            "erasure-code",
            "--throttle",
            "3",
        ]
        argv = self.options + ["--upload", "--archive-upload", "user@archive:/tmp"] + teuthology_argv
        args = scripts.openstack.parse_args(argv)
        teuthology = TeuthologyOpenStack(args, None, argv)
        teuthology.user_data = "teuthology/openstack/test/user-data-test1.txt"
        teuthology.teuthology_suite = "echo --"

        teuthology.main()
        assert "Ubuntu 14.04" in teuthology.ssh("lsb_release -a")
        variables = teuthology.ssh("grep 'substituded variables' /var/log/cloud-init.log")
        assert "nworkers=" + str(args.simultaneous_jobs) in variables
        assert "username="******"upload=--archive-upload user@archive:/tmp" in variables
        assert "clone=git clone" in variables
        assert os.environ["OS_AUTH_URL"] in variables

        assert " ".join(teuthology_argv) in caplog.text()

        if self.can_create_floating_ips:
            ip = teuthology.get_floating_ip(self.name)
        teuthology.teardown()
        if self.can_create_floating_ips:
            assert teuthology.get_floating_ip_id(ip) == None
示例#7
0
    def test_create(self, caplog):
        teuthology_argv = [
            '--suite', 'upgrade/hammer',
            '--dry-run',
            '--ceph', 'master',
            '--kernel', 'distro',
            '--flavor', 'gcov',
            '--distro', 'ubuntu',
            '--suite-branch', 'hammer',
            '--email', '*****@*****.**',
            '--num', '10',
            '--limit', '23',
            '--subset', '1/2',
            '--priority', '101',
            '--timeout', '234',
            '--filter', 'trasher',
            '--filter-out', 'erasure-code',
            '--throttle', '3',
        ]
        archive_upload = 'user@archive:/tmp'
        argv = (self.options +
                ['--teuthology-git-url', 'TEUTHOLOGY_URL',
                 '--teuthology-branch', 'TEUTHOLOGY_BRANCH',
                 '--upload',
                 '--archive-upload', archive_upload] +
                teuthology_argv)
        args = scripts.openstack.parse_args(argv)
        teuthology_argv.extend([
            '--archive-upload', archive_upload,
            '--archive-upload-url', args.archive_upload_url,
        ])
        teuthology = TeuthologyOpenStack(args, None, argv)
        teuthology.user_data = 'teuthology/openstack/test/user-data-test1.txt'
        teuthology.teuthology_suite = 'echo --'

        teuthology.main()
        assert 0 == teuthology.ssh("lsb_release -a")
        assert 0 == teuthology.ssh("grep 'substituded variables' /var/log/cloud-init.log")
        l = caplog.text
        assert 'Ubuntu 14.04' in l
        assert "nworkers=" + str(args.simultaneous_jobs) in l
        assert "username="******"upload=--archive-upload user@archive:/tmp" in l
        assert "clone=git clone -b TEUTHOLOGY_BRANCH TEUTHOLOGY_URL" in l
        assert os.environ['OS_AUTH_URL'] in l
        assert " ".join(teuthology_argv) in l

        if self.can_create_floating_ips:
            ip = teuthology.get_floating_ip(self.name)
        teuthology.teardown()
        if self.can_create_floating_ips:
            assert teuthology.get_floating_ip_id(ip) == None
示例#8
0
    def setup_class(self):
        if 'OS_AUTH_URL' not in os.environ:
            pytest.skip('no OS_AUTH_URL environment variable')

        teuthology.log.setLevel(logging.DEBUG)
        teuthology.misc.read_config(argparse.Namespace())

        ip = TeuthologyOpenStack.create_floating_ip()
        if ip:
            ip_id = TeuthologyOpenStack.get_floating_ip_id(ip)
            misc.sh("openstack ip floating delete " + ip_id)
            self.can_create_floating_ips = True
        else:
            self.can_create_floating_ips = False
示例#9
0
    def setup_class(self):
        if 'OS_AUTH_URL' not in os.environ:
            pytest.skip('no OS_AUTH_URL environment variable')

        teuthology.log.setLevel(logging.DEBUG)
        set_config_attr(argparse.Namespace())

        ip = TeuthologyOpenStack.create_floating_ip()
        if ip:
            ip_id = TeuthologyOpenStack.get_floating_ip_id(ip)
            OpenStack().run("ip floating delete " + ip_id)
            self.can_create_floating_ips = True
        else:
            self.can_create_floating_ips = False