Skip to content

Commit

Permalink
Merge pull request #1092 from grycap/devel
Browse files Browse the repository at this point in the history
Fix/Iprove Kube conn
  • Loading branch information
micafer authored Nov 27, 2020
2 parents 092cb1c + 88f3374 commit 85956ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/unit/connectors/Kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def get_response(self, method, url, verify, headers, data):
resp.text = ('{"metadata": {"namespace":"namespace", "name": "name"}, "status": '
'{"phase":"Running", "hostIP": "158.42.1.1", "podIP": "10.0.0.1"}, '
'"spec": {"volumes": [{"persistentVolumeClaim": {"claimName" : "cname"}}]}}')
if url == "/api/v1/namespaces/infid":
resp.status_code = 200
elif method == "POST":
if url.endswith("/pods"):
resp.status_code = 201
Expand Down Expand Up @@ -142,7 +144,9 @@ def test_20_launch(self, save_data, requests):

requests.side_effect = self.get_response

res = kube_cloud.launch(InfrastructureInfo(), radl, radl, 1, auth)
inf = MagicMock(["id", "_lock", "add_vm"])
inf.id = "infid"
res = kube_cloud.launch(inf, radl, radl, 1, auth)
success, _ = res[0]
self.assertTrue(success, msg="ERROR: launching a VM.")
self.assertNotIn("ERROR", self.log.getvalue(), msg="ERROR found in log: %s" % self.log.getvalue())
Expand Down

0 comments on commit 85956ec

Please sign in to comment.