Re: [yocto] QA cycle report for 2.3.3 RC1

2017-12-22 Thread Jose Perez Carranza


On 12/21/2017 08:43 AM, Richard Purdie wrote:

On Wed, 2017-12-20 at 20:25 -0800, Cruz, Libertad wrote:

Hello All,
Enjoy viewing the full Report for 2.3.3 RC1:  https://wiki.yoctoproje
ct.org/wiki/WW51_-_2017-12-20-_Full_Test_Cycle_-_2.3.3_rc1

=== Summary 

The QA cycle for release 2.3.3 RC1 is complete.  There are 4 new bugs
from which so far none of them are high. QA has two big concerns:

 1.  Performance report shows an increase of 30% build time on
the eSDK in fedora 23, bug has not been created until further
investigation with setup outside of the GDC environment.

Could you confirm when the performance test machines were last
rebooted? We've had issues before where the benchmarks drift with
machine uptime. If the've been running for more than about 3 weeks I'd
like to run the benchmarks again after a reboot.

It was last week 12/12

-$ who -b
 system boot  2017-12-12 09:18

-$ uptime -s
 2017-12-12 09:19:28


Thanks!

Richard


--
Saludos
José

--
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [qa-tools][PATCH] scripts: Add ptest-parser to create reports for pTest executions

2017-10-03 Thread Jose Perez Carranza


On 10/03/2017 09:42 AM, Joshua Lock wrote:

Hi Jose,

Where will the previous log come from in standard QA use?

I'm wondering if we should work towards (in the 2.5 cycle) another git 
repo in the yp-qa-* namespace to keep historical ptest results and 
build some tooling around that, in a similar vein to poky-buildhistory 
/ buildhistory-diff and yp-qa-build-perf-data / oe-build-perf-report.


Thanks,

Joshua

Hi Joshua

Currently,  as defined on the process of execution for pTest on QA 
cycles [1] , we download the last execution directly from the wiki 
created previously, here is an archive of the pTest executions [2]. The 
proposal of creating a separate repo to handle the results is great, are 
you able to raise a bug with the details of this proposal and assign it 
to me hence I can check with the team who can manage that implementation.


1- https://wiki.yoctoproject.org/wiki/BSP_Test_Plan#pTest
2- https://wiki.yoctoproject.org/wiki/Ptest/archive

José


On 02/10/17 21:52, jose.perez.carra...@linux.intel.com wrote:

From: Jose Perez Carranza 

Add ptest-parser.py scrip that creates a file with the report of pTest
execution compared with the previous results provided, the data stored
on the file is in wikimedia format to be copied and pasted on the new
created wiki for pTest results of QA cycle.

Signed-off-by: Jose Perez Carranza 
---
  scripts/ptest-parser.py | 234 


  1 file changed, 234 insertions(+)
  create mode 100755 scripts/ptest-parser.py

diff --git a/scripts/ptest-parser.py b/scripts/ptest-parser.py
new file mode 100755
index 000..a3f20fb
--- /dev/null
+++ b/scripts/ptest-parser.py
@@ -0,0 +1,234 @@
+#!/usr/bin/python3
+
+import sys
+import os.path
+import codecs
+import logging
+import argparse
+
+
+prelog = {}
+currlog = {}
+
+
+def get_args():
+    parser = argparse.ArgumentParser(description="Parse ptest results")
+    requiredNamed = parser.add_argument_group('required arguments')
+    requiredNamed.add_argument('-p', dest="pre_log", required=True, 
help='prvious log of the pTest result')
+    requiredNamed.add_argument('--pre_commit', dest="pre_commit", 
required=True, help='commit of the previous log.')
+    requiredNamed.add_argument('--pre_release', dest="pre_release", 
required=True, help='release of the previous log.')
+    requiredNamed.add_argument('-c', dest="curr_log", required=True, 
help='current log of pTets results.')
+    requiredNamed.add_argument('--curr_commit', dest="curr_commit", 
required=True, help='commit of the current log.')
+    requiredNamed.add_argument('--curr_release', 
dest="curr_release", required=True, help='release of the current log.')

+
+    return parser.parse_args()
+
+
+
+##Check that logs exists
+def check_args():
+    if not os.path.isfile(args.pre_log):
+    logging.error("Cannot find log file %s" % args.pre_log)
+    sys.exit(1)
+    elif not os.path.isfile(args.curr_log):
+    logging.error("Cannot find log file %s" % args.pre_curr)
+
+
+def create_log_dict(argslog):
+    test_id = ""
+    result = ""
+    failures = ""
+    failures_log = []
+    passed = 0
+    failed = 0
+    content_file = codecs.open(argslog, 'r', 'utf-8', errors='ignore')
+    content = content_file.read()
+    content = content.split("\n")
+    res_dict = {}
+    directory = 'failures'
+
+    #create dir to store failures
+    if not os.path.exists(directory):
+    os.makedirs(directory)
+
+    #Parse the logs
+    for i in range (len(content)-1):
+    try:
+    result = content[i].split(":")[0]
+    test_id = content[i].split(":")[1].strip()
+    except:
+    result = None
+    if result:
+    if result in "BEGIN":
+    test_module = test_id
+    test_module = test_module.replace('/usr/lib/', '')
+    test_module = test_module.replace('/ptest', '')
+    elif result in "PASS":
+    passed = passed + 1
+    elif result in "FAIL":
+    failed = failed + 1
+    failures = "{0}:{1}" .format(result,test_id)
+    failures_log.append(failures)
+    elif result in "END":
+    total = passed + failed
+    if total == 0:
+    passrate = 0
+    else:
+    passrate = 100 * (passed / total)
+    res_dict[test_module] = [total, passed, failed, 
round(passrate,2)]

+
+    #Store Failures
+    with open('failures/'+test_module+".failures&q

[yocto] [qa-tools][PATCH] scripts: Add ptest-parser to create reports for pTest executions

2017-10-02 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add ptest-parser.py scrip that creates a file with the report of pTest
execution compared with the previous results provided, the data stored
on the file is in wikimedia format to be copied and pasted on the new
created wiki for pTest results of QA cycle.

Signed-off-by: Jose Perez Carranza 
---
 scripts/ptest-parser.py | 234 
 1 file changed, 234 insertions(+)
 create mode 100755 scripts/ptest-parser.py

diff --git a/scripts/ptest-parser.py b/scripts/ptest-parser.py
new file mode 100755
index 000..a3f20fb
--- /dev/null
+++ b/scripts/ptest-parser.py
@@ -0,0 +1,234 @@
+#!/usr/bin/python3
+
+import sys
+import os.path
+import codecs
+import logging
+import argparse
+
+
+prelog = {}
+currlog = {}
+
+
+def get_args():
+parser = argparse.ArgumentParser(description="Parse ptest results")
+requiredNamed = parser.add_argument_group('required arguments')
+requiredNamed.add_argument('-p', dest="pre_log", required=True, 
help='prvious log of the pTest result')
+requiredNamed.add_argument('--pre_commit', dest="pre_commit", 
required=True, help='commit of the previous log.')
+requiredNamed.add_argument('--pre_release', dest="pre_release", 
required=True, help='release of the previous log.')
+requiredNamed.add_argument('-c', dest="curr_log", required=True, 
help='current log of pTets results.')
+requiredNamed.add_argument('--curr_commit', dest="curr_commit", 
required=True, help='commit of the current log.')
+requiredNamed.add_argument('--curr_release', dest="curr_release", 
required=True, help='release of the current log.')
+
+return parser.parse_args()
+
+
+
+##Check that logs exists
+def check_args():
+if not os.path.isfile(args.pre_log):
+logging.error("Cannot find log file %s" % args.pre_log)
+sys.exit(1)
+elif not os.path.isfile(args.curr_log):
+logging.error("Cannot find log file %s" % args.pre_curr)
+
+
+def create_log_dict(argslog):
+test_id = ""
+result = ""
+failures = ""
+failures_log = []
+passed = 0
+failed = 0
+content_file = codecs.open(argslog, 'r', 'utf-8', errors='ignore')
+content = content_file.read()
+content = content.split("\n")
+res_dict = {}
+directory = 'failures'
+
+#create dir to store failures
+if not os.path.exists(directory):
+os.makedirs(directory)
+
+#Parse the logs
+for i in range (len(content)-1):
+try:
+result = content[i].split(":")[0]
+test_id = content[i].split(":")[1].strip()
+except:
+result = None
+if result:
+if result in "BEGIN":
+test_module = test_id
+test_module = test_module.replace('/usr/lib/', '')
+test_module = test_module.replace('/ptest', '')
+elif result in "PASS":
+passed = passed + 1
+elif result in "FAIL":
+failed = failed + 1
+failures = "{0}:{1}" .format(result,test_id)
+failures_log.append(failures)
+elif result in "END":
+total = passed + failed
+if total == 0:
+passrate = 0
+else:
+passrate = 100 * (passed / total)
+res_dict[test_module] = [total, passed, failed, 
round(passrate,2)]
+
+#Store Failures
+with open('failures/'+test_module+".failures", 'w') as 
failures_file:
+for fails in failures_log:
+failures_file.write("{0}\n" .format(fails))
+failures_log = []
+
+total = passed = failed = 0
+
+return res_dict
+
+
+def create_compared_dict(currlog, prelog):
+diff = set(prelog.keys()) - set(currlog.keys())
+
+for key, value in currlog .items():
+if key in prelog.keys():
+lastpastrate = prelog[key][3]
+else:
+lastpastrate = 0
+
+currlog[key].append(lastpastrate)
+
+for item in diff:
+if item in prelog.keys():
+currlog[item] = prelog[item]
+currlog[item].insert(3, 0)
+
+return currlog
+
+
+def create_header(file_name):
+header = '[https://wiki.yoctoproject.org/wiki/Ptest/archive < Archive]' + \
+ '\n\nRan on a NUC and compared with' + \
+ '[[Ptest %s| %s]]'% (args.pre_commit, args.pre_release) + \
+ '

Re: [yocto] [qa-tools][PATCH 1/4] poduct/init: Add support for PackageManagement component

2017-07-05 Thread Jose Perez Carranza



On 07/04/2017 05:19 PM, Robert P. J. Day wrote:

   "poduct/init" ?

This patch is referring to qa-tools repo.

http://git.yoctoproject.org/cgit/cgit.cgi/qa-tools/tree/testopia_update/product


rday



--
Saludos
José

--
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 4/4] utils/wikimaker: Add default values

2017-07-04 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add default values for section of “performance” and “pTest” to avoid use
old data on new reports.

Signed-off-by: Jose Perez Carranza 
---
 testopia_update/utils/wikimaker.py | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/testopia_update/utils/wikimaker.py 
b/testopia_update/utils/wikimaker.py
index 96fdfc0..b3cce60 100644
--- a/testopia_update/utils/wikimaker.py
+++ b/testopia_update/utils/wikimaker.py
@@ -99,18 +99,18 @@ def wiki_perf_tests(file_name):
 '.html GDC Charts]\n\nBelow chars are showing the latest' + \
 'performance results taken from the current milestone.\n\n' + \
 '== Performance Charts==\n\nFor Bitbake core-image-sato with' 
+ \
-'rm_work\n\n[[File:Ww19-2k17 - rmwork.png | 1280px | ' + \
+'rm_work\n\n[[File:Ww##-2k17 - rmwork.png | 1280px | ' + \
 'link=https://wiki.yoctoproject.org/charts/perf_milestone_' + \
 'GDC/bitbake-core-image-sato-rmwork.html ]]\n\nBuilding the ' 
+ \
-'Virtual kernel\n\n[[File:Ww19-2k17 - kernel.png | 1280px | ' 
+ \
+'Virtual kernel\n\n[[File:WwXX-2k17 - kernel.png | 1280px | ' 
+ \
 'link=https://wiki.yoctoproject.org/charts/perf_milestone_' + \
 'GDC/bitbake-virtual-kernel.html]]\n\nBuilding the rootfs\n' + 
