diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-11-18 15:16:56 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-11-23 17:10:44 +0800 |
commit | 41076c1e725437f92095fcefd982a154f6d06f32 (patch) | |
tree | 8bbebbf65f3c35917c1a0d6e0da03bbdde196219 /functest/opnfv_tests/OpenStack/vPing/vping.py | |
parent | ddf121f9511368eaf5b8e3ebd4e00fbd4f91ee6e (diff) |
Adapt vping testcases to the new template
JIRA: FUNCTEST-540
Change-Id: I05f3704e3fc38e21d7d6484f4d7f53f030d5c34b
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'functest/opnfv_tests/OpenStack/vPing/vping.py')
-rwxr-xr-x | functest/opnfv_tests/OpenStack/vPing/vping.py | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/functest/opnfv_tests/OpenStack/vPing/vping.py b/functest/opnfv_tests/OpenStack/vPing/vping.py deleted file mode 100755 index 90f66456..00000000 --- a/functest/opnfv_tests/OpenStack/vPing/vping.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2015 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 -# -# 0.1: This script boots the VM1 and allocates IP address from Nova -# Later, the VM2 boots then execute cloud-init to ping VM1. -# After successful ping, both the VMs are deleted. -# 0.2: measure test duration and publish results under json format -# 0.3: adapt push 2 DB after Test API refacroting -# -# -import datetime -import time - -import argparse -import functest.utils.functest_logger as ft_logger - -import vping_util as util - -parser = argparse.ArgumentParser() -parser.add_argument("-d", "--debug", help="Debug mode", action="store_true") -parser.add_argument("-r", "--report", - help="Create json result file", - action="store_true") -parser.add_argument("-m", "--mode", default='ssh', - help="vPing mode: userdata or ssh", - action="store") - -args = parser.parse_args() - - -def main(): - if args.mode == 'ssh': - case = 'vping_ssh' - else: - case = 'vping_userdata' - - logger = ft_logger.Logger(case).getLogger() - - util.init(logger) - - util.check_repo_exist() - - vmname_1 = util.get_vmname_1() - vmname_2 = util.get_vmname_2() - - image_id = util.create_image() - - flavor = util.get_flavor() - - network_id = util.create_network_full() - - sg_id = util.create_security_group() - - util.delete_exist_vms() - - start_time = time.time() - logger.info("vPing Start Time:'%s'" % ( - datetime.datetime.fromtimestamp(start_time).strftime( - '%Y-%m-%d %H:%M:%S'))) - - vm1 = util.boot_vm(case, - vmname_1, - image_id, - flavor, - network_id, - None, - sg_id) - test_ip = util.get_test_ip(vm1) - vm2 = util.boot_vm(case, - vmname_2, - image_id, - flavor, - network_id, - test_ip, - sg_id) - - EXIT_CODE, stop_time = util.do_vping(case, vm2, test_ip) - details = util.check_result(EXIT_CODE, - start_time, - stop_time) - util.push_result(args.report, - case, - start_time, - stop_time, - details) - - exit(EXIT_CODE) - - -if __name__ == '__main__': - main() |