aboutsummaryrefslogtreecommitdiffstats
path: root/tests/opnfv/test_suites/opnfv_os-nosdn-openo-ha_daily.yaml
blob: 0375abcc6f74971db30bd21bec00b97c9a77708d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
# os nosdn openo ha daily task suite

schema: "yardstick:suite:0.1"

name: "os-nosdn-openo-ha"
test_cases_dir: "tests/opnfv/test_cases/"
test_cases:
-
    file_name: opnfv_yardstick_tc002.yaml
-
    file_name: opnfv_yardstick_tc005.yaml
-
    file_name: opnfv_yardstick_tc010.yaml
-
    file_name: opnfv_yardstick_tc011.yaml
-
    file_name: opnfv_yardstick_tc012.yaml
-
    file_name: opnfv_yardstick_tc014.yaml
-
    file_name: opnfv_yardstick_tc037.yaml
-
    file_name: opnfv_yardstick_tc043.yaml
    constraint:
        installer: compass
        pod: huawei-pod1
    task_args:
        huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
        "host": "node4","target": "node5"}'
-
    file_name: opnfv_yardstick_tc045.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc046.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc047.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc048.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc049.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc050.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc051.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc052.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc053.yaml
    constraint:
        installer: fuel
    task_args:
        default: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}'
-
    file_name: opnfv_yardstick_tc055.yaml
    constraint:
        installer: compass
        pod: huawei-pod1
    task_args:
        huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
        "host": "node5"}'
-
    file_name: opnfv_yardstick_tc063.yaml
    constraint:
        installer: compass
        pod: huawei-pod1
    task_args:
        huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
        "host": "node5"}'
-
    file_name: opnfv_yardstick_tc069.yaml
-
    file_name: opnfv_yardstick_tc070.yaml
-
    file_name: opnfv_yardstick_tc071.yaml
-
    file_name: opnfv_yardstick_tc072.yaml
-
    file_name: opnfv_yardstick_tc075.yaml
    constraint:
        installer: compass
        pod: huawei-pod1
    task_args:
        huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
        "host": "node1"}'
-
    file_name: opnfv_yardstick_tc027.yaml
    constraint:
        installer: compass,fuel
        pod: huawei-pod1,lf-pod2,ericsson-pod3,ericsson-pod4
    task_args:
        huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}'
        lf-pod2: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
        ericsson-pod3: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
        ericsson-pod4: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
>("cfy bootstrap --install-plugins " + "-p openstack-manager-blueprint.yaml -i inputs.yaml; ") cmd = "/bin/bash -c '" + script + "'" error = execute_command(cmd, self.logger) if error: return error self.logger.info("Cloudify-manager server is UP !") self.manager_up = True def undeploy_manager(self): self.logger.info("Launching the cloudify-manager undeployment") self.manager_up = False script = "source " + self.testcase_dir + "venv_cloudify/bin/activate; " script += "cd " + self.testcase_dir + "; " script += "cfy teardown -f --ignore-deployments; " cmd = "/bin/bash -c '" + script + "'" execute_command(cmd, self.logger) self.logger.info( "Cloudify-manager server has been successfully removed!") def download_upload_and_deploy_blueprint(self, blueprint, config, bp_name, dep_name): self.logger.info("Downloading the {0} blueprint".format( blueprint['file_name'])) destination_folder = self.testcase_dir + \ blueprint['destination_folder'] download_result = self._download_blueprints(blueprint['url'], blueprint['branch'], destination_folder) if not download_result: self.logger.error( "Failed to download blueprint {0}". format(blueprint['file_name'])) exit(-1) self.logger.info("Writing the inputs file") with open(self.testcase_dir + blueprint['destination_folder'] + "/inputs.yaml", "w") as f: f.write(yaml.dump(config, default_style='"')) f.close() self.logger.info("Launching the {0} deployment".format(bp_name)) script = "source " + self.testcase_dir + "venv_cloudify/bin/activate; " script += ("cd " + self.testcase_dir + blueprint['destination_folder'] + "; ") script += ("cfy blueprints upload -b " + bp_name + " -p openstack-blueprint.yaml; ") script += ("cfy deployments create -b " + bp_name + " -d " + dep_name + " --inputs inputs.yaml; ") script += ("cfy executions start -w install -d " + dep_name + " --timeout 1800; ") cmd = "/bin/bash -c '" + script + "'" error = execute_command(cmd, self.logger, 2000) if error: return error self.logger.info("The deployment of {0} is ended".format(dep_name)) def undeploy_deployment(self, dep_name): self.logger.info("Launching the {0} undeployment".format(dep_name)) script = "source " + self.testcase_dir + "venv_cloudify/bin/activate; " script += "cd " + self.testcase_dir + "; " script += ("cfy executions start -w uninstall -d " + dep_name + " --timeout 1800 ; ") script += "cfy deployments delete -d " + dep_name + "; " cmd = "/bin/bash -c '" + script + "'" try: execute_command(cmd, self.logger) except: self.logger.error("Clearwater undeployment failed") def _download_blueprints(blueprint_url, branch, dest_path): if os.path.exists(dest_path): shutil.rmtree(dest_path) try: Repo.clone_from(blueprint_url, dest_path, branch=branch) return True except: return False def execute_command(cmd, logger, timeout=1800): """ Execute Linux command """ if logger: logger.debug('Executing command : {}'.format(cmd)) timeout_exception = False output_file = "output.txt" f = open(output_file, 'w+') try: p = subprocess.call(cmd, shell=True, stdout=f, stderr=subprocess.STDOUT, timeout=timeout) except subprocess.TimeoutExpired: timeout_exception = True if logger: logger.error("TIMEOUT when executing command %s" % cmd) pass f.close() f = open(output_file, 'r') result = f.read() if result != "" and logger: logger.debug(result) if p == 0: return False else: if logger and not timeout_exception: logger.error("Error when executing command %s" % cmd) f = open(output_file, 'r') lines = f.readlines() result = lines[len(lines) - 3] result += lines[len(lines) - 2] result += lines[len(lines) - 1] return result