Skip to content

Commit

Permalink
Update security testcase
Browse files Browse the repository at this point in the history
Update scom address in reg security testcases to a known value

Change-Id: I9c15e2f07ec54a42e3b0279e5350bd82c07eadd0
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47118
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
Shakeebbk authored and sgupta2m committed Oct 4, 2017
1 parent ad463c9 commit 8ab85cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/build/security/securityRegListGen.py
Expand Up @@ -458,7 +458,7 @@ def s_table1_gen(id, table):
# write table 1 string
str_table1 = ""
for i,(key, value) in enumerate(table):
str_table1 += '{{0x%02x, 0x%02x}, 0x%02x}, ' % ((key & 0xFF00 >> 8),
str_table1 += '{{0x%02x, 0x%02x}, 0x%02x}, ' % (((key & 0xFF00) >> 8),
(key & 0x00FF),
value)
if(0 == ((i+1) % 4)):
Expand Down
7 changes: 5 additions & 2 deletions src/test/testcases/testSecurity.py
Expand Up @@ -56,6 +56,9 @@ def getmap(cmd):
# Number of random addresses for negative testcase
NUM_RANDOM_ADDR = 100000

WHITELISTED_REG_FOR_WRITE_TEST = "0x05013419"
BLACKLISTED_REG_FOR_READ_TEST = "0x07012316"

def main():
whitelist = getlist('-w')
whitelist_table1 = getmap('-W 1')
Expand Down Expand Up @@ -91,10 +94,10 @@ def main():
testScomUtil.getscom(0x0204001A)
print "getscom success testcase - passed"
# getscom failure
testScomUtil.getscom(eval(blacklist[0]), [0x00, 0x05, 0x00, 0x0B])
testScomUtil.getscom(eval(BLACKLISTED_REG_FOR_READ_TEST), [0x00, 0x05, 0x00, 0x0B])
print "getscom failure testcase - passed"
# putscom success
testScomUtil.putscom(eval(whitelist[0]), testScomUtil.getscom(eval(whitelist[0])))
testScomUtil.putscom(eval(WHITELISTED_REG_FOR_WRITE_TEST), testScomUtil.getscom(eval(WHITELISTED_REG_FOR_WRITE_TEST)))
print "putscom success testcase - passed"
# putscom failure
while(True):
Expand Down

0 comments on commit 8ab85cf

Please sign in to comment.