Beispiel #1
0
 def test_convert_environment(self):
     test = Container(self.docker, self.tpl.repositories)
     self.assertTrue(test.spec.get("env"))
     self.assertIsInstance(test.spec.get("env"), list)
     [env] = [x for x in test.spec.get("env") if x.get("name") == "VARTWO"]
     self.assertTrue(env)
     self.assertEqual(env.get("value"), 456)
Beispiel #2
0
 def test_get_image_artifact_with_custom_repo(self):
     cont = self.getContainerbyName("docker-container-with-custom-repo-artifact")
     test = Container(cont, self.tpl.repositories)
     self.assertEqual(test.spec.get("image"), "https://test.hub.com/myimage:v123")
     self.assertEqual(test.labels.get("app.kubernetes.io/version"), "v123")
Beispiel #3
0
 def test_get_image_artifact(self):
     cont = self.getContainerbyName("docker-container-with-artifact_bad_name")
     test = Container(cont, self.tpl.repositories)
     self.assertEqual(test.spec.get("image"), "myimage:v5000")
     self.assertEqual(test.labels.get("app.kubernetes.io/version"), "v5000")
Beispiel #4
0
 def test_get_image_property(self):
     test = Container(self.docker, self.tpl.repositories)
     self.assertEqual(test.spec.get("image"), "myimage:v123")
     self.assertEqual(test.labels.get("app.kubernetes.io/version"), "v123")
Beispiel #5
0
 def test_convert_entrypoint(self):
     test = Container(self.docker, self.tpl.repositories)
     self.assertTrue(test.spec.get("command"))
     self.assertIsInstance(test.spec.get("command"), list)
     self.assertEqual(test.spec.get("command")[0], "stress")
     self.assertEqual(test.spec.get("command")[2], "50")
Beispiel #6
0
 def test_drop_pod_option(self):
     test = Container(self.docker, self.tpl.repositories)
     self.assertTrue(self.docker.get_property_value("pid"))
     self.assertFalse(test.spec.get("pid"))
     self.assertIsNotNone(test.ports)
Beispiel #7
0
 def test_drop_swarm_option(self):
     test = Container(self.docker, self.tpl.repositories)
     self.assertTrue(self.docker.get_property_value("stop_signal"))
     self.assertFalse(test.spec.get("stop_signal"))