check ControllerImage objects for glance_image_id
diff --git a/xos/tosca/tests/observerImageTest.py b/xos/tosca/tests/observerImageTest.py
index 887b3af..65b2c69 100644
--- a/xos/tosca/tests/observerImageTest.py
+++ b/xos/tosca/tests/observerImageTest.py
@@ -27,14 +27,21 @@
self.run_model_policy()
+ # make sure a ControllerImages object was created
+ cims = ControllerImages.objects.filter(image=image)
+ assert(len(cims) == 1)
+
# first observer pass should make any necessary networks or ports
self.run_observer()
# reset the exponential backoff
image = self.assert_obj(Image, "testimg")
+ # make sure the ControllerImages object has its image_id filled in
cims = ControllerImages.objects.filter(image=image)
assert(len(cims) == 1)
+ assert(cims[0].glance_image_id is not None)
+ assert(cims[0].glance_image_id != "")
if __name__ == "__main__":
ObserverImageTest()
diff --git a/xos/tosca/tests/observertest.py b/xos/tosca/tests/observertest.py
index 32dcf24..e86cdb1 100644
--- a/xos/tosca/tests/observertest.py
+++ b/xos/tosca/tests/observertest.py
@@ -16,6 +16,9 @@
def __init__(self):
super(BaseObserverToscaTest, self).__init__()
+ def get_usable_deployment(self):
+ return "MyDeployment"
+
def ensure_observer_not_running(self):
ps_output = subprocess.Popen("ps -elfy", shell=True, stdout=subprocess.PIPE).stdout.read()
if "/opt/xos/xos-observer.py" in ps_output: