Beispiel #1
0
 def test_x11_xpdyinfo(self):
     plugins = list_plugins()
     desired_plugins = ['x11']
     active_extensions = [
         e() for e in plugins.values() if e.get_name() in desired_plugins
     ]
     for tag in self.dockerfile_tags:
         dig = DockerImageGenerator(active_extensions, {}, tag)
         self.assertEqual(dig.build(), 0)
         self.assertEqual(dig.run(), 0)
Beispiel #2
0
 def test_return_code_multiple_extensions(self):
     plugins = list_plugins()
     desired_plugins = ['home', 'user']
     active_extensions = [
         e() for e in plugins.values() if e.get_name() in desired_plugins
     ]
     dig = DockerImageGenerator(active_extensions, {}, 'ubuntu:bionic')
     self.assertEqual(dig.build(), 0)
     self.assertEqual(dig.run('true'), 0)
     self.assertEqual(dig.run('false'), 1)
Beispiel #3
0
 def test_nvidia_glmark2(self):
     plugins = list_plugins()
     desired_plugins = [
         'x11', 'nvidia', 'user'
     ]  #TODO(Tfoote) encode the x11 dependency into the plugin and remove from test here
     active_extensions = [
         e() for e in plugins.values() if e.get_name() in desired_plugins
     ]
     for tag in self.dockerfile_tags:
         dig = DockerImageGenerator(active_extensions, {}, tag)
         self.assertEqual(dig.build(), 0)
         self.assertEqual(dig.run(), 0)
Beispiel #4
0
 def test_noexecute(self):
     dig = DockerImageGenerator([], {}, 'ubuntu:bionic')
     self.assertEqual(dig.build(), 0)
     self.assertEqual(dig.run('true', noexecute=True), 0)
Beispiel #5
0
 def test_return_code_no_extensions(self):
     dig = DockerImageGenerator([], {}, 'ubuntu:bionic')
     self.assertEqual(dig.build(), 0)
     self.assertEqual(dig.run('true'), 0)
     self.assertEqual(dig.run('false'), 1)
Beispiel #6
0
 def test_run_before_build(self):
     dig = DockerImageGenerator([], {}, 'ubuntu:bionic')
     self.assertEqual(dig.run('true'), 1)
     self.assertEqual(dig.build(), 0)
     self.assertEqual(dig.run('true'), 0)
Beispiel #7
0
 def test_network(self):
     dig = DockerImageGenerator([], {}, 'ubuntu:bionic')
     self.assertEqual(dig.build(), 0)
     networks = ['bridge', 'host', 'none']
     for n in networks:
         self.assertEqual(dig.run('true', network=n), 0)
Beispiel #8
0
 def test_device(self):
     dig = DockerImageGenerator([], {}, 'ubuntu:bionic')
     self.assertEqual(dig.build(), 0)
     self.assertEqual(dig.run('true', devices=['/dev/random']), 0)
     self.assertEqual(dig.run('true', devices=['/dev/does_not_exist']), 0)
Beispiel #9
0
 def test_no_x11_xpdyinfo(self):
     for tag in self.dockerfile_tags:
         dig = DockerImageGenerator([], {}, tag)
         self.assertEqual(dig.build(), 0)
         self.assertNotEqual(dig.run(), 0)
Beispiel #10
0
 def test_no_nvidia_glmark2(self):
     for tag in self.dockerfile_tags:
         dig = DockerImageGenerator([], {}, tag)
         self.assertEqual(dig.build(), 0)
         self.assertNotEqual(dig.run(), 0)