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)
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)
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)
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)
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)
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)
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)