示例#1
0
 def testBadInstaller(self):
     device.GINSTALL = '/dev/null'
     inst = device.Installer('/dev/null', ioloop=self.io_loop)
     inst.Install(file_type='1 Firmware Upgrade Image',
                  target_filename='',
                  callback=self.install_callback)
     self.assertTrue(self.install_cb_called)
     self.assertEqual(self.install_cb_faultcode, 9002)
     self.assertTrue(self.install_cb_faultstring)
示例#2
0
 def testBadJffsInstaller(self):
     device.INSTALL_FIRMWARE_IMAGE = 'testdata/device/install_firmware'
     device.INSTALL_JFFS_IMAGE = '/dev/null'
     inst = device.Installer('/dev/null', ioloop=self.io_loop)
     inst.Install(file_type=device.FILETYPE_JFFS_IMAGE,
                  target_filename='',
                  callback=self.install_callback)
     self.assertTrue(self.install_cb_called)
     self.assertEqual(self.install_cb_faultcode, 9002)
     self.assertTrue(self.install_cb_faultstring)
示例#3
0
 def testInstallerFailed(self):
     device.GINSTALL = 'testdata/device/installer_fails'
     inst = device.Installer('testdata/device/imagefile',
                             ioloop=self.io_loop)
     inst.Install(file_type='1 Firmware Upgrade Image',
                  target_filename='',
                  callback=self.install_callback)
     self.wait()
     self.assertTrue(self.install_cb_called)
     self.assertEqual(self.install_cb_faultcode, 9002)
     self.assertTrue(self.install_cb_faultstring)
示例#4
0
 def testJffsInstallerFailed(self):
     device.INSTALL_JFFS_IMAGE = 'testdata/device/install_fails'
     inst = device.Installer('testdata/device/jffs.trx',
                             ioloop=self.io_loop)
     inst.Install(file_type=device.FILETYPE_JFFS_IMAGE,
                  target_filename='',
                  callback=self.install_callback)
     self.wait()
     self.assertTrue(self.install_cb_called)
     self.assertEqual(self.install_cb_faultcode, 9002)
     self.assertTrue(self.install_cb_faultstring)
示例#5
0
 def testInstallerStdout(self):
     device.GINSTALL = 'testdata/device/installer_128k_stdout'
     inst = device.Installer('testdata/device/imagefile',
                             ioloop=self.io_loop)
     inst.Install(file_type='1 Firmware Upgrade Image',
                  target_filename='',
                  callback=self.install_callback)
     self.wait()
     self.assertTrue(self.install_cb_called)
     self.assertEqual(self.install_cb_faultcode, 0)
     self.assertFalse(self.install_cb_faultstring)
     self.assertTrue(self.install_cb_must_reboot)
示例#6
0
 def testJffsInstallerStdout(self):
     device.INSTALL_JFFS_IMAGE = 'testdata/device/install_jffs'
     inst = device.Installer('testdata/device/jffs.tgz',
                             ioloop=self.io_loop)
     inst.Install(file_type=device.FILETYPE_JFFS_IMAGE,
                  target_filename='',
                  callback=self.install_callback)
     self.wait()
     self.assertTrue(self.install_cb_called)
     self.assertEqual(self.install_cb_faultcode, 0)
     self.assertFalse(self.install_cb_faultstring)
     self.assertTrue(self.install_cb_must_reboot)
示例#7
0
 def testFirmwareInstallerStdout(self):
     device.INSTALL_FIRMWARE_IMAGE = 'testdata/device/install_firmware'
     inst = device.Installer('testdata/device/firmware.trx',
                             ioloop=self.io_loop)
     inst.Install(file_type=device.FILETYPE_FIRMWARE_IMAGE,
                  target_filename='',
                  callback=self.install_callback)
     self.wait()
     self.assertTrue(self.install_cb_called)
     self.assertEqual(self.install_cb_faultcode, 0)
     self.assertFalse(self.install_cb_faultstring)
     self.assertTrue(self.install_cb_must_reboot)