예제 #1
0
    def testDellFirmwareSearch(self):
        firmware.DellFirmwarePassword(
            owner='stub7',
            serial='stub',
            created_by=users.User('*****@*****.**'),
            password=str(uuid.uuid4()),
            platform_uuid='stub',
            hostname='host1').put()

        resp = self.testapp.get(
            '/search?search_type=dell_firmware&field1=owner&value1=stub7&json=1'
        )
        self.assertEqual(1, len(util.FromSafeJson(resp.body)['passphrases']))
예제 #2
0
  def testRetrieval(self):
    password = '******'
    hostname = 'host1'
    serial = 'SERIAL'
    firmware.DellFirmwarePassword(
        serial=serial, hostname=hostname, password=password, owner='stub7',
    ).put()

    resp = util.FromSafeJson(
        self.testapp.get('/dell_firmware/SERIAL', status=httplib.OK).body)

    self.assertEqual(password, resp['passphrase'])
    self.assertEqual(serial, resp['volume_uuid'])
예제 #3
0
 def _CreateNewSecretEntity(self, owner, target_id, secret):
   return firmware.DellFirmwarePassword(
       owner=owner,
       serial=target_id,
       password=str(secret))