sbsv2/raptor/test/smoke_suite/filter_params.py
author Richard Taylor <richard.i.taylor@nokia.com>
Thu, 01 Apr 2010 11:47:09 +0100
branchwip
changeset 451 153129bf777e
child 452 80e69f7100f1
permissions -rw-r--r--
pass optional parameters to log filters from the command line

#
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description: 
#

from raptor_tests import SmokeTest

def run():
	
	t = SmokeTest()
	t.description = "Test the passing of parameters to log filters"
	
	command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel --filters="
	
	# no parameters means count all tags	
	t.name = "filter_params_all_tags"
	t.command = command + "FilterTagCounter"
	t.mustmatch_singleline = [
		"^info \d+ \d+",
		"^whatlog \d+ \d+",
		"^clean \d+ \d+"	
		]
	t.run()
	
	# empty parameter lists are valid
	t.name = "filter_params_all_tags2"
	t.command = command + "FilterTagCounter[]"
	t.run()
	
	# parameters mean report only those tags	
	t.name = "filter_params_info"
	t.command = command + "FilterTagCounter[info]"
	t.mustmatch_singleline = [
		"^info \d+ \d+"
		]
	t.mustnotmatch_singleline = [
		"^whatlog \d+ \d+",
		"^clean \d+ \d+"	
		]
	t.run()
	
	# multiple parameters are valid	
	t.name = "filter_params_info_clean"
	t.command = command + "FilterTagCounter[info,clean]"
	t.mustmatch_singleline = [
		"^info \d+ \d+",
		"^clean \d+ \d+"
		]
	t.mustnotmatch_singleline = [
		"^whatlog \d+ \d+"
		]
	t.run()
	
	# using the same filter with different parameters is valid
	t.name = "filter_params_info_clean2"
	t.command = command + "FilterTagCounter[info],FilterTagCounter[clean]"
	t.run()
	
	# using the same filter with the same parameters is valid too
	t.name = "filter_params_info_clean3"
	t.command = command + "FilterTagCounter[info,clean],FilterTagCounter[info,clean]"
	t.run()
	
	t.name = "filter_params"
	t.print_result()
	return t