vproc_testcase.py
1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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)