\
-'\n[[File:Ww19-2k17_-_rootfs.png | 1280px | link=https://' + \
+'\n[[File:WwXX-2k17_-_rootfs.png | 1280px | link=https://' + \
 'wiki.yoctoproject.org/charts/perf_milestone_GDC/bitbake-' + \
 'core-image-sato-rootfs.html]]\n\nBuilding core-image-sato' + \
-'\n\n[[File:Ww19-2k17_-_sato.png | 1280px | link=https://' + \
+'\n\n[[File:WwXX-2k17_-_sato.png | 1280px | link=https://' + \
 'wiki.yoctoproject.org/charts/perf_milestone_GDC/bitbake-' + \
-'core-image-sato.html]]\n\neSDK Deploy time\n\n[[File:Ww19' + \
+'core-image-sato.html]]\n\neSDK Deploy time\n\n[[File:WwXX' + \
 '-2k17_-_esdk.png | 1280px | link=https://wiki.yoctoproject' + 
\
 '.org/charts/perf_milestone_GDC/bitbake-eSDK.html]]\n'
 
@@ -123,7 +123,7 @@ def wic_ptest_results(file_name):
 'milestone,status,resolution,cf_regression_type,created\n' + \
 '|noresultsmessage="None"\n|sort=status\n' + \
 '|group=product\n|id=\n}}\n\n== results ==\n\n' + \
-'{{:Ptest 381897c64069ea43d595380a3ae913bcc79cf7e1}}\n'
+'{{:Ptest }}\n'
 
 with open(file_name, 'a') as f:
 f.write(perf_data)
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 3/4] testopia_update: Add validation for empty sub parameters on setup

2017-07-04 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add an error message for the cases when “setup” is selected and no sub
parameters are given.

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testopia_update.py b/testopia_update.py
index 0015d69..8080256 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -72,7 +72,6 @@ def connect_to_testopia():
 config = None
 opts = Options()
 
-#testopia_config = ['url', 'username', 'password', 'store_location']
 testopia_config = ['url', 'username', 'password']
 
 if not args.config and os.path.exists(DEFAULT_CONFIG_FILE):
@@ -270,6 +269,9 @@ if __name__ == '__main__':
 print(wikivars)
 create_wiki(wikivars, wikivars_list)
 
+else:
+logger.error("Sub arguments --clone-templates or --create-wiki 
should be given")
+
 sys.exit(0)
 
 
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 2/4] scripts/full-test-cycle-wrapper: Add support for new 2.4 components

2017-07-04 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add support for new packages supported for 2.4 release and update
components list according to release version.

Signed-off-by: Jose Perez Carranza 
---
 scripts/full-test-cycle-wrapper.sh | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/scripts/full-test-cycle-wrapper.sh 
b/scripts/full-test-cycle-wrapper.sh
index 7dcd62e..6b62d7f 100755
--- a/scripts/full-test-cycle-wrapper.sh
+++ b/scripts/full-test-cycle-wrapper.sh
@@ -89,7 +89,7 @@ create_yocto(){
create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
 
#QEMUs Autos
-   ENVIRONMENTS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64")
+   ENVIRONMENTS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64", "qemux86-64-WIC", "qemux86-WIC")
EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
 
@@ -218,6 +218,14 @@ create_test_cycle(){
   OPTIONAL="UI"
   create_test_run "${1}" $OPTIONAL
   ;;
+"Package Management Issues")
+  ENVIRONMENTS=("Any Supported Distro")
+  EXECUTION_TYPE="MANUAL"
+  #This case test plan name is diferent from product name
+  TEST_PLAN="--test-plan Package-Management-Updates"
+  create_test_run "${1}"
+   
  ;;
+
   esac
 }
 
@@ -296,7 +304,21 @@ source venv/bin/activate
 
 ## Define components by t ype of test cycle
 if [[ $TYPE == "YOCTO" ]]; then
-COMPONENTS=("ADT" "BitBake" "BSP/QEMU" "CROPS" "Eclipse Plugin" "eSDK" 
"General Runtime" "Kernel" "Meta-yocto" "OE-Core" "Runtime" "Toaster")
+case $VERSION in
+   "2.1")   COMPONENTS=("ADT" "BitBake" "BSP/QEMU" "Eclipse Plugin" 
"General Runtime" "Meta-yocto" "OE-Core" "Runtime" "Toaster")
+;;
+   "2.2")   COMPONENTS=("ADT" "BitBake" "BSP/QEMU" "Eclipse Plugin" 
"eSDK" "General Runtime" "Meta-yocto" "OE-Core" "Runtime" "Toaster")
+;;
+   "2.3")   COMPONENTS=("ADT" "BitBake" "BSP/QEMU" "CROPS" "Eclipse 
Plugin" "eSDK" "General Runtime" "Kernel" "Meta-yocto" "OE-Core" "Runtime" 
"Toaster")
+;;
+   "2.4")   COMPONENTS=("ADT" "BitBake" "BSP/QEMU" "CROPS" "Eclipse 
Plugin" "eSDK" "General Runtime" "Kernel" "Meta-yocto" "OE-Core" "Runtime" 
"Toaster" "Package Management Issues")
+;;
+  \?)
+echo "ERROR: INAVLID RELEASE VERSION"
+exit 1
+;;
+esac
+
 else
 COMPONENTS=("BSP/QEMU")
 fi
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 1/4] poduct/init: Add support for PackageManagement component

2017-07-04 Thread jose . perez . carranza
From: Jose Perez Carranza 

Create package_management_issues.py product and add support to use this
product on init file.

Signed-off-by: Jose Perez Carranza 
---
 testopia_update/product/__init__.py  | 2 ++
 testopia_update/product/package_management_issues.py | 4 
 2 files changed, 6 insertions(+)
 create mode 100644 testopia_update/product/package_management_issues.py

diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index 8d31a1e..30b2201 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -262,6 +262,7 @@ def get_products(testopia, opts, config, logger, **kwargs):
 from . import esdk
 from . import kernel
 from . import general_runtime
+from . import package_management_issues
 
 products = []
 
@@ -277,6 +278,7 @@ def get_products(testopia, opts, config, logger, **kwargs):
 products.append(esdk.eSDKProduct(testopia, opts, logger, config, **kwargs))
 products.append(kernel.KernelProduct(testopia, opts, logger, config, 
**kwargs))
 products.append(general_runtime.GeneralRuntimeProduct(testopia, opts, 
logger, config, **kwargs))
+
products.append(package_management_issues.PackageManagementIssues(testopia, 
opts, logger, config, **kwargs))
 products.append(DummyProduct(testopia, opts, logger, config, **kwargs))
 
 
diff --git a/testopia_update/product/package_management_issues.py 
b/testopia_update/product/package_management_issues.py
new file mode 100644
index 000..1f3ecc7
--- /dev/null
+++ b/testopia_update/product/package_management_issues.py
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class PackageManagementIssues(Product):
+name = 'Package Management Issues'
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 4/4] testopia_update: Add support to create_wiki functionality

2017-06-13 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add option that allows using –create-wiki under setup option,this potion
takes date and project as a parameter and search for tests runs and
generates the wiki report data in a file.

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py | 78 --
 1 file changed, 58 insertions(+), 20 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index b438cff..0015d69 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -8,6 +8,7 @@ import ConfigParser
 
 from external.testopia import Testopia
 from testopia_update.product import get_products, get_product_class
+from testopia_update.utils.wikimaker import create_wiki
 
 DEFAULT_CONFIG_FILE = "testopia_update.config"
 DEFAULT_STORE_LOCATION = "/tmp/testopia_update"
@@ -153,6 +154,10 @@ def get_args():
 dest="clone_templates", help='clone templates from one branch to \
   another or same branch (only available) \
   with setup action', const='Y', nargs='?')
+parser.add_argument('--create-wiki', required=False,
+dest="create_wiki", help='create a wiki page for the final report of \
+  the QA test cycle  (only available \
+  with setup action)', const='Y', 
nargs='?')
 parser.add_argument('--new-branch', required=False,
 dest="new_branch", help='New branch to clone the Templates')
 
@@ -204,34 +209,67 @@ if __name__ == '__main__':
 args.product_name = 'Dummy'
 product = get_product_class(args.product_name, products)
 summary = 'TRTEMP_' +  args.project_version
+
 templates = product.get_test_run_list(None, summary)
 for t in templates:
 print ("%s - %s " % (t['run_id'], t['summary']))
+
 sys.exit(0)
 
 if args.action == 'setup':
-setup_opts = ['clone_templates', 'project_version','branch_name',
-  'old_project_version', 'product_name']
+if args.clone_templates:
+setup_opts = ['clone_templates', 'project_version','branch_name',
+   'old_project_version', 'product_name']
 
