vproc_testcase.py 1.77 KB

import os

print("--------------------testcase write value-------------------")
res = os.popen("/usr/bin/python2.7 vproc.py write --key=vaserver.va0.cameraname --value=name1").read();
print(res)

res = os.popen("/usr/bin/python2.7 vproc.py write --key=vaserver.license --value=1").read();
print(res)

res = os.popen("/usr/bin/python2.7 vproc.py write --key=vaserver.va1.cameraname --value=name2").read();
print(res)

print("--------------------testcase read value-------------------")
res = os.popen("/usr/bin/python2.7 vproc.py read --key=vaserver.va0.cameraname").read();
print(res)

print("--------------------testcase help, shoud print 3 times-------------------")
res = os.popen("/usr/bin/python2.7 vproc.py --help").read();
print(res)

res = os.popen("/usr/bin/python2.7 vproc.py read").read();
print(res)

res = os.popen("/usr/bin/python2.7 vproc.py").read();
print(res)

print("--------------------testcase read value, shoud print null-------------------")
res = os.popen("/usr/bin/python2.7 vproc.py read --key=vaserver.lalalal").read();
print(res)

print("--------------------testcase read value, shoud print invalid args 2 times-------------------")
res = os.popen("/usr/bin/python2.7 vproc.py write --key=vaserver --value=123").read();
print(res)

res = os.popen("/usr/bin/python2.7 vproc.py write --key=vaserver.fffff ").read();
print(res)

print("--------------------testcase lld, should print {{\"data\": [{{\"{#MACRONAME}}\": \"license\"}}, {{\"{{#MACRONAME}}\": \"va0\"}}, {{\"{{#MACRONAME}}\": \"va1\"}}]}}-------------------")
res = os.popen("/usr/bin/python2.7 vproc.py lld --path=vaserver --macro=MACRONAME").read();
print(res)


print("--------------------testcase remove items-------------------")
res = os.popen("/usr/bin/python2.7 vproc.py clean --path=vaserver.va0 ").read();
print(res)