Пример #1
0
 def Verify(self, images):
     verifications = []
     verify = Verify()
     verify.useTTY = False
     for image in images:
         args = self.Args()
         args.image = image
         verify.set_args(args)
         verifications.append({"Image": image, "Verification": verify.verify_dbus()})  # pylint: disable=no-member
     return json.dumps(verifications)
Пример #2
0
 def Verify(self, image):
     verifications = []
     verify = Verify()
     verify.useTTY = False
     args = self.Args()
     args.image = image
     verify.set_args(args)
     verifications.append({
         "Image": image,
         "Verification": verify.verify_dbus()
     })  #pylint: disable=no-member
     return json.dumps(verifications)
Пример #3
0
 def test_verify_docker_diff(self):
     with patch('Atomic.backendutils.BackendUtils.get_backend_and_image_obj') as mockobj:
         args = self.Args()
         args.storage = 'docker'
         args.image = 'docker.io/library/centos:centos7.0.1406'
         db = DockerBackend()
         db._inspect_image = MagicMock(return_value=local_centos_inspect_old)
         local_image_object = db.inspect_image(args.image)
         mockobj.return_value = (db, local_image_object)
         v = Verify()
         v.set_args(args)
         Image.remote_inspect = MagicMock(return_value=remote_centos_inspect_latest)
         self.assertNotEqual(v.verify_dbus(), docker_dbus_result)
Пример #4
0
 def test_verify_docker_diff(self):
     with patch('Atomic.backendutils.BackendUtils.get_backend_and_image_obj') as mockobj:
         args = self.Args()
         args.storage = 'docker'
         args.image = 'docker.io/library/centos:centos7.0.1406'
         db = DockerBackend()
         db._inspect_image = MagicMock(return_value=local_centos_inspect_old)
         local_image_object = db.inspect_image(args.image)
         mockobj.return_value = (db, local_image_object)
         v = Verify()
         v.set_args(args)
         Image.remote_inspect = MagicMock(return_value=remote_centos_inspect_latest)
         self.assertNotEqual(v.verify_dbus(), docker_dbus_result)
Пример #5
0
 def Verify(self, image, no_validate, verbose, storage):
     verifications = []
     verify = Verify()
     verify.useTTY = False
     args = self.Args()
     args.image = image
     args.verbose = verbose
     args.no_validate = no_validate
     args.storage = storage
     verify.set_args(args)
     verifications.append({"Image": image,
                           "Verification": verify.verify_dbus()}) #pylint: disable=no-member
     return json.dumps(verifications)