-load_opts(args, setup_opts, opts)
+load_opts(args, setup_opts, opts)
+
+product = get_product_class(args.product_name, products)
+test_plan = product.get_test_plan(args.branch_name)
+temp_summary = 'TRTEMP_' +  args.old_project_version
+temp_list = product.get_test_run_list(test_plan,temp_summary)
+if not temp_list:
+logger.error("%s: No templates found with %s string on %s"
+ % (sys.argv[0], temp_summary, args.branch_name))
+
+for tr in temp_list:
+if args.new_branch and args.new_branch != args.branch_name:
+kwargs['new_branch'] = args.new_branch
+
+new_template = product.clone_template(tr,
+   
args.old_project_version,args.project_version,
+   **kwargs)
+
+logger.info("%s: Template was created with (%d), Summary 
(%s)"
+% (sys.argv[0], new_template['run_id'],
+new_template['summary']))
+
+elif args.create_wiki:
+setup_opts = ['create_wiki', 'project_date', 'project_version']
+
+load_opts(args, setup_opts, opts)
+
+args.product_name = 'Dummy'
+product = get_product_class(args.product_name, products)
+summary = args.project_date + '_' + args.project_version
+
+templates = product.get_test_run_list(None, summary)
+wikivars = ''
+wikivars_list = []
+idx=0
+for t in templates:
+idx += 1
+plan = product.get_test_plan_by_id(t['plan_id'])
+prod = testopia.product_lookup_name_by_id(plan['product_id'])
+env = product.get_environment_by_id(t['environment_id'])
+env_name = env['name'].replace(' ','_')
+var = str(idx) + '_' + str(prod['name']) + '_' + env_name
+wikivars_list.append(var)
+wikivars += ''.join(["{{#vardefine:", var, '|  ',
+

[yocto] [qa-tools][PATCH 3/4] testopia_update/utils: Add utils directory

2017-06-13 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add utils directory to be used as the repository for different utilities

-wikimaker.py : scripts that creates the wiki report data saves it to
the data inside a file to be copied on the already created wiki page

Signed-off-by: Jose Perez Carranza 
---
 testopia_update/utils/__init__.py  |   0
 testopia_update/utils/wikimaker.py | 203 +
 2 files changed, 203 insertions(+)
 create mode 100644 testopia_update/utils/__init__.py
 create mode 100644 testopia_update/utils/wikimaker.py

diff --git a/testopia_update/utils/__init__.py 
b/testopia_update/utils/__init__.py
new file mode 100644
index 000..e69de29
diff --git a/testopia_update/utils/wikimaker.py 
b/testopia_update/utils/wikimaker.py
new file mode 100644
index 000..96fdfc0
--- /dev/null
+++ b/testopia_update/utils/wikimaker.py
@@ -0,0 +1,203 @@
+#!/usr/bin/env python
+
+def wiki_define_varaibles(file_name, wikivars):
+write_vars = '{|\n' + wikivars + '|}\n'
+with open(file_name, "w+") as f:
+f.write(write_vars)
+
+
+def wiki_testing_data(file_name):
+test_data = '\n=Testing data= \n  \n Test type: \n Branch: \n' + \
+' Build name: \n poky commit: \n Autobuilder images repository: \n' + \
+' Distributions tested: \n  \n'
+with open(file_name, 'a') as f:
+f.write(test_data)
+
+def wiki_test_summary(file_name, list_vars):
+vars_wikistyle = ''
+
+#Create the list of variables on wiki style
+for v in list_vars:
+vars_wikistyle += ''.join(['{{#var:', v, '}}, '])
+
+#Delete the last ',' of the list of varaibles
+vars_wikistyle = vars_wikistyle[:-2]
+
+#Create the summary table
+summary_table = '{|\n|{{#testopia:\n|run_id=0, %s\n'  % vars_wikistyle + \
+'||report_id=concatstats}}\n'
+
+#Create bug status graphics
+bugs_graphics = '\n' + \
+'{|\n|{{#testopia:\n|run_id=0, %s\n  '  % vars_wikistyle + \
+'|chart=bstatus\n  |report_id=bugs\n  |charttype=bar\n' + \
+'  |sortable=true\n  |nudechart=true\n  |chartpos=top\n}}\n'
+
+tc_report = '\n' + \
+'{|\n|{{#testopia:\n|run_id=0, %s\n'  % vars_wikistyle + \
+'|charttype=bar\n|report_id=status}}\n|}'
+
+with open(file_name, 'a') as f:
+f.write((summary_table + '\n' + bugs_graphics + '\n' + tc_report))
+
+def wiki_bugs_found_QA(file_name):
+bugs_new = '\n= Bugs Found during QA Test =\n==  New issues Found during QA Test & Community ==' 
+ \
+ '\n{{#bugzilla:\n   |columns=id,summary,priority,to,qa,' + \
+ 'milestone,status,resolution,cf_regression_type,created\n' + \
+ '   |noresultsmessage="None"\n   |sort=ID\n   |group=product\n' + 
\
+ '   |id= \n}}\n\n\n'
+
+bugs_hm_not_new = '==  High and M+ issues' + \
+  'Found during QA Test (NOT NEW) ==\n{{#bugzilla' 
+ \
+  ':\n   |columns=id,summary,priority,to,qa,milestone,' + \
+  'status,resolution,cf_regression_type,created\n   ' + \
+  '|noresultsmessage="None"\n   |sort=priority\n   ' + \
+  '|group=product\n   |id= \n}}\n\n'
+
+other_bugs = '== Other Bugs found during QA Test (NOT NEW) ==\n' + \
+ '{{#bugzilla:\n   |columns=id,summary,priority,to,qa,' + \
+ 'milestone,status,resolution,cf_regression_type,created\n' + \
+ '   |noresultsmessage="None"\n   |sort=priority\n'+ \
+ '   |group=cf_regression_type,product\n   |id= \n}}\n'
+
+
+with open(file_name, 'a') as f:
+f.write((bugs_new + bugs_hm_not_new + other_bugs))
+
+def wiki_community_bugs(file_name):
+open_bugs = '\n= Current community Open Bugs - Medium+/High =\n' + \
+'Overview of the open bugs opened against current milestone' + 
\
+'or release which are Medium+ or High and are not targeted' + \
+'for the next milestones\n\n{{#bugzilla:\n|columns=id,' + \
+'priority,summary,to,qa,milestone,status,cf_regression_type' + 
\
+',created\n|noresultsmessage="None"\n|priority=high,' 
+ \
+'Medium%2B\n|severity=!enhancement\n' + \
+'|sort=cf_regression_type\n|group=product\n' + \
+'|total=summary\n|statu

[yocto] [qa-tools][PATCH 2/4] poduct/init: Add functions to get product and environment names

2017-06-13 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add functions as follows:
- get_test_plan_by_id : Get test plan providing the plan ID
- get_product_name: Get product name providing the product ID
- get_environment_by_id: Get environment providing the environment ID

Signed-off-by: Jose Perez Carranza 
---
 testopia_update/product/__init__.py | 17 +
 1 file changed, 17 insertions(+)

diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index a24196a..8d31a1e 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -32,6 +32,17 @@ class Product(object):
 
 return tp
 
+def get_test_plan_by_id(self, plan_id):
+tp = self.testopia.testplan_get(plan_id)
+
+return tp
+
+def get_product_name(self, product_id):
+prod_name = self.testopia.product_lookup_name_by_id(product_id)
+
+return prod_name
+
+
 def get_environment(self, tp, env_name):
 tp_envs = self.testopia.product_get_environments(tp['product_id'])
 for tp_env in tp_envs:
@@ -47,6 +58,12 @@ class Product(object):
 tp_envs = self.testopia.product_get_environments(tp['product_id'])
 return [tp_env['name'] for tp_env in tp_envs]
 
+def get_environment_by_id(self, env_id):
+environment_id = 
self.testopia.testrun_lookup_environment_name_by_id(env_id)
+
+return environment_id
+
+
 def _format_build_name(self, project_version, project_revision):
 return "%s: %s" % (project_version, project_revision)
 
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 1/4] external/testopia: Modify commands to get Product and Environment

2017-06-13 Thread jose . perez . carranza
From: Jose Perez Carranza 

Modify commands to get Product and Environment name providing
the ID.

Signed-off-by: Jose Perez Carranza 
---
 external/testopia.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/external/testopia.py b/external/testopia.py
index f2f2d45..a82b32e 100755
--- a/external/testopia.py
+++ b/external/testopia.py
@@ -627,7 +627,7 @@ class Testopia(object):
 
 Result: The product name for the respective id or empty string if an 
error occurs.
 """
-return self.do_command("Product.lookup_name_by_id", 
[self._number_noop(id)])
+return self.do_command("TestopiaProduct.get", [self._number_noop(id)])
 
 
 def product_get_milestones(self, product_id):
@@ -1629,7 +1629,7 @@ class Testopia(object):
 
 Result: The TestRun environment name for the respective id or empty 
string if an error occurs.
 """
-return self.do_command("TestRun.lookup_environment_name_by_id", 
[self._number_noop(id)])
+return self.do_command("Environment.get", [self._number_noop(id)])
 
 
 ## TestCaseRun 
##
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH] testopia_update: Add functionality to list templates

2017-06-12 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add support to list available templates per specific releases

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py  | 18 --
 testopia_update/product/__init__.py |  9 +++--
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index fa8d10c..b438cff 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -109,6 +109,8 @@ def get_args():
 
 parser.add_argument('--list-products', required=False, action="store_true",
 dest="list_products", default=False, help='List available products.')
+parser.add_argument('--list-templates', required=False, 
action="store_true",
+dest="list_templates", default=False, help='List available templates.')
 
 parser.add_argument('-a', '--action', required=False, dest='action',
 choices=ACTIONS,
@@ -148,8 +150,8 @@ def get_args():
 dest="old_project_version", help='Version of the project to clone 
from')
 
 parser.add_argument('--clone-templates', required=False,
-dest="clone_templates", help='clone templates from one brnach to \
-  another or same branch (only avaibale) \
+dest="clone_templates", help='clone templates from one branch to \
+  another or same branch (only available) \
   with setup action', const='Y', nargs='?')
 parser.add_argument('--new-branch', required=False,
 dest="new_branch", help='New branch to clone the Templates')
@@ -195,6 +197,18 @@ if __name__ == '__main__':
 print("%s\n" % p.name)
 sys.exit(0)
 
+if args.list_templates:
+if not args.project_version:
+logger.error("--project-version should be specified")
+else:
+args.product_name = 'Dummy'
+product = get_product_class(args.product_name, products)
+summary = 'TRTEMP_' +  args.project_version
+templates = product.get_test_run_list(None, summary)
+for t in templates:
+print ("%s - %s " % (t['run_id'], t['summary']))
+sys.exit(0)
+
 if args.action == 'setup':
 setup_opts = ['clone_templates', 'project_version','branch_name',
   'old_project_version', 'product_name']
diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index ba34d02..a24196a 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -216,8 +216,13 @@ class Product(object):
 return tr_id
 
 def get_test_run_list(self, test_plan, temp_summary):
-list_test_runs = 
self.testopia.testrun_list(plan_id=test_plan['plan_id'],
-   summary=temp_summary)
+try:
+plan_id = test_plan['plan_id']
+except:
+plan_id = test_plan
+
+list_test_runs = self.testopia.testrun_list(plan_id,
+summary=temp_summary)
 
 return list_test_runs
 
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH] testopia_update: Add functionality to list templates

2017-06-02 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add support to list available templates per specific releases

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py  | 18 --
 testopia_update/product/__init__.py |  9 +++--
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index fa8d10c..b438cff 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -109,6 +109,8 @@ def get_args():
 
 parser.add_argument('--list-products', required=False, action="store_true",
 dest="list_products", default=False, help='List available products.')
+parser.add_argument('--list-templates', required=False, 
action="store_true",
+dest="list_templates", default=False, help='List available templates.')
 
 parser.add_argument('-a', '--action', required=False, dest='action',
 choices=ACTIONS,
@@ -148,8 +150,8 @@ def get_args():
 dest="old_project_version", help='Version of the project to clone 
from')
 
 parser.add_argument('--clone-templates', required=False,
-dest="clone_templates", help='clone templates from one brnach to \
-  another or same branch (only avaibale) \
+dest="clone_templates", help='clone templates from one branch to \
+  another or same branch (only available) \
   with setup action', const='Y', nargs='?')
 parser.add_argument('--new-branch', required=False,
 dest="new_branch", help='New branch to clone the Templates')
@@ -195,6 +197,18 @@ if __name__ == '__main__':
 print("%s\n" % p.name)
 sys.exit(0)
 
+if args.list_templates:
+if not args.project_version:
+logger.error("--project-version should be specified")
+else:
+args.product_name = 'Dummy'
+product = get_product_class(args.product_name, products)
+summary = 'TRTEMP_' +  args.project_version
+templates = product.get_test_run_list(None, summary)
+for t in templates:
+print ("%s - %s " % (t['run_id'], t['summary']))
+sys.exit(0)
+
 if args.action == 'setup':
 setup_opts = ['clone_templates', 'project_version','branch_name',
   'old_project_version', 'product_name']
diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index ba34d02..a24196a 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -216,8 +216,13 @@ class Product(object):
 return tr_id
 
 def get_test_run_list(self, test_plan, temp_summary):
-list_test_runs = 
self.testopia.testrun_list(plan_id=test_plan['plan_id'],
-   summary=temp_summary)
+try:
+plan_id = test_plan['plan_id']
+except:
+plan_id = test_plan
+
+list_test_runs = self.testopia.testrun_list(plan_id,
+summary=temp_summary)
 
 return list_test_runs
 
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 2/2] testopia_update.py: Add functionality for setup clone-templates

2017-05-29 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add action “setup” to do a different actions on the exiting Testopia DB,
also add validation for the specific option used on this new action,
sub-option “-clone-templates” implemented to help on the setup for new
release and cloning form the same bran or form one branch to another.

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py | 65 +++---
 1 file changed, 57 insertions(+), 8 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index b3e900d..fa8d10c 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -5,7 +5,6 @@ import sys
 import argparse
 import logging
 import ConfigParser
-import types
 
 from external.testopia import Testopia
 from testopia_update.product import get_products, get_product_class
@@ -13,8 +12,9 @@ from testopia_update.product import get_products, 
get_product_class
 DEFAULT_CONFIG_FILE = "testopia_update.config"
 DEFAULT_STORE_LOCATION = "/tmp/testopia_update"
 
-ACTIONS = ('create', 'update')
-BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists', 'morty', "pyro")
+ACTIONS = ('create', 'update', 'setup')
+BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists', 'morty', 
"krogoth",
+"pyro")
 CATEGORIES = ('AUTO', 'MANUAL')
 
 
@@ -41,16 +41,28 @@ def load_results(results_log):
 
 
 def load_opts(args, opts_list, opts):
+
+invalid_opts = ['old_project_version', 'clone_templates', 'new_branch']
+
+if args.action == "create" or args.action == "update":
+for invarg in invalid_opts:
+if getattr(args, invarg):
+logger.error("option %s not availabe for %s  action "
+ % (invarg, args.action))
+sys.exit(1)
+
 for to in opts_list:
 if to in vars(args):
 arg = getattr(args, to)
 if arg:
 setattr(opts, to, arg)
+
 if not hasattr(opts, to):
 logger.error("%s: Requires testopia %s in arguments or config." % \
 (sys.argv[0], to))
+
 if args.action == "update":
-logger.warn('for action create you can use only --testrun-id ' 
+
+logger.warn('for action update you can use only --testrun-id ' 
+
 'and --results-log if test run was already 
created')
 sys.exit(1)
 
@@ -59,7 +71,8 @@ def connect_to_testopia():
 config = None
 opts = Options()
 
-testopia_config = ['url', 'username', 'password', 'store_location']
+#testopia_config = ['url', 'username', 'password', 'store_location']
+testopia_config = ['url', 'username', 'password']
 
 if not args.config and os.path.exists(DEFAULT_CONFIG_FILE):
 args.config = DEFAULT_CONFIG_FILE
@@ -73,8 +86,8 @@ def connect_to_testopia():
 
 load_opts(args, testopia_config, opts)
 
-if not os.path.exists(opts.store_location):
-os.makedirs(opts.store_location)
+if not os.path.exists(DEFAULT_STORE_LOCATION):
+os.makedirs(DEFAULT_STORE_LOCATION)
 
 return opts, config
 
@@ -99,7 +112,7 @@ def get_args():
 
 parser.add_argument('-a', '--action', required=False, dest='action',
 choices=ACTIONS,
-help='Action to execute can be create or update.')
+help='Action to execute can be create, update or setup')
 parser.add_argument('-p', '--product', required=False,
 dest="product_name", help='Product to create or update.')
 parser.add_argument('-c', '--category', required=False,
@@ -131,6 +144,16 @@ def get_args():
 parser.add_argument('--results-log', required=False,
 dest="results_log", help='Results log.')
 
+parser.add_argument('--old-project-version', required=False,
+dest="old_project_version", help='Version of the project to clone 
from')
+
+parser.add_argument('--clone-templates', required=False,
+dest="clone_templates", help='clone templates from one brnach to \
+  another or same branch (only avaibale) \
+  with setup action', const='Y', nargs='?')
+parser.add_argument('--new-branch', required=False,
+dest="new_branch", help='New branch to clone the Template

[yocto] [qa-tools][PATCH 1/2] init: Add functionality to clone templates

2017-05-29 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add “clone_template” function that allow cloning in the same branch or
for X to Y branch, also add “get_test_run_list” to do a query of test
runs with specific summary and specific test plan.

Signed-off-by: Jose Perez Carranza 
---
 testopia_update/product/__init__.py | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index f31190c..ba34d02 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -150,6 +150,26 @@ class Product(object):
 
 return new_test_run
 
+def clone_template(self, test_run, old_project_version, 
new_project_version,
+**kwargs):
+if 'new_branch' in kwargs:
+plan_id = self.get_test_plan(kwargs['new_branch'])['plan_id']
+else:
+plan_id = test_run['plan_id']
+
+test_case_ids = self._get_test_case_ids(test_run)
+summary = test_run['summary'].replace(old_project_version,
+new_project_version)
+
+summary = summary.replace('TEMPLATE','TRTEMP')
+
+new_test_run = self.testopia.testrun_create(test_run['build_id'],
+test_run['environment_id'], plan_id, summary,
+self.testopia.userId, product_version=new_project_version)
+self.testopia.testrun_add_cases(test_case_ids, new_test_run['run_id'])
+
+return new_test_run
+
 def parse_results_log(self, log_file):
 regex = "^.*RESULTS.* (?P\d+): (?PPASSED|FAILED)$"
 if hasattr(self, 'results_regex'):
@@ -195,6 +215,12 @@ class Product(object):
 
 return tr_id
 
+def get_test_run_list(self, test_plan, temp_summary):
+list_test_runs = 
self.testopia.testrun_list(plan_id=test_plan['plan_id'],
+   summary=temp_summary)
+
+return list_test_runs
+
 class DummyProduct(Product):
 #Dummy product to use when specific product is not required
 name = 'Dummy'
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH] Full-test-cycle-wrapper: Add support for point releases

2017-05-16 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add support to scenarios were a execution is needed for branch different
from master, delete lsb-joule environment as is not supported and add
logic to do the “Testopia connection” modular and reusable by other
scripts.

Signed-off-by: Jose Perez Carranza 
---
 scripts/full-test-cycle-wrapper.sh | 16 +++---
 testopia_update.py | 44 --
 2 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/scripts/full-test-cycle-wrapper.sh 
b/scripts/full-test-cycle-wrapper.sh
index 2b3a130..7dcd62e 100755
--- a/scripts/full-test-cycle-wrapper.sh
+++ b/scripts/full-test-cycle-wrapper.sh
@@ -51,6 +51,13 @@ create_test_run(){
   OPT="-o $2"
fi
 
+#If point release is used then milestone is not asigned
+   if [[ $MILESTONE == M* ]]; then
+  BUILD_MILESTONE="$VERSION $MILESTONE"
+   else
+  BUILD_MILESTONE="$VERSION$MILESTONE"
+   fi
+
#echo " CREATING TEST RUNS FOR - $1 - #"
for ENV in "${ENVIRONMENTS[@]}"
do
@@ -61,7 +68,7 @@ create_test_run(){
  do
 #call the script that creates Test Runs
 ./testopia_update.py --config $CONFIG_FILE -a $ACTION -p "${1}" -c 
$EXTP -b $BRANCH \
--e "$ENV"  --project-version $VERSION --project-milestone "$VERSION 
$MILESTONE" \
+-e "$ENV"  --project-version $VERSION --project-milestone 
"$BUILD_MILESTONE" \
 --project-date $PJDATE --project-revision $RELEASE-$REVISION $OPT 
$TEST_PLAN --verbose
  done
done
@@ -119,7 +126,7 @@ create_meta-intel(){
create_test_run "${1}" "core-image-sato-sdk_ANYBSP"
 
#BSP Autos LSB
-   ENVIRONMENTS=("core2-32_lsb_MMAX32" "corei7-64_lsb_NUC" 
"corei7-64_lsb_MMAX64" "corei7-64_lsb_Joule" "corei7-64_lsb_CherryHill")
+   ENVIRONMENTS=("core2-32_lsb_MMAX32" "corei7-64_lsb_NUC" 
"corei7-64_lsb_MMAX64" "corei7-64_lsb_CherryHill")
 
EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-lsb-sdk_ANYBSP"
@@ -226,7 +233,9 @@ usage(){
   echo " -p PROJECT VERSION  {2.2 2.3 2.4}
   Version of the project."
   echo " -m PROJECT MILESTONE {M1 M2 M3 M4}
-  Milestone of the project."
+  Milestone of the project.
+ if is point release set milestone with .#
+ .1 .2 .3"
   echo " -r RELEASE COMMIT {XX}
   SCM Revision of the project, commit of branch 
tested."
   echo " -c RELEAE CANDIDATE {rc1 rc2 rcX}
@@ -236,6 +245,7 @@ usage(){
   exit
 }
 
+
 if [[ ( $# == "--help") ||  $# == "-h" || $# -eq 0 ]] ; then
 usage
 exit 0
diff --git a/testopia_update.py b/testopia_update.py
index 50c3325..0a3f7f5 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -14,7 +14,7 @@ DEFAULT_CONFIG_FILE = "testopia_update.config"
 DEFAULT_STORE_LOCATION = "/tmp/testopia_update"
 
 ACTIONS = ('create', 'update')
-BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists')
+BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists', "pyro")
 CATEGORIES = ('AUTO', 'MANUAL')
 
 
@@ -54,6 +54,31 @@ def load_opts(args, opts_list, opts):
 'and --results-log if test run was already 
created')
 sys.exit(1)
 
+
+def connect_to_testopia():
+config = None
+opts = Options()
+
+testopia_config = ['url', 'username', 'password', 'store_location']
+
+if not args.config and os.path.exists(DEFAULT_CONFIG_FILE):
+args.config = DEFAULT_CONFIG_FILE
+
+if args.config:
+config = ConfigParser.SafeConfigParser()
+config.read(args.config)
+
+for to in testopia_config:
+setattr(opts, to, config.get("Testopia", to))
+
+load_opts(args, testopia_config, opts)
+
+if not os.path.exists(opts.store_location):
+os.makedirs(opts.store_location)
+
+return opts, config
+
+
 class Options(object):
 pass
 
@@ -132,25 +157,12 @@ if __name__ == '__main__':
 'project_version', 'project_milestone', 'project_revision',
 'project_date']
 
-config = None
-if not args.config and os.path.exists(DEFAULT_CONFIG_FILE):
-args.config = DEFAULT_CONFIG_FILE
-
-if args.config:
-config = ConfigParser.SafeConfigParser()
-config.read(args.config)
-
-for to in testopia_config:
-setattr(opts, to, config.get("Test

[yocto] [qa-tools][PATCH] external/testopia: Correct 'testrun_list' function

2017-05-04 Thread jose . perez . carranza
From: Jose Perez Carranza 

Correct function “testrun_list” to retrieve a list of of TestRun
dictionaries instead of TestCase dictionaries.

Signed-off-by: Jose Perez Carranza 
---
 external/testopia.py | 34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/external/testopia.py b/external/testopia.py
index d42538b..f2f2d45 100755
--- a/external/testopia.py
+++ b/external/testopia.py
@@ -161,7 +161,7 @@ class TestopiaXmlrpcError(Exception):
 def __str__(self):
 return "Error while executing cmd '%s' --> %s" \
% ( self.verb + "(" + self.params + ")", self.wrappedError)
-
+
 class Testopia(object):
 
 view_all=True # By default, a list returns at most 25 elements. We force 
here to see all.
@@ -176,7 +176,7 @@ class Testopia(object):
 
 For example, given config.txt containing:
   [testopia]
-  login: j...@mycompany.com', 
+  login: j...@mycompany.com',
   password: jdoepassword'
   url: https://myhost.mycompany.com/bugzilla/tr_xmlrpc.cgi
 
@@ -191,15 +191,15 @@ class Testopia(object):
 kwargs = dict([(key, cp.get('testopia', key)) \
for key in ['username', 'password', 'url']])
 return Testopia(**kwargs)
-
+
 def __init__(self, username, password, url, sslverify=True):
 """Initialize the Testopia driver.
 
 'username' -- string, the account to log into Testopia such as 
j...@mycompany.com,
 'password' -- string, the password for the username,
-'url' -- string, the URL of the XML-RPC interface 
+'url' -- string, the URL of the XML-RPC interface
 
-Example: t = Testopia('j...@mycompany.com', 
+Example: t = Testopia('j...@mycompany.com',
   'jdoepassword'
   
'https://myhost.mycompany.com/bugzilla/tr_xmlrpc.cgi')
 """
@@ -411,7 +411,7 @@ class Testopia(object):
 return eval(cmd)
 except xmlrpclib.Error, e:
 raise TestopiaXmlrpcError(verb, params, e)
-
+
 ## Build 
###
 
 
@@ -545,7 +545,7 @@ class Testopia(object):
)])
 
 def environment_check_by_name(self, name, product_id):
-return self.do_command("Environment.check_environment", 
+return self.do_command("Environment.check_environment",
   [self._string_noop(name),
self._number_noop(product_id)])
 
@@ -1437,9 +1437,9 @@ class Testopia(object):
 
 Example: testrun_list(run_id=20, run_id_type='lessthan')
 
-Result: A list of TestCase dictionaries
+Result: A list of TestRun dictionaries
 """
-return self.do_command("TestCase.list", [self._options_ne_dict(
+return self.do_command("TestRun.list", [self._options_ne_dict(
self._number_option('run_id', run_id),
self._search_op('runid_type', run_id_type),
self._number_option('build_id', build_id),
@@ -1497,7 +1497,7 @@ class Testopia(object):
)])
 
 
-def testrun_update(self, run_id, status_id,build_id=None, 
+def testrun_update(self, run_id, status_id,build_id=None,
environment_id=None,
manager_id=None, plan_text_version=None, summary=None,
notes=None, product_version=None, stop_date=None):
@@ -1862,7 +1862,7 @@ class TestopiaUnitTest(unittest.TestCase):
 class LoginUnitTests(TestopiaUnitTest):
 def test_login(self):
 # Ensure that we logged in, and that we have our userId recorded:
-self.assert_(self.testopia is not None)
+self.assert_(self.testopia is not None)
 self.assert_(self.testopia.userId>0)
 
 def test_bogus_call(self):
@@ -1877,7 +1877,7 @@ class BuildUnitTests(TestopiaUnitTest):
 self.assertEquals(buildDict['build_id'], buildId)
 self.assert_('product_id' in buildDict)
 # etc
-
+
 """API entry points that aren't yet covered:
 def build_create(self, name, product_id, description=None, milestone=None,
isactive=None)
@@ -1892,7 +1892,7 @@ class BuildUnitTests(TestopiaUnitTest):
 """
 def build_lookup_name_by_id(self, id)
 """
-
+
 class EnvironmentUnitTests(TestopiaUnitTest):
 def test_environment_get(self):
 envId = 1
@@ -1905,7 +1905,7 @@ class EnvironmentUnitTests(Testopi

[yocto] [qa-tools][PATCH] Full-test-cycle-wrapper: Add missing environments

2017-05-04 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add missing environments for CROPS and BSP components

Signed-off-by: Jose Perez Carranza 
---
 scripts/full-test-cycle-wrapper.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/full-test-cycle-wrapper.sh 
b/scripts/full-test-cycle-wrapper.sh
index 7d0ceb1..2b3a130 100755
--- a/scripts/full-test-cycle-wrapper.sh
+++ b/scripts/full-test-cycle-wrapper.sh
@@ -113,13 +113,13 @@ create_meta-intel(){
#BSP Autos
ENVIRONMENTS=("core2-32_MMAX32" "corei7-64_NUC" "corei7-64_MMAX64" 
"corei7-64_Joule" \
 "core2-32_WIC_MMAX32" "corei7-64_WIC_NUC" 
"corei7-64_WIC_MMAX64" "corei7-64_WIC_Joule" \
-   "intel-quark_Galileo" "intel-quark_WIC_Galileo")
+   "intel-quark_Galileo" "intel-quark_WIC_Galileo" 
"corei7-64_CherryHill" "corei7-64_WIC_CherryHill")
 
EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-sato-sdk_ANYBSP"
 
#BSP Autos LSB
-   ENVIRONMENTS=("core2-32_lsb_MMAX32" "corei7-64_lsb_NUC" 
"corei7-64_lsb_MMAX64" "corei7-64_lsb_Joule")
+   ENVIRONMENTS=("core2-32_lsb_MMAX32" "corei7-64_lsb_NUC" 
"corei7-64_lsb_MMAX64" "corei7-64_lsb_Joule" "corei7-64_lsb_CherryHill")
 
EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-lsb-sdk_ANYBSP"
@@ -151,7 +151,7 @@ create_test_cycle(){
   "CROPS")
ENVIRONMENTS=("Centos 7.1")
   EXECUTION_TYPE="AUTO"
-  OPTIONAL="Toaster Poky"
+  OPTIONAL="eSDK Poky"
   for OPT in $OPTIONAL
do
   create_test_run "${1}" $OPT
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH] full-test-cycle-wrapper: Correct typos

2017-04-04 Thread jose . perez . carranza
From: Jose Perez Carranza 

Update name of ENVIRONMETS to ENVIRONMENTS and update the
ENVIRONMENTS value for runtime component

Signed-off-by: Jose Perez Carranza 
---
 scripts/full-test-cycle-wrapper.sh | 44 +++---
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/scripts/full-test-cycle-wrapper.sh 
b/scripts/full-test-cycle-wrapper.sh
index 3a6ba0f..7d0ceb1 100755
--- a/scripts/full-test-cycle-wrapper.sh
+++ b/scripts/full-test-cycle-wrapper.sh
@@ -21,7 +21,7 @@
 #Set variables to be used globally
 export CONFIG_FILE='testopia_update.config'
 export ACTION='create'
-export ENVIRONMETS=""
+export ENVIRONMENTS=""
 export EXECUTION_TYPE=""
 export OPTIONAL=""
 export TEST_PLAN=""
@@ -52,7 +52,7 @@ create_test_run(){
fi
 
#echo " CREATING TEST RUNS FOR - $1 - #"
-   for ENV in "${ENVIRONMETS[@]}"
+   for ENV in "${ENVIRONMENTS[@]}"
do
  if [[ $2 == "BSP-MAN"  ]]; then
  OPT="-o $IMAGE$ENV"
@@ -72,33 +72,33 @@ create_test_run(){
 
 create_yocto(){
#BSP MANUALS
-   ENVIRONMETS=("Genericx86_MMAX32" "Genericx86-64_NUC" "Beaglebone-Black" 
"EdgeRouter" "MPC8315e-rdb")
+   ENVIRONMENTS=("Genericx86_MMAX32" "Genericx86-64_NUC" "Beaglebone-Black" 
"EdgeRouter" "MPC8315e-rdb")
EXECUTION_TYPE="MANUAL"
create_test_run "${1}" "BSP-MAN"
 
#QEMUs Manuals
-   ENVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64")
+   ENVIRONMENTS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64")
EXECUTION_TYPE="MANUAL"
create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
 
#QEMUs Autos
-   ENVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64")
+   ENVIRONMENTS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64")
EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
 
#QEMUs Autos LSB
-   ENVIRONMETS=("qemux86-lsb" "qemux86_64-lsb")
+   ENVIRONMENTS=("qemux86-lsb" "qemux86_64-lsb")
EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-lsb-sdk_ANYQEMU"
 
#BSP Autos
-   ENVIRONMETS=("genericx86 - on MMAX32bit" "genericx86-64 on MMAX64" 
"genericx86-64 on NUC" "genericx86-64-WIC on MMAX64" \
+   ENVIRONMENTS=("genericx86 - on MMAX32bit" "genericx86-64 on MMAX64" 
"genericx86-64 on NUC" "genericx86-64-WIC on MMAX64" \
 "genericx86-64-WIC on NUC" "genericx86-WIC on MMAX32"  
"MPC8315e-rdb" "Beaglebone Black" "EdgeRouter")
EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-sato-sdk_ANYBSP"
 
#BSP Autos
-   ENVIRONMETS=("genericx86-64-lsb on NUC" "genericx86-64-lsb on MMAX64" 
"genericx86-lsb on MMAX32bit")
+   ENVIRONMENTS=("genericx86-64-lsb on NUC" "genericx86-64-lsb on MMAX64" 
"genericx86-lsb on MMAX32bit")
EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-lsb-sdk_ANYBSP"
 
@@ -106,12 +106,12 @@ create_yocto(){
 
 create_meta-intel(){
#BSP MANUALS
-   ENVIRONMETS=("core2-32_MMAX32" "corei7-64_NUC")
+   ENVIRONMENTS=("core2-32_MMAX32" "corei7-64_NUC")
EXECUTION_TYPE="MANUAL"
create_test_run "${1}" "BSP-MAN"
 
#BSP Autos
-   ENVIRONMETS=("core2-32_MMAX32" "corei7-64_NUC" "corei7-64_MMAX64" 
"corei7-64_Joule" \
+   ENVIRONMENTS=("core2-32_MMAX32" "corei7-64_NUC" "corei7-64_MMAX64" 
"corei7-64_Joule" \
 "core2-32_WIC_MMAX32" "corei7-64_WIC_NUC" 
"corei7-64_WIC_MMAX64" "corei7-64_WIC_Joule" \
"intel-quark_Galileo" "intel-quark_WIC_Galileo")
 
@@ -119,7 +119,7 @@ create_meta-intel(){
create_test_run "${1}" "core-image-sato-sdk_ANYBSP"
 
#BSP Autos LSB
-   ENVIRONMETS=("core2-32_lsb_MMAX32" "corei7-64_lsb_NUC" 
"corei7-64_lsb_MMAX64" "corei7-64_lsb_Joule")
+   ENVIRONMENTS=("

[yocto] [qa-tools][PATCH] full-test-cycle-wrapper: Correct qemu-auto variables

2017-04-04 Thread jose . perez . carranza
From: Jose Perez Carranza 

Update variables for creating test runs for qemu ato component

Signed-off-by: Jose Perez Carranza 
---
 scripts/full-test-cycle-wrapper.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/full-test-cycle-wrapper.sh 
b/scripts/full-test-cycle-wrapper.sh
index f52cd96..3a6ba0f 100755
--- a/scripts/full-test-cycle-wrapper.sh
+++ b/scripts/full-test-cycle-wrapper.sh
@@ -82,8 +82,8 @@ create_yocto(){
create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
 
#QEMUs Autos
-   EVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64" "qemux86-lsb" "qemux86_64-lsb")
-   ECUTION_TYPE="AUTO"
+   ENVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64")
+   EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
 
#QEMUs Autos LSB
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [qa-tools][PATCH] full-test-cycle-wrapper: Correct qemu-auto variables

2017-03-17 Thread Jose Perez Carranza



On 03/17/2017 03:47 AM, Jussi Kukkonen wrote:



On 16 March 2017 at 17:34, <mailto:jose.perez.carra...@linux.intel.com>> wrote:

>
> From: Jose Perez Carranza <mailto:jose.perez.carra...@linux.intel.com>>

>
> Update variables for creating test runs for qemu ato component
>
> Signed-off-by: Jose Perez Carranza 
<mailto:jose.perez.carra...@linux.intel.com>>

> ---
>  scripts/full-test-cycle-wrapper.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/full-test-cycle-wrapper.sh 
b/scripts/full-test-cycle-wrapper.sh

> index f52cd96..3a6ba0f 100755
> --- a/scripts/full-test-cycle-wrapper.sh
> +++ b/scripts/full-test-cycle-wrapper.sh
> @@ -82,8 +82,8 @@ create_yocto(){
> create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
>
> #QEMUs Autos
> -   EVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" 
"qemumips64" "qemuppc" "qemux86-64" "qemux86-lsb" "qemux86_64-lsb")

> -   ECUTION_TYPE="AUTO"
> +   ENVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" 
"qemumips64" "qemuppc" "qemux86-64")


It seems this is in master already so I'll just mention the typo for 
future: ENVIRONMETS should probably be ENVIRONMENTS in whole file.
I'll correct that in the next series of patches. thanks for pointing it 
out.


José


  Jussi

> +   EXECUTION_TYPE="AUTO"
> create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
>
> #QEMUs Autos LSB
> --
> 2.11.0
>
> --
> ___
> yocto mailing list
> yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
> https://lists.yoctoproject.org/listinfo/yocto


--
Saludos
José

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH] full-test-cycle-wrapper: Correct qemu-auto variables

2017-03-16 Thread jose . perez . carranza
From: Jose Perez Carranza 

Update variables for creating test runs for qemu ato component

Signed-off-by: Jose Perez Carranza 
---
 scripts/full-test-cycle-wrapper.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/full-test-cycle-wrapper.sh 
b/scripts/full-test-cycle-wrapper.sh
index f52cd96..3a6ba0f 100755
--- a/scripts/full-test-cycle-wrapper.sh
+++ b/scripts/full-test-cycle-wrapper.sh
@@ -82,8 +82,8 @@ create_yocto(){
create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
 
#QEMUs Autos
-   EVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64" "qemux86-lsb" "qemux86_64-lsb")
-   ECUTION_TYPE="AUTO"
+   ENVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64")
+   EXECUTION_TYPE="AUTO"
create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
 
#QEMUs Autos LSB
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH v2] testopia_update: Improvements on update action functionality

2017-03-08 Thread jose . perez . carranza
From: Jose Perez Carranza 

Some improvements were applied when using option
action=create :

   - Create a new option to update test runs by ID
   - Create functions to load results and update test run
   - Add warning to use –testrun-id
   - Improvements to update_test_run using exiting data of test run
   - Create function get test run details by ID
   - Create Dummy product to use on cases when specific product is not
 relevant

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py  | 60 +
 testopia_update/product/__init__.py | 17 +--
 2 files changed, 61 insertions(+), 16 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index 044074a..50c3325 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -17,6 +17,29 @@ ACTIONS = ('create', 'update')
 BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists')
 CATEGORIES = ('AUTO', 'MANUAL')
 
+
+def update_test_run(env, build, test_run, results):
+missing = product.update_test_run(test_run, results)
+for tcid in missing:
+logger.warn("%s: Test run %d, Case %d wasn't updated" %
+(sys.argv[0], test_run['run_id'], tcid))
+
+
+def load_results(results_log):
+if not results_log:
+logger.error("%s: For action update --results-log needs to be 
specified"
+ % (sys.argv[0]))
+sys.exit(1)
+if not os.path.exists(args.results_log):
+logger.error("%s: Results log (%s) doesn't exists."
+ % (sys.argv[0], results_log))
+sys.exit(1)
+
+res = product.parse_results_log(args.results_log)
+
+return res
+
+
 def load_opts(args, opts_list, opts):
 for to in opts_list:
 if to in vars(args):
@@ -26,6 +49,9 @@ def load_opts(args, opts_list, opts):
 if not hasattr(opts, to):
 logger.error("%s: Requires testopia %s in arguments or config." % \
 (sys.argv[0], to))
+if args.action == "update":
+logger.warn('for action create you can use only --testrun-id ' 
+
+'and --results-log if test run was already 
created')
 sys.exit(1)
 
 class Options(object):
@@ -73,6 +99,9 @@ def get_args():
 parser.add_argument('--test-plan', required=False,
 dest="plan_name", help='Name of the test plan of the product, used 
when \
 test plan name is different from product 
name.')
+parser.add_argument('--testrun-id', required=False,
+dest="trun_id", help='Number of the test run to be updated, this \
+  option should be used along with update action.')
 
 parser.add_argument('--results-log', required=False,
 dest="results_log", help='Results log.')
@@ -131,6 +160,21 @@ if __name__ == '__main__':
 print("%s\n" % p.name)
 sys.exit(0)
 
+if args.action == 'update' and args.trun_id:
+args.product_name = 'Dummy'
+product = get_product_class(args.product_name, products)
+try:
+tr = product.get_existing_test_run(int(args.trun_id))
+except Exception as e:
+logger.error("%s: Problem found with Test Run %s: \n==>%s"
+ % (sys.argv[0], args.trun_id, e))
+sys.exit(1)
+
+results = load_results(args.results_log)
+update_test_run(tr['environment_id'], tr['build_id'], tr, results)
+
+sys.exit(0)
+
 load_opts(args, testopia_opts, opts)
 
 params = ['action', 'product_name', 'branch_name', 'env_name']
@@ -205,16 +249,8 @@ if __name__ == '__main__':
 " and ID (%s)." % (sys.argv[0], template_test_run['run_id'],
 test_run['summary'], test_run['run_id']))
 elif args.action == "update":
-if not args.results_log:
-logger.error("%s: For update --results-log needs to be specified." 
\
-% (sys.argv[0]))
-sys.exit(1)
-if not os.path.exists(args.results_log):
-logger.error("%s: Results log (%s) don't exists." \
-% (sys.argv[0], args.results_log))
-sys.exit(1)
+results = load_results(args.results_log)
 
-results = product.parse_results_log(args.results_log)
 test_run = product.get_test_run(test_plan, env, build, 
args.project_date,
 args.project_version, args.category_name, args.optional)
 if not test_run:
@@ -224,8 +260,6 @@ if __na

[yocto] [qa-tools][PATCH] scripts: Wrapper that helps to create a full test cycle

2017-03-08 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add a wrapper that  helps to create the required test runs
for a full cycle on master branch.

Signed-off-by: Jose Perez Carranza 
---
 scripts/full-test-cycle-wrapper.sh | 302 +
 1 file changed, 302 insertions(+)
 create mode 100755 scripts/full-test-cycle-wrapper.sh

diff --git a/scripts/full-test-cycle-wrapper.sh 
b/scripts/full-test-cycle-wrapper.sh
new file mode 100755
index 000..f52cd96
--- /dev/null
+++ b/scripts/full-test-cycle-wrapper.sh
@@ -0,0 +1,302 @@
+#!/bin/bash
+#
+# Full Test Cycle wrapper
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+#
+# This script is wrapper to create a set of test runs on testo[pia
+# for a full QA execution cycle.
+
+
+#Set variables to be used globally
+export CONFIG_FILE='testopia_update.config'
+export ACTION='create'
+export ENVIRONMETS=""
+export EXECUTION_TYPE=""
+export OPTIONAL=""
+export TEST_PLAN=""
+export IMAGE="core-image-sato-sdk_"
+
+#Go to the main directory of qa-tools
+FILEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+QADIR="`echo $FILEDIR | sed 's/scripts//g'`"
+cd $QADIR
+
+
+display_bars(){
+   if [ $1 == "START"  ]; then
+   echo "|### CREATING TEST RUNS FOR  - $2 - |"
+   elif [ $1 == "END"  ]; then
+echo "|--- TEST RUNS COMPLETED FOR - $2 - -"
+   fi
+}
+
+
+#Function that creates the Test Runs for specific component
+create_test_run(){
+   #Check if optional parameters are given
+   if [ -z $2  ]; then
+  OPT=""
+   else
+  OPT="-o $2"
+   fi
+
+   #echo " CREATING TEST RUNS FOR - $1 - #"
+   for ENV in "${ENVIRONMETS[@]}"
+   do
+ if [[ $2 == "BSP-MAN"  ]]; then
+ OPT="-o $IMAGE$ENV"
+ fi
+ for EXTP in $EXECUTION_TYPE
+ do
+#call the script that creates Test Runs
+./testopia_update.py --config $CONFIG_FILE -a $ACTION -p "${1}" -c 
$EXTP -b $BRANCH \
+-e "$ENV"  --project-version $VERSION --project-milestone "$VERSION 
$MILESTONE" \
+--project-date $PJDATE --project-revision $RELEASE-$REVISION $OPT 
$TEST_PLAN --verbose
+ done
+   done
+   #echo " TEST RUNS COMPLETED FOR - $1 - #"
+   #echo "."
+
+}
+
+create_yocto(){
+   #BSP MANUALS
+   ENVIRONMETS=("Genericx86_MMAX32" "Genericx86-64_NUC" "Beaglebone-Black" 
"EdgeRouter" "MPC8315e-rdb")
+   EXECUTION_TYPE="MANUAL"
+   create_test_run "${1}" "BSP-MAN"
+
+   #QEMUs Manuals
+   ENVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64")
+   EXECUTION_TYPE="MANUAL"
+   create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
+
+   #QEMUs Autos
+   EVIRONMETS=("qemu-x86" "qemuarm" "qemuarm64" "qemumips" "qemumips64" 
"qemuppc" "qemux86-64" "qemux86-lsb" "qemux86_64-lsb")
+   ECUTION_TYPE="AUTO"
+   create_test_run "${1}" "core-image-sato-sdk_ANYQEMU"
+
+   #QEMUs Autos LSB
+   ENVIRONMETS=("qemux86-lsb" "qemux86_64-lsb")
+   EXECUTION_TYPE="AUTO"
+   create_test_run "${1}" "core-image-lsb-sdk_ANYQEMU"
+
+   #BSP Autos
+   ENVIRONMETS=("genericx86 - on MMAX32bit" "genericx86-64 on MMAX64" 
"genericx86-64 on NUC" "genericx86-64-WIC on MMAX64" \
+"genericx86-64-WIC on NUC" "genericx86-WIC on MMAX32"  
"MPC8315e-rdb" "Beaglebone Black" "EdgeRouter")
+   EXECUTION_TYPE="AUTO"
+   create_test_run "${1}" "core-image-sato-sdk_ANYBSP"
+
+   #BSP Autos
+   ENVIRONMETS=("genericx86-64-lsb on NUC" "genericx86-64-lsb on MMAX64" 
"genericx86-lsb on MMAX32bit")
+   EXECUTION_TYPE="AUTO"
+   create_test_run "${1}" "core-image-lsb-sdk_ANYBSP"
+
+}
+
+create_meta-intel(){
+   #BSP MANUALS
+   ENVIRONMETS=("core2-32_MMAX

[yocto] [qa-tools][PATCH] testopia_update: Improvements on update action functionality

2017-03-08 Thread jose . perez . carranza
From: Jose Perez Carranza 

Some improvements were applied when using option
action=create :

   - Create a new option to update test runs by ID
   - Create functions to load results and check missing test cases
   - Add warning to use –testrun-id
   - Improvements to update_test_run using exiting data of test run
   - Create function get test run details by ID
   - Create Dummy product to use on cases when specific product is not
 relevant

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py  | 60 +
 testopia_update/product/__init__.py | 17 +--
 2 files changed, 61 insertions(+), 16 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index 044074a..9cd9ad1 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -17,6 +17,29 @@ ACTIONS = ('create', 'update')
 BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists')
 CATEGORIES = ('AUTO', 'MANUAL')
 
+
+def check_missing_tc(env, build, test_run, results):
+missing = product.update_test_run(test_run, results)
+for tcid in missing:
+logger.warn("%s: Test run %d, Case %d wasn't updated" %
+(sys.argv[0], test_run['run_id'], tcid))
+
+
+def load_results(results_log):
+if not results_log:
+logger.error("%s: For action update --results-log needs to be 
specified"
+ % (sys.argv[0]))
+sys.exit(1)
+if not os.path.exists(args.results_log):
+logger.error("%s: Results log (%s) doesn't exists."
+ % (sys.argv[0], results_log))
+sys.exit(1)
+
+res = product.parse_results_log(args.results_log)
+
+return res
+
+
 def load_opts(args, opts_list, opts):
 for to in opts_list:
 if to in vars(args):
@@ -26,6 +49,9 @@ def load_opts(args, opts_list, opts):
 if not hasattr(opts, to):
 logger.error("%s: Requires testopia %s in arguments or config." % \
 (sys.argv[0], to))
+if args.action == "update":
+logger.warn('for action create you can use only --testrun-id ' 
+
+'and --results-log if test run was already 
created')
 sys.exit(1)
 
 class Options(object):
@@ -73,6 +99,9 @@ def get_args():
 parser.add_argument('--test-plan', required=False,
 dest="plan_name", help='Name of the test plan of the product, used 
when \
 test plan name is different from product 
name.')
+parser.add_argument('--testrun-id', required=False,
+dest="trun_id", help='Number of the test run to be updated, this \
+  option should be used along with update action.')
 
 parser.add_argument('--results-log', required=False,
 dest="results_log", help='Results log.')
@@ -131,6 +160,21 @@ if __name__ == '__main__':
 print("%s\n" % p.name)
 sys.exit(0)
 
+if args.action == 'update' and args.trun_id:
+args.product_name = 'Dummy'
+product = get_product_class(args.product_name, products)
+try:
+tr = product.get_existing_test_run(int(args.trun_id))
+except Exception as e:
+logger.error("%s: Problem found with Test Run %s: \n==>%s"
+ % (sys.argv[0], args.trun_id, e))
+sys.exit(1)
+
+results = load_results(args.results_log)
+check_missing_tc(tr['environment_id'], tr['build_id'], tr, results)
+
+sys.exit(0)
+
 load_opts(args, testopia_opts, opts)
 
 params = ['action', 'product_name', 'branch_name', 'env_name']
@@ -205,16 +249,8 @@ if __name__ == '__main__':
 " and ID (%s)." % (sys.argv[0], template_test_run['run_id'],
 test_run['summary'], test_run['run_id']))
 elif args.action == "update":
-if not args.results_log:
-logger.error("%s: For update --results-log needs to be specified." 
\
-% (sys.argv[0]))
-sys.exit(1)
-if not os.path.exists(args.results_log):
-logger.error("%s: Results log (%s) don't exists." \
-% (sys.argv[0], args.results_log))
-sys.exit(1)
+results = load_results(args.results_log)
 
-results = product.parse_results_log(args.results_log)
 test_run = product.get_test_run(test_plan, env, build, 
args.project_date,
 args.project_version, args.category_name, args.optional)
 if not test_run:
@@ -224,8 +

[yocto] [qa-tools][PATCH v2] testopia_update: Add option to define test plan

2017-03-07 Thread jose . perez . carranza
From: Jose Perez Carranza 

There are cases where the test plan and the product name are not equal hence
an option is added to handle those cases and define the test plan to work on.

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py  | 13 +---
 testopia_update/product/__init__.py | 40 -
 2 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index 9b35188..044074a 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -70,6 +70,9 @@ def get_args():
 dest="project_revision", help='SCM Revision of the project.')
 parser.add_argument('--project-date', required=False,
 dest="project_date", help='SCM version/revision date of the project.')
+parser.add_argument('--test-plan', required=False,
+dest="plan_name", help='Name of the test plan of the product, used 
when \
+test plan name is different from product 
name.')
 
 parser.add_argument('--results-log', required=False,
 dest="results_log", help='Results log.')
@@ -115,8 +118,12 @@ if __name__ == '__main__':
 if not os.path.exists(opts.store_location):
 os.makedirs(opts.store_location)
 
+kwargs = {}
+if args.plan_name:
+kwargs['plan_name'] = args.plan_name
+
 testopia = Testopia(opts.username, opts.password, opts.url, 
sslverify=False)
-products = get_products(testopia, opts, logger, config)
+products = get_products(testopia, opts, logger, config, **kwargs)
 
 if args.list_products:
 print("List of available products: \n")
@@ -141,8 +148,8 @@ if __name__ == '__main__':
 
 test_plan = product.get_test_plan(args.branch_name)
 if not test_plan:
-logger.error("%s: Test plan for product %s and branch %s not exists."\
- % (sys.argv[0], args.product_name, args.branch_name))
+logger.error("%s: Test plan %s for product %s and branch %s not 
exists."\
+ % (sys.argv[0], product.plan ,args.product_name, 
args.branch_name))
 
 sys.exit(1)
 
diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index e401824..18b112e 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -1,13 +1,17 @@
 import re
 
-
 class Product(object):
-def __init__(self, testopia, opts, logger, config):
+def __init__(self, testopia, opts, logger, config, **kwargs):
 self.testopia = testopia
 self.opts = opts
 self.logger = logger
 self.config = config
 
+if 'plan_name' in kwargs:
+self.plan = kwargs['plan_name']
+else:
+self.plan = self.name
+
 def support(self, name):
 if self.name == name:
 return True
@@ -16,11 +20,11 @@ class Product(object):
 def get_test_plan(self, branch_name):
 tp = None
 
-tp_name = '%s: %s branch' % (self.name, branch_name)
+tp_name = '%s: %s branch' % (self.plan, branch_name)
 
 tp = self.testopia.testplan_list(name=tp_name)
 if not tp:
-tp_alt_name = '%s: %s branch' % (self.name, branch_name.lower())
+tp_alt_name = '%s: %s branch' % (self.plan, branch_name.lower())
 tp = self.testopia.testplan_list(name=tp_alt_name)
 
 if tp:
@@ -68,7 +72,7 @@ class Product(object):
 category_name, optional):
 summary_alts = []
 summary_alts.append('%s_%s_%s_%s' % (ttype, project_version,
-category_name, self.name))
+category_name, self.plan))
 summary_alts.append('%s_%s_%s' % (ttype, project_version,
 category_name))
 summary_alts.append('%s_%s' % (ttype, category_name))
@@ -186,7 +190,7 @@ class Product(object):
 
 return missing
 
-def get_products(testopia, opts, config, logger):
+def get_products(testopia, opts, config, logger, **kwargs):
 
 
 from . import bitbake
@@ -204,18 +208,18 @@ def get_products(testopia, opts, config, logger):
 
 products = []
 
-products.append(bitbake.BitbakeProduct(testopia, opts, logger, config))
-products.append(bsp_qemu.BSPQEMUProduct(testopia, opts, logger, config))
-products.append(meta_yocto.MetaYoctoProduct(testopia, opts, logger, 
config))
-products.append(oe_core.OECoreProduct(testopia, opts, logger, config))
-products.append(runtime.RuntimeProduct(testopia, opts, logger, config))
-products.append(toaster.ToasterProduct(testopia, opts, logger, config))
-products.append(adt.ADTProduct(testopia, opts, logger, config))
-products.append(crops.CROPSProduct(testopia, opts, logger, confi

[yocto] [qa-tools][PATCH] testopia_update: Add option to define test plan

2017-03-06 Thread jose . perez . carranza
From: Jose Perez Carranza 

There are cases where the test plan and the product name are not equal hence
an option is added to handle those cases and define thetest plan to work on.

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py  | 11 +--
 testopia_update/product/__init__.py |  6 +++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index 9b35188..1dd40cd 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -70,6 +70,9 @@ def get_args():
 dest="project_revision", help='SCM Revision of the project.')
 parser.add_argument('--project-date', required=False,
 dest="project_date", help='SCM version/revision date of the project.')
+parser.add_argument('--test-plan', required=False,
+dest="plan_name", help='Name of the test plan of the product, used 
when \
+test plan name is different from product 
name.')
 
 parser.add_argument('--results-log', required=False,
 dest="results_log", help='Results log.')
@@ -139,10 +142,14 @@ if __name__ == '__main__':
 (sys.argv[0], args.product_name))
 sys.exit(1)
 
+product.plan = args.plan_name
+if not product.plan:
+product.plan = product.name
+
 test_plan = product.get_test_plan(args.branch_name)
 if not test_plan:
-logger.error("%s: Test plan for product %s and branch %s not exists."\
- % (sys.argv[0], args.product_name, args.branch_name))
+logger.error("%s: Test plan %s for product %s and branch %s not 
exists."\
+ % (sys.argv[0], product.plan ,args.product_name, 
args.branch_name))
 
 sys.exit(1)
 
diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index e401824..023fb02 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -16,11 +16,11 @@ class Product(object):
 def get_test_plan(self, branch_name):
 tp = None
 
-tp_name = '%s: %s branch' % (self.name, branch_name)
+tp_name = '%s: %s branch' % (self.plan, branch_name)
 
 tp = self.testopia.testplan_list(name=tp_name)
 if not tp:
-tp_alt_name = '%s: %s branch' % (self.name, branch_name.lower())
+tp_alt_name = '%s: %s branch' % (self.plan, branch_name.lower())
 tp = self.testopia.testplan_list(name=tp_alt_name)
 
 if tp:
@@ -68,7 +68,7 @@ class Product(object):
 category_name, optional):
 summary_alts = []
 summary_alts.append('%s_%s_%s_%s' % (ttype, project_version,
-category_name, self.name))
+category_name, self.plan))
 summary_alts.append('%s_%s_%s' % (ttype, project_version,
 category_name))
 summary_alts.append('%s_%s' % (ttype, category_name))
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 2/3] testopia_update: Add suppor for Testopia products

2017-02-22 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add a list of supported products currently available on Testopia

Signed-off-by: Jose Perez Carranza 
---
 testopia_update/product/__init__.py| 22 ++
 testopia_update/product/adt.py |  4 
 testopia_update/product/bitbake.py |  4 
 testopia_update/product/crops.py   |  4 
 testopia_update/product/eclipse_plugin.py  |  4 
 testopia_update/product/esdk.py|  4 
 testopia_update/product/general_runtime.py |  4 
 testopia_update/product/kernel.py  |  4 
 testopia_update/product/meta_yocto.py  |  4 
 testopia_update/product/oe_core.py |  4 
 testopia_update/product/runtime.py |  4 
 11 files changed, 62 insertions(+)
 create mode 100644 testopia_update/product/adt.py
 create mode 100644 testopia_update/product/bitbake.py
 create mode 100644 testopia_update/product/crops.py
 create mode 100644 testopia_update/product/eclipse_plugin.py
 create mode 100644 testopia_update/product/esdk.py
 create mode 100644 testopia_update/product/general_runtime.py
 create mode 100644 testopia_update/product/kernel.py
 create mode 100644 testopia_update/product/meta_yocto.py
 create mode 100644 testopia_update/product/oe_core.py
 create mode 100644 testopia_update/product/runtime.py

diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index d7cb984..e401824 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -187,13 +187,35 @@ class Product(object):
 return missing
 
 def get_products(testopia, opts, config, logger):
+
+
+from . import bitbake
+from . import meta_yocto
 from . import bsp_qemu
+from . import oe_core
+from . import runtime
 from . import toaster
+from . import adt
+from . import crops
+from . import eclipse_plugin
+from . import esdk
+from . import kernel
+from . import general_runtime
 
 products = []
 
+products.append(bitbake.BitbakeProduct(testopia, opts, logger, config))
 products.append(bsp_qemu.BSPQEMUProduct(testopia, opts, logger, config))
+products.append(meta_yocto.MetaYoctoProduct(testopia, opts, logger, 
config))
+products.append(oe_core.OECoreProduct(testopia, opts, logger, config))
+products.append(runtime.RuntimeProduct(testopia, opts, logger, config))
 products.append(toaster.ToasterProduct(testopia, opts, logger, config))
+products.append(adt.ADTProduct(testopia, opts, logger, config))
+products.append(crops.CROPSProduct(testopia, opts, logger, config))
+products.append(eclipse_plugin.EclipePluginProduct(testopia, opts, logger, 
config))
+products.append(esdk.eSDKProduct(testopia, opts, logger, config))
+products.append(kernel.KernelProduct(testopia, opts, logger, config))
+products.append(general_runtime.GeneralRuntimeProduct(testopia, opts, 
logger, config))
 
 return products
 
diff --git a/testopia_update/product/adt.py b/testopia_update/product/adt.py
new file mode 100644
index 000..73c82d3
--- /dev/null
+++ b/testopia_update/product/adt.py
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class ADTProduct(Product):
+name = 'ADT'
diff --git a/testopia_update/product/bitbake.py 
b/testopia_update/product/bitbake.py
new file mode 100644
index 000..6eef591
--- /dev/null
+++ b/testopia_update/product/bitbake.py
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class BitbakeProduct(Product):
+name = 'BitBake'
diff --git a/testopia_update/product/crops.py b/testopia_update/product/crops.py
new file mode 100644
index 000..90dcc69
--- /dev/null
+++ b/testopia_update/product/crops.py
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class CROPSProduct(Product):
+name = 'CROPS'
diff --git a/testopia_update/product/eclipse_plugin.py 
b/testopia_update/product/eclipse_plugin.py
new file mode 100644
index 000..a88ab8a
--- /dev/null
+++ b/testopia_update/product/eclipse_plugin.py
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class EclipePluginProduct(Product):
+name = 'Eclipse Plugin'
diff --git a/testopia_update/product/esdk.py b/testopia_update/product/esdk.py
new file mode 100644
index 000..8b004dd
--- /dev/null
+++ b/testopia_update/product/esdk.py
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class eSDKProduct(Product):
+name = 'eSDK'
diff --git a/testopia_update/product/general_runtime.py 
b/testopia_update/product/general_runtime.py
new file mode 100644
index 000..dac643e
--- /dev/null
+++ b/testopia_update/product/general_runtime.py
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class GeneralRuntimeProduct(Product):
+name = 'General Runtime'
diff --git a/testopia_update/product/kernel.py 
b/testopia_update/product/kernel.py
new file mode 100644
index 

[yocto] [qa-tools][PATCH 3/3] testopia_update: Fix options verification for config and params

2017-02-22 Thread jose . perez . carranza
From: Jose Perez Carranza 

A function was created to handle the load of options separately for
configuration and parameters

Signed-off-by: Anibal Limon 
Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py | 25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index 1c2db63..9b35188 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -17,6 +17,17 @@ ACTIONS = ('create', 'update')
 BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists')
 CATEGORIES = ('AUTO', 'MANUAL')
 
+def load_opts(args, opts_list, opts):
+for to in opts_list:
+if to in vars(args):
+arg = getattr(args, to)
+if arg:
+setattr(opts, to, arg)
+if not hasattr(opts, to):
+logger.error("%s: Requires testopia %s in arguments or config." % \
+(sys.argv[0], to))
+sys.exit(1)
+
 class Options(object):
 pass
 
@@ -85,7 +96,7 @@ if __name__ == '__main__':
 logger = logging.getLogger()
 
 testopia_config = ['url', 'username', 'password', 'store_location']
-testopia_opts = testopia_config + ['action', 'product_name', 
'category_name',
+testopia_opts = ['action', 'product_name', 'category_name',
 'project_version', 'project_milestone', 'project_revision',
 'project_date']
 
@@ -99,15 +110,7 @@ if __name__ == '__main__':
 
 for to in testopia_config:
 setattr(opts, to, config.get("Testopia", to))
-for to in testopia_opts:
-if to in vars(args):
-arg = getattr(args, to)
-if arg:
-setattr(opts, to, arg)
-if not hasattr(opts, to):
-logger.error("%s: Requires testopia %s in arguments or config." % \
-(sys.argv[0], to))
-sys.exit(1)
+load_opts(args, testopia_config, opts)
 
 if not os.path.exists(opts.store_location):
 os.makedirs(opts.store_location)
@@ -121,6 +124,8 @@ if __name__ == '__main__':
 print("%s\n" % p.name)
 sys.exit(0)
 
+load_opts(args, testopia_opts, opts)
+
 params = ['action', 'product_name', 'branch_name', 'env_name']
 for p in params:
 if not getattr(args, p):
-- 
2.1.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH 1/3] testopia_update/product: Fix regex to match test case id

2017-02-22 Thread jose . perez . carranza
From: Jose Perez Carranza 

Add space to the regex to match all the digits of the test case id

Signed-off-by: Jose Perez Carranza 
---
 testopia_update/product/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index 689d004..d7cb984 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -147,7 +147,7 @@ class Product(object):
 return new_test_run
 
 def parse_results_log(self, log_file):
-regex = "^.*RESULTS.*(?P\d+): (?PPASSED|FAILED)$"
+regex = "^.*RESULTS.* (?P\d+): (?PPASSED|FAILED)$"
 if hasattr(self, 'results_regex'):
 regex = getattr(self, 'results_regex')
 
-- 
2.1.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [qa-tools][PATCH V2] testopia-update: Add suport for current format of templates

2017-02-21 Thread jose . perez . carranza
From: Jose Perez Carranza 

Currently the tempates has a format as below:

TRTEMP

Hence the logic was adapted to follow above structure and also a
commit paramater was added to follow the format of build as follows:

RELEASE MILESTONE_rc#

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py  | 11 ++-
 testopia_update/product/__init__.py | 26 ++
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index 249d163..1c2db63 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -15,7 +15,7 @@ DEFAULT_STORE_LOCATION = "/tmp/testopia_update"
 
 ACTIONS = ('create', 'update')
 BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists')
-CATEGORIES = ('Full pass', 'Weekly')
+CATEGORIES = ('AUTO', 'MANUAL')
 
 class Options(object):
 pass
@@ -68,6 +68,7 @@ def get_args():
 parser.add_argument('--debug', required=False, action="store_true",
 dest="debug", default=False, help='Enable debug mode.')
 
+
 return parser.parse_args()
 
 if __name__ == '__main__':
@@ -87,7 +88,7 @@ if __name__ == '__main__':
 testopia_opts = testopia_config + ['action', 'product_name', 
'category_name',
 'project_version', 'project_milestone', 'project_revision',
 'project_date']
- 
+
 config = None
 if not args.config and os.path.exists(DEFAULT_CONFIG_FILE):
 args.config = DEFAULT_CONFIG_FILE
@@ -172,8 +173,8 @@ if __name__ == '__main__':
 sys.exit(1)
 
 if args.action == "create":
-template_test_run = product.get_template_test_run(test_plan, 
args.project_version,
-args.category_name, args.optional)
+template_test_run = product.get_template_test_run(test_plan,
+args.project_version, args.category_name, args.optional)
 if not template_test_run:
 logger.error("%s: Product %s can't find test run with: "\
 "%s, %s, %s." % (sys.argv[0], args.product_name,
@@ -189,7 +190,7 @@ if __name__ == '__main__':
 args.optional))
 sys.exit(1)
 logger.info("%s: Test run was created with Template (%d), Summary 
(%s)"\
-" and ID (%s)." % (sys.argv[0], template_test_run['run_id'], 
+" and ID (%s)." % (sys.argv[0], template_test_run['run_id'],
 test_run['summary'], test_run['run_id']))
 elif args.action == "update":
 if not args.results_log:
diff --git a/testopia_update/product/__init__.py 
b/testopia_update/product/__init__.py
index 04f9dac..689d004 100644
--- a/testopia_update/product/__init__.py
+++ b/testopia_update/product/__init__.py
@@ -1,5 +1,6 @@
 import re
 
+
 class Product(object):
 def __init__(self, testopia, opts, logger, config):
 self.testopia = testopia
@@ -45,8 +46,8 @@ class Product(object):
 def _format_build_name(self, project_version, project_revision):
 return "%s: %s" % (project_version, project_revision)
 
-def get_build(self, tp, project_version, project_milestone,
-project_revision, project_date):
+def get_build(self, tp, project_version, project_milestone, 
project_revision,
+  project_date):
 builds = self.testopia.product_get_builds(tp['product_id'])
 build_name = self._format_build_name(project_milestone, 
project_revision)
 for b in builds:
@@ -66,14 +67,14 @@ class Product(object):
 def _get_test_run_summary_alternatives(self, ttype, project_version,
 category_name, optional):
 summary_alts = []
-summary_alts.append('%s - %s - %s - %s' % (ttype, self.name,
-project_version, category_name))
-summary_alts.append('%s - %s - %s' % (ttype, project_version,
+summary_alts.append('%s_%s_%s_%s' % (ttype, project_version,
+category_name, self.name))
+summary_alts.append('%s_%s_%s' % (ttype, project_version,
 category_name))
-summary_alts.append('%s - %s' % (ttype, category_name))
-if optional: 
+summary_alts.append('%s_%s' % (ttype, category_name))
+if optional:
 for idx, sa in enumerate(summary_alts):
-summary_alts[idx] = sa + " - %s" % optional
+summary_alts[idx] = sa + "_%s" % optional
 return summary_alts
 
 def get_template_test_run(self, tp, project_version, category_name,
@@ -85,7 +86,7 @@ class Product(object):
  

[yocto] [PATCH] qa-tools: Add suport for current format of templates

2017-02-16 Thread jose . perez . carranza
From: Jose Perez Carranza 

Currently the tempates has a format as below:

TRTEMP

Hence the logic was adapted to follow above structure and also a
commit paramater was added to follow the format of build as follows:

RELEASE MILESTONE_rc#

Signed-off-by: Jose Perez Carranza 
---
 testopia_update.py  | 30 
 testopia_update/product/__init__.py | 39 +
 2 files changed, 40 insertions(+), 29 deletions(-)

diff --git a/testopia_update.py b/testopia_update.py
index 249d163..af281c9 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -15,7 +15,7 @@ DEFAULT_STORE_LOCATION = "/tmp/testopia_update"
 
 ACTIONS = ('create', 'update')
 BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists')
-CATEGORIES = ('Full pass', 'Weekly')
+CATEGORIES = ('AUTO', 'MANUAL')
 
 class Options(object):
 pass
@@ -60,6 +60,9 @@ def get_args():
 parser.add_argument('--project-date', required=False,
 dest="project_date", help='SCM version/revision date of the project.')
 
+parser.add_argument('--commit', required=False,
+dest="commit", help='Poky commit')
+
 parser.add_argument('--results-log', required=False,
 dest="results_log", help='Results log.')
 
@@ -68,6 +71,7 @@ def get_args():
 parser.add_argument('--debug', required=False, action="store_true",
 dest="debug", default=False, help='Enable debug mode.')
 
+
 return parser.parse_args()
 
 if __name__ == '__main__':
@@ -86,8 +90,8 @@ if __name__ == '__main__':
 testopia_config = ['url', 'username', 'password', 'store_location']
 testopia_opts = testopia_config + ['action', 'product_name', 
'category_name',
 'project_version', 'project_milestone', 'project_revision',
-'project_date']
- 
+'project_date','commit']
+
 config = None
 if not args.config and os.path.exists(DEFAULT_CONFIG_FILE):
 args.config = DEFAULT_CONFIG_FILE
@@ -103,10 +107,10 @@ if __name__ == '__main__':
 arg = getattr(args, to)
 if arg:
 setattr(opts, to, arg)
-if not hasattr(opts, to):
-logger.error("%s: Requires testopia %s in arguments or config." % \
-(sys.argv[0], to))
-sys.exit(1)
+#if not hasattr(opts, to):
+#logger.error("%s: Requires testopia %s in arguments or config." % 
\
+#(sys.argv[0], to))
+#sys.exit(1)
 
 if not os.path.exists(opts.store_location):
 os.makedirs(opts.store_location)
@@ -155,11 +159,13 @@ if __name__ == '__main__':
 sys.exit(1)
 
 build = product.get_build(test_plan, args.project_version,
-args.project_milestone, args.project_revision, args.project_date)
+args.project_milestone, args.project_revision, args.project_date,
+args.commit)
 if not build:
 if args.action == "create":
 build = product.create_build(test_plan, args.project_version,
-args.project_milestone, args.project_revision, 
args.project_date)
+args.project_milestone, args.project_revision, 
args.project_date,
+args.commit)
 logger.info("%s: Create build for product %s with: "\
 "%s, %s, %s, %s." % (sys.argv[0], args.product_name,
 args.project_version, args.project_milestone,
@@ -172,8 +178,8 @@ if __name__ == '__main__':
 sys.exit(1)
 
 if args.action == "create":
-template_test_run = product.get_template_test_run(test_plan, 
args.project_version,
-args.category_name, args.optional)
+template_test_run = product.get_template_test_run(test_plan,
+args.project_version, args.category_name, args.optional)
 if not template_test_run:
 logger.error("%s: Product %s can't find test run with: "\
 "%s, %s, %s." % (sys.argv[0], args.product_name,
@@ -189,7 +195,7 @@ if __name__ == '__main__':
 args.optional))
 sys.exit(1)
 logger.info("%s: Test run was created with Template (%d), Summary 
(%s)"\
-" and ID (%s)." % (sys.argv[0], template_test_run['run_id'], 
+" and ID (%s)." % (sys.argv[0], template_test_run['run_id'],
 test_run['summary'], test_run['run_id']))
 e