def testRemoveInvalidAddress(self): mac1 = self.safe_interfaces[0]['MACAddress'] tree = utils.callRpcCommand('netconf add %s %s %s %s' % (mac1, '192.168.42.1', '255.255.255.240', self.gw_set1), no_xml=True) result = utils.callRpcCommandError('netconf remove %s %s' % (mac1, '192.168.42.2')) nics = getSafeInterfaces() expected = [ { 'MACAddress': nics[0]['MACAddress'], 'IPAddress': ['192.168.42.1'], 'IPSubnet': ['255.255.255.240'], 'DefaultIPGateway': [self.gw_check1] }, { 'MACAddress': nics[1]['MACAddress'], 'IPAddress': [], 'DefaultIPGateway': [], 'IPSubnet': [] } ]
def testAddDuplicateAddress(self): mac1 = self.safe_interfaces[0]['MACAddress'] tree = utils.callRpcCommand( 'netconf add %s %s %s %s' % (mac1, '192.168.42.1', '255.255.255.240', self.gw_set1), no_xml=True) result = utils.callRpcCommandError( 'netconf add %s %s %s %s' % (mac1, '192.168.42.1', '255.255.255.240', self.gw_set1)) tree = utils.callRpcCommand( 'netconf add %s %s %s %s' % (mac1, '192.168.8.8', '255.255.255.0', self.gw_set2), no_xml=True) nics = getSafeInterfaces() expected = [{ 'MACAddress': nics[0]['MACAddress'], 'IPAddress': ['192.168.42.1', '192.168.8.8'], 'IPSubnet': ['255.255.255.240', '255.255.255.0'], 'DefaultIPGateway': [self.gw_check2, self.gw_check2] }, { 'MACAddress': nics[1]['MACAddress'], 'IPAddress': [], 'IPSubnet': [], 'DefaultIPGateway': [] }]
def testUpdateLowerVersion(self): tree = utils.callRpcCommand('updateModule systemstatus 100', files.module('xmlecho'), no_xml=True) utils.checkModuleAndVersion('systemstatus', 100) result = utils.callRpcCommandError('updateModule systemstatus 9', files.executable(isWindows(), 'xmlecho')) utils.checkModuleAndVersion('systemstatus', 100)
def testAddInvalidMac(self): result = utils.callRpcCommandError( 'netconf add FF-FF-CA-FE-BA-BE 192.168.42.1 255.255.255.240 192.168.42.14' )
def testGetInvalid(self): result = utils.callRpcCommandError( "modulemng get thismoduledoesnotexist")
def testGetInvalidMac(self): utils.callRpcCommandError('netconf get FF-FF-CA-FE-BA-BE')
def testUpdateSystemModule(self): result = utils.callRpcCommandError('updateModule modulemng 100000', files.executable(isWindows(), 'xmlecho'))
def testGetInvalid(self): result = utils.callRpcCommandError("modulemng get thismoduledoesnotexist")
def testRemoveSystemModule(self): result = utils.callRpcCommandError('remove usermodule modulemng')
def testInvalidBase64(self): result = utils.callRpcCommandError('updateModule systemstatus 2', base64_body='ZHVt)bVudAo=')
def testExecInternalModule(self): result = utils.callRpcCommandError("exec script modulemng list")
def testAddInvalidMac(self): result = utils.callRpcCommandError('netconf add FF-FF-CA-FE-BA-BE 192.168.42.1 255.255.255.240 192.168.42.14')
def testNotExecutable(self): utils.uploadUserModule('upload3', files.executable(isWindows(), 'xmlecho')) result = utils.callRpcCommandError('upload3')
def testInvalidBase64(self): result = utils.callRpcCommandError('upload usermodule upload2', base64_body='ZHVt)bVudAo=')
def testReuploadModule(self): utils.uploadUserModule('upload1', 'dummy content') # uploading again should fail result = utils.callRpcCommandError('upload usermodule upload1', 'dummy content')
def testRemoveNonExistingModule(self): result = utils.callRpcCommandError( 'remove usermodule nonexistingmodule')
def testRemoveInvalidMac(self): result = utils.callRpcCommandError( 'netconf remove FF-FF-CA-FE-BA-BE 0.0.0.0')
def testUpdateNonExistingModule(self): result = utils.callRpcCommandError('updateModule nonexistingmodule 2', files.module('xmlecho'))
def testRemoveNonExistingModule(self): result = utils.callRpcCommandError('remove usermodule nonexistingmodule')
def testRemoveInvalidMac(self): result = utils.callRpcCommandError('netconf remove FF-FF-CA-FE-BA-BE 0.0.0.0')
def testExecPlugin(self): result = utils.callRpcCommandError("exec script systemstatus")