aboutsummaryrefslogtreecommitdiffstats
path: root/func/cli.py
diff options
context:
space:
mode:
authorMofassir Arif <mofassir@gmail.com>2015-10-22 12:39:37 -0700
committerMofassir Arif <mofassir@gmail.com>2015-11-05 06:17:02 -0800
commit95bf8a8c96b2be94512e042f3f3c82edcbebf84d (patch)
tree7c7d1acd4dd596e84699a18d04e6ba2790e6fec2 /func/cli.py
parented6de63572d92bb5af8be22ced0a749400f4d3d4 (diff)
Python Framework for QTIP
Dhrystone Whetstone and DPI benchmarks have been implemented CLI arguments have been implemented test case are sorted based on category such as compute,network and storage glance and heat client have been used to generate the stack. automatic upload of QTIP image and delete function for existing stack before creating new stack has been implemented system information collecton and result generation has been implemented JIRA: QTIP-17 Signed-off-by: Mofassir Arif <mofassir_arif@dell.com> Change-Id: I4b7b134017723c30c771cc14d2edce33fcb8ba00
Diffstat (limited to 'func/cli.py')
-rw-r--r--func/cli.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/func/cli.py b/func/cli.py
new file mode 100644
index 00000000..235040b5
--- /dev/null
+++ b/func/cli.py
@@ -0,0 +1,60 @@
+##############################################################################
+# Copyright (c) 2015 Dell Inc 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
+##############################################################################
+
+import sys
+import os
+from func.env_setup import Env_setup
+from func.driver import Driver
+from func.spawn_vm import SpawnVM
+import argparse
+
+
+class cli():
+
+ def __init__(self):
+
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-s ', '--suite', help='compute network storage ')
+ parser.add_argument('-b', '--benchmark',
+ help='''COMPUTE:
+ dhrystone_serial.yaml \n
+ dhrystone_paralle.yaml \n
+ whetstone_serial.yaml \n
+ whetstone_parllel.yaml \n
+ dpi_serial.yaml \n
+ dpi_paralle.yaml \n
+ ssl_serial.yaml \n
+ ssl_parallel.yaml ''')
+ args = parser.parse_args()
+ if not (args.suite or args.benchmark):
+ parser.error('Not enough arguments, -h, --help ')
+ sys.exit(0)
+ if (args.suite and args.benchmark):
+ obj = Env_setup()
+ if os.path.isfile(
+ './test_cases/' +
+ args.suite +
+ '/' +
+ args.benchmark):
+
+ [benchmark, roles, vm_info] = obj.parse(
+ './test_cases/' + args.suite + '/' + args.benchmark)
+
+ if len(vm_info) != 0:
+ vmObj = SpawnVM(vm_info)
+
+ obj.callpingtest()
+ obj.callsshtest()
+ obj.updateAnsible()
+ dvr = Driver()
+ dvr.drive_bench(benchmark, obj.roles_dict.items())
+ else:
+ print (args.benchmark, ' is not a Template in the Directory - \
+ Enter a Valid file name. or use qtip.py -h for list')