0 0 1
default
Jean-Francois Pieronne - 5 years ago 2014-10-20 18:21:30
jf.pieronne@laposte.net
Initial version of test_all.py
1 file changed with 72 insertions and 0 deletions:
↑ Collapse Diff ↑
 
new file 100755
1
 
import vms.psldef
2
 
import vms.dvidef
3
 
import vms.jpidef
4
 
import vms.quidef
5
 
import vms.lnmdef
6
 
import vms.rtl.lib
7
 
from vms.rtl.lib import getdvi, getsyi, getqui
8
 
from vms.rtl.lib import get_logical, set_logical, delete_logical
9
 
import vms.itemList
10
 
from vms.itemList import itemList
11
 

	
12
 
disk = "DSA0:"
13
 

	
14
 
other_node = "NODENAME"
15
 

	
16
 
print get_logical("SYS$LOGIN")
17
 

	
18
 
print set_logical("MY_LOG", "PYTHON TEST")
19
 
print get_logical("MY_LOG")
20
 

	
21
 
itmLst = [itemList(vms.lnmdef.LNM__STRING, "PYTHON A"),
22
 
          itemList(vms.lnmdef.LNM__STRING, "PYTHON B")]
23
 
print vms.rtl.lib.set_logical("MY_LOG", itmlst = itmLst)
24
 
print get_logical("MY_LOG", index=0)
25
 
print get_logical("MY_LOG", index=1)
26
 
print delete_logical("MY_LOG")
27
 

	
28
 
print getdvi(vms.dvidef.DVI__DEVCLASS, device_name=disk)
29
 
print getdvi(vms.dvidef.DVI__DEVCLASS, None, disk)
30
 
print getdvi(vms.dvidef.DVI__DEVTYPE, device_name=disk)
31
 
print getdvi(vms.dvidef.DVI__VPROT, device_name=disk)
32
 
print getdvi(vms.dvidef.DVI__OPCNT, device_name=disk)
33
 
print getdvi(vms.dvidef. DVI__ACPTYPE, device_name=disk)
34
 

	
35
 
try:
36
 
    print getdvi(vms.dvidef.DVI__OPCNT, device_name="UNKNOWN_DISK")
37
 
except VMSError, e:
38
 
    print e
39
 

	
40
 
print getsyi(vms.syidef.SYI__VERSION, 0, other_node)
41
 
print getsyi(vms.syidef.SYI__VERSION, 0, None)
42
 
print getsyi(vms.syidef.SYI__GALAXY_ID, 0)
43
 

	
44
 
x = getsyi(vms.syidef.SYI__VERSION, -1)
45
 
cont = True
46
 
while (cont):
47
 
    print x
48
 
    try:
49
 
        x = getsyi(vms.syidef.SYI__VERSION, x[3])
50
 
    except VMSError, e:
51
 
        print e
52
 
        cont = False
53
 

	
54
 
d = dir(vms.syidef)
55
 
d.sort()
56
 
for x in d:
57
 
    if x.isupper() and x[:5] == 'SYI__':
58
 
        try:
59
 
            r = getsyi(eval('vms.syidef.' + x))
60
 
            print x[5:], r[2] 
61
 
        except VMSError, e:
62
 
            print e
63
 

	
64
 
x = getqui(vms.quidef.QUI__DISPLAY_QUEUE, vms.quidef.QUI__QUEUE_NAME, None, '*')
65
 
cont = True
66
 
while (cont):
67
 
    print x
68
 
    try:
69
 
        x = getqui(vms.quidef.QUI__DISPLAY_QUEUE, vms.quidef.QUI__QUEUE_NAME, search_name='*')
70
 
    except VMSError, e:
71
 
        print e
72
 
        cont = False
0 comments (0 inline, 0 general)