from sys                        import stdout
from TMCDB                      import MonitorCollector
from TMCDB                      import propertySerailNumber
from omniORB                    import any
import MonitorErrImpl
import MonitorErr
import time

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

try:
    tc =   simpleClient.getComponent('MC_TEST_PROPERTIES_COMPONENT')
    psns =[propertySerailNumber('doubleROProp',    ['1' ]),
           propertySerailNumber('floatROProp',     ['2' ]),
           propertySerailNumber('longROProp',      ['3' ]),
           propertySerailNumber('uLongROProp',     ['4' ]),
           propertySerailNumber('patternROProp',   ['5' ]),
           propertySerailNumber('stringROProp',    ['6' ]),
           propertySerailNumber('longLongROProp',  ['7' ]),
           propertySerailNumber('uLongLongROProp', ['8' ]),
           propertySerailNumber('booleanROProp',   ['9' ]),
           propertySerailNumber('doubleSeqROProp', ['10']),
           propertySerailNumber('floatSeqROProp',  ['11']),
           propertySerailNumber('longSeqROProp',   ['12']),
           propertySerailNumber('uLongSeqROProp',  ['13']),
           propertySerailNumber('booleanSeqROProp',['14']),
           propertySerailNumber('EnumTestROProp',  ['15']),
           propertySerailNumber('doubleRWProp',    ['16']),
from TMCDB import propertySerailNumber
import MonitorErrImpl
import MonitorErr

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

# Test Case 1: Register collocated device with multiple serial non registrable
#              Test EH(registerCollocatedMonitoredDeviceWithMultipleSerial): RegisteringDeviceProblem"
print "Test Case 1: Register collocated device with multiple serial non registrable"
print "--------------------------------------------"
try:
    psns = [
        propertySerailNumber('asds', ['12124']),
        propertySerailNumber('sdfsfs', ['3432535'])
    ]
    mc.registerCollocatedMonitoredDeviceWithMultipleSerial('FAKE_DEVICE', psns)
    print " TEST FAIL: FAKE_DEVICE registered"
except MonitorErr.RegisteringDeviceProblemEx, _ex:
    ex = MonitorErrImpl.RegisteringDeviceProblemExImpl(exception=_ex)
    ex.Print()
    print " TEST SUCCESS: FAKE_DEVICE not registered"

# Test Case 2: Register collocated device with multiple serial when property does not exist
#              Test EH(registerCollocatedMonitoredDeviceWithMultipleSerial): Property does not exist"
print "Test Case 2: Register collocated device with multiple serial when property does not exist"
print "--------------------------------------------"
try:
    mc.registerCollocatedMonitoredDeviceWithMultipleSerial('TEST_PS_1', psns)
Beispiel #3
0
from TMCDB import propertySerailNumber
from omniORB import any
import MonitorErrImpl
import MonitorErr
import time

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

# First test: Nominal test. Some data buffered and recovered
try:
    tc = simpleClient.getComponent('MC_TEST_COMPONENT')
    psns = [
        propertySerailNumber('doubleSeqProp', ['12124']),
        propertySerailNumber('doubleProp', ['3432535'])
    ]
    mc.registerMonitoredDeviceWithMultipleSerial('MC_TEST_COMPONENT', psns)
    tc.reset()
    mc.startMonitoring('MC_TEST_COMPONENT')
    time.sleep(2)
    mc.stopMonitoring('MC_TEST_COMPONENT')

except MonitorErr.RegisteringDeviceProblemEx, _ex:
    ex = MonitorErrImpl.RegisteringDeviceProblemExImpl(exception=_ex)
    ex.Print()

data = mc.getMonitorData()

# First log entry: Print results of the first part of the test
Beispiel #4
0
import time

# definition of in-test exceptions
class noDataException (Exception) : pass
class notNulDataException (Exception) : pass

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

# Test preparation
cname = 'MC_TEST_COMPONENT'
try:
    tc =   simpleClient.getComponent(cname)
    psns =[propertySerailNumber('doubleSeqProp', ['12124']),
           propertySerailNumber('doubleProp', ['3432535'])
           ]
    # doubleSeqProp component archive_max_int defined to 1 (MC_TEST_COMPONENT.xml)
    # doubleProp component archive_max_inta defined to 1 (MC_TEST_COMPONENT.xml)
    # longProp component archive_max_int defined to 1 (MC_TEST_COMPONENT.xml)
    # longSeqProp component archive_max_int defined to 1 (MC_TEST_COMPONENT.xml)
    # patternProp component archive_max_int defined to 1 (MC_TEST_COMPONENT.xml)
    mc.registerMonitoredDeviceWithMultipleSerial(cname, psns)
    print "Test preparation with SUCCESS"
except MonitorErr.RegisteringDeviceProblemEx, _ex:
    ex = MonitorErrImpl.RegisteringDeviceProblemExImpl(exception=_ex)
    ex.Print();
    print "Test preparation FAIL"
    
# Test Case 1: Verify static configuration of archive_max_int parameter
from TMCDB                      import MonitorCollector
from TMCDB                      import propertySerailNumber
import MonitorErrImpl
import MonitorErr

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

# Test Case 1: Register collocated device with multiple serial non registrable
#              Test EH(registerCollocatedMonitoredDeviceWithMultipleSerial): RegisteringDeviceProblem"
print "Test Case 1: Register collocated device with multiple serial non registrable"
print "--------------------------------------------"
try:
    psns =[propertySerailNumber('asds', ['12124']),propertySerailNumber('sdfsfs', ['3432535'])]
    mc.registerCollocatedMonitoredDeviceWithMultipleSerial('FAKE_DEVICE', psns)
    print " TEST FAIL: FAKE_DEVICE registered"
except MonitorErr.RegisteringDeviceProblemEx, _ex:
    ex = MonitorErrImpl.RegisteringDeviceProblemExImpl(exception=_ex)
    ex.Print();
    print " TEST SUCCESS: FAKE_DEVICE not registered"

# Test Case 2: Register collocated device with multiple serial when property does not exist
#              Test EH(registerCollocatedMonitoredDeviceWithMultipleSerial): Property does not exist"
print "Test Case 2: Register collocated device with multiple serial when property does not exist"
print "--------------------------------------------"
try:    
    mc.registerCollocatedMonitoredDeviceWithMultipleSerial('TEST_PS_1', psns)
    print " TEST FAIL: TEST_PS_1 registered"
except MonitorErr.RegisteringDeviceProblemEx, _ex:
Beispiel #6
0
from sys                        import exit
from TMCDB                      import MonitorCollector
from TMCDB                      import propertySerailNumber
from omniORB                    import any
import MonitorErrImpl
import MonitorErr
import time

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

try:
    tc =   simpleClient.getComponent('MC_TEST_PROPERTIES_COMPONENT')
    psns =[propertySerailNumber('doubleROProp',    ['1']),
           propertySerailNumber('floatROProp',     ['2']),
           propertySerailNumber('longROProp',      ['3']),
           propertySerailNumber('patternROProp',   ['4']),
           propertySerailNumber('stringROProp',    ['5']),
           propertySerailNumber('longLongROProp',  ['6']),
           propertySerailNumber('uLongLongROProp', ['7']),
           propertySerailNumber('doubleSeqROProp', ['8']),
           propertySerailNumber('floatSeqROProp',  ['9']),
           propertySerailNumber('longSeqROProp',   ['10']),
           propertySerailNumber('doubleRWProp',    ['11']),
           propertySerailNumber('floatRWProp',     ['12']),
           propertySerailNumber('longRWProp',      ['13']),
           propertySerailNumber('patternRWProp',   ['14']),
           propertySerailNumber('stringRWProp',    ['15']),
           propertySerailNumber('longLongRWProp',  ['16']),
from sys                        import stdout
from TMCDB                      import MonitorCollector
from TMCDB                      import propertySerailNumber
from omniORB                    import any
import MonitorErrImpl
import MonitorErr
import time

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

try:
    tc =   simpleClient.getComponent('MC_TEST_ALARMS_COMPONENT')
    psns =[propertySerailNumber('doubleROProp',    ['1' ]),
           propertySerailNumber('floatROProp',     ['2' ]),
           propertySerailNumber('longROProp',      ['3' ]),
           propertySerailNumber('uLongROProp',     ['4' ]),
           propertySerailNumber('longLongROProp',  ['5' ]),
           propertySerailNumber('uLongLongROProp', ['6' ]),
           propertySerailNumber('booleanROProp',   ['7' ]),
           propertySerailNumber('doubleSeqROProp', ['8' ]),
           propertySerailNumber('floatSeqROProp',  ['9' ]),
           propertySerailNumber('longSeqROProp',   ['10']),
           propertySerailNumber('uLongSeqROProp',  ['11']),
           propertySerailNumber('booleanSeqROProp',['12']),
           propertySerailNumber('EnumTestROProp',  ['13'])
        ]
    mc.registerMonitoredDeviceWithMultipleSerial('MC_TEST_ALARMS_COMPONENT', psns)
    tc.reset();
from sys import exit
from sys import stdout
from TMCDB import MonitorCollector
from TMCDB import propertySerailNumber
import MonitorErrImpl
import MonitorErr

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

try:
    print "DeviceWithSeqAndMultipleSerial"
    psns = [
        propertySerailNumber('ROdoubleSeqPM', ['12124']),
        propertySerailNumber('RWdoubleSeqPM', ['3432535'])
    ]
    mc.registerMonitoredDeviceWithMultipleSerial('AMSSEQ1', psns)
    mc.startMonitoring('AMSSEQ1')
except MonitorErr.RegisteringDeviceProblemEx, _ex:
    ex = MonitorErrImpl.RegisteringDeviceProblemExImpl(exception=_ex)
    ex.Print()

mc.stopMonitoring('AMSSEQ1')
mc.deregisterMonitoredDevice('AMSSEQ1')

#cleanly disconnect
simpleClient.releaseComponent(argv[1])
simpleClient.disconnect()
stdout.flush()
Beispiel #9
0
from sys import stdout
from TMCDB import MonitorCollector
from TMCDB import propertySerailNumber
from omniORB import any
import MonitorErrImpl
import MonitorErr
import time

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

try:
    tc = simpleClient.getComponent("MC_TEST_COMPONENT")
    psns = [propertySerailNumber("doubleSeqProp", ["12124"]), propertySerailNumber("doubleProp", ["3432535"])]
    mc.registerMonitoredDeviceWithMultipleSerial("MC_TEST_COMPONENT", psns)
    tc.reset()
    mc.startMonitoring("MC_TEST_COMPONENT")
    time.sleep(11)
    mc.suppress_archiving("MC_TEST_COMPONENT", "doubleSeqProp")
    mc.suppress_archiving("MC_TEST_COMPONENT", "doubleProp")
    time.sleep(11)
    mc.enable_archiving("MC_TEST_COMPONENT", "doubleSeqProp")
    mc.enable_archiving("MC_TEST_COMPONENT", "doubleProp")
    time.sleep(11)
    mc.stopMonitoring("MC_TEST_COMPONENT")
except MonitorErr.RegisteringDeviceProblemEx, _ex:
    ex = MonitorErrImpl.RegisteringDeviceProblemExImpl(exception=_ex)
    ex.Print()
Beispiel #10
0
from sys                        import exit
from TMCDB                      import MonitorCollector
from TMCDB                      import propertySerailNumber
from omniORB                    import any
import MonitorErrImpl
import MonitorErr
import time

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

try:
    tc =   simpleClient.getComponent('MC_TEST_ALARMS_COMPONENT')
    psns =[propertySerailNumber('doubleROProp',    ['1' ]),
           propertySerailNumber('floatROProp',     ['2' ]),
           propertySerailNumber('longROProp',      ['3' ]),
           propertySerailNumber('longLongROProp',  ['4' ]),
           propertySerailNumber('uLongLongROProp', ['5' ]),
           propertySerailNumber('doubleSeqROProp', ['6' ]),
           propertySerailNumber('floatSeqROProp',  ['7' ]),
           propertySerailNumber('longSeqROProp',   ['8'])
        ]
    mc.registerMonitoredDeviceWithMultipleSerial('MC_TEST_ALARMS_COMPONENT', psns)
    tc.reset();
    mc.startMonitoring('MC_TEST_ALARMS_COMPONENT')    
    time.sleep(1)
    tc.increase()
    time.sleep(1)
    tc.increase()
import MonitorErrImpl
import MonitorErr
import time

n_exec = int(argv[2])

for index_loop in range(0, n_exec):
    # Make an instance of the PySimpleClient
    simpleClient = PySimpleClient()

    mc = simpleClient.getComponent(argv[1])

    try:
        tc = simpleClient.getComponent('MC_TEST_ALARMS_COMPONENT')
        psns = [
            propertySerailNumber('doubleROProp', ['1']),
            propertySerailNumber('floatROProp', ['2']),
            propertySerailNumber('longROProp', ['3']),
            propertySerailNumber('uLongROProp', ['4']),
            propertySerailNumber('longLongROProp', ['5']),
            propertySerailNumber('uLongLongROProp', ['6']),
            propertySerailNumber('booleanROProp', ['7']),
            propertySerailNumber('doubleSeqROProp', ['8']),
            propertySerailNumber('floatSeqROProp', ['9']),
            propertySerailNumber('longSeqROProp', ['10']),
            propertySerailNumber('uLongSeqROProp', ['11']),
            propertySerailNumber('booleanSeqROProp', ['12']),
            propertySerailNumber('EnumTestROProp', ['13'])
        ]
        mc.registerMonitoredDeviceWithMultipleSerial(
            'MC_TEST_ALARMS_COMPONENT', psns)
Beispiel #12
0
from Acspy.Clients.SimpleClient import PySimpleClient
from sys                        import argv
from sys                        import exit
from TMCDB                      import MonitorCollector
from TMCDB                      import propertySerailNumber
import MonitorErrImpl
import MonitorErr

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

mc = simpleClient.getComponent(argv[1])

try:
    psns =[propertySerailNumber('ROdoubleSeqPM', ['12124']),propertySerailNumber('RWdoubleSeqPM', ['3432535'])]    
    mc.registerMonitoredDeviceWithMultipleSerial('AMSSEQ1', psns)    
    mc.startMonitoring('AMSSEQ1')    
except MonitorErr.RegisteringDeviceProblemEx, _ex:
    ex = MonitorErrImpl.RegisteringDeviceProblemExImpl(exception=_ex)
    ex.Print();   

mc.stopMonitoring('AMSSEQ1')
mc.deregisterMonitoredDevice('AMSSEQ1')


#cleanly disconnect
simpleClient.releaseComponent(argv[1])
simpleClient.disconnect()