示例#1
0
    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': []
            }
        ]
示例#2
0
    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': []
        }]
示例#3
0
    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)
示例#4
0
 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'
     )
示例#5
0
 def testGetInvalid(self):
     result = utils.callRpcCommandError(
         "modulemng get thismoduledoesnotexist")
示例#6
0
 def testGetInvalidMac(self):
     utils.callRpcCommandError('netconf get FF-FF-CA-FE-BA-BE')
示例#7
0
 def testUpdateSystemModule(self):
     result = utils.callRpcCommandError('updateModule modulemng 100000',
                                        files.executable(isWindows(), 'xmlecho'))
示例#8
0
 def testGetInvalid(self):
     result = utils.callRpcCommandError("modulemng get thismoduledoesnotexist")
示例#9
0
 def testRemoveSystemModule(self):
     result = utils.callRpcCommandError('remove usermodule modulemng')
示例#10
0
 def testInvalidBase64(self):
     result = utils.callRpcCommandError('updateModule systemstatus 2',
                                        base64_body='ZHVt)bVudAo=')
示例#11
0
 def testExecInternalModule(self):
     result = utils.callRpcCommandError("exec script modulemng list")
示例#12
0
 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')
示例#13
0
    def testNotExecutable(self):
        utils.uploadUserModule('upload3',
                               files.executable(isWindows(), 'xmlecho'))

        result = utils.callRpcCommandError('upload3')
示例#14
0
 def testRemoveSystemModule(self):
     result = utils.callRpcCommandError('remove usermodule modulemng')
示例#15
0
 def testInvalidBase64(self):
     result = utils.callRpcCommandError('upload usermodule upload2',
                                        base64_body='ZHVt)bVudAo=')
示例#16
0
    def testReuploadModule(self):
        utils.uploadUserModule('upload1', 'dummy content')

        # uploading again should fail
        result = utils.callRpcCommandError('upload usermodule upload1',
                                           'dummy content')
示例#17
0
 def testRemoveNonExistingModule(self):
     result = utils.callRpcCommandError(
         'remove usermodule nonexistingmodule')
示例#18
0
 def testRemoveInvalidMac(self):
     result = utils.callRpcCommandError(
         'netconf remove FF-FF-CA-FE-BA-BE 0.0.0.0')
示例#19
0
 def testUpdateNonExistingModule(self):
     result = utils.callRpcCommandError('updateModule nonexistingmodule 2',
                                        files.module('xmlecho'))
示例#20
0
 def testRemoveNonExistingModule(self):
     result = utils.callRpcCommandError('remove usermodule nonexistingmodule')
示例#21
0
 def testRemoveInvalidMac(self):
     result = utils.callRpcCommandError('netconf remove FF-FF-CA-FE-BA-BE 0.0.0.0')
示例#22
0
 def testExecPlugin(self):
     result = utils.callRpcCommandError("exec script systemstatus")
示例#23
0
 def testGetInvalidMac(self):
     utils.callRpcCommandError('netconf get FF-FF-CA-FE-BA-BE')