moved sample_vm directory under include dir. Added image/kernel/initrd declaration to config file. Updated glance tests to reference config variables for image/kernel/initrd
diff --git a/etc/config.ini.sample b/etc/config.ini.sample
index 7d90215..d5c59db 100644
--- a/etc/config.ini.sample
+++ b/etc/config.ini.sample
@@ -1,3 +1,8 @@
+[environment]
+kernel = include/sample_vm/vmlinuz-2.6.32-23-server
+initrd = include/sample_vm/initrd.img-2.6.32-23-server
+image = include/sample_vm/ubuntu-lucid.img
+
[swift]
auth_host = 10.0.0.100
auth_port = 443
@@ -29,4 +34,4 @@
port = 5000
apiver = v1.1
user = admin
-password = password
\ No newline at end of file
+password = password
diff --git a/sample_vm/README.txt b/include/sample_vm/README.txt
similarity index 100%
rename from sample_vm/README.txt
rename to include/sample_vm/README.txt
diff --git a/tests/996_test_glance.py b/tests/996_test_glance.py
index 333d147..fc8ce64 100644
--- a/tests/996_test_glance.py
+++ b/tests/996_test_glance.py
@@ -47,7 +47,7 @@
"""
Uploads a test kernal to glance api
"""
- kernel = "sample_vm/vmlinuz-2.6.32-23-server"
+ kernel = self.config['environment']['kernel']
if 'apiver' in self.glance:
path = "http://%s:%s/%s/images" % (self.glance['host'],
self.glance['port'], self.glance['apiver'])
@@ -77,7 +77,7 @@
"""
Uploads a test initrd to glance api
"""
- initrd = "sample_vm/initrd.img-2.6.32-23-server"
+ initrd = self.config['environment']['initrd']
if 'apiver' in self.glance:
path = "http://%s:%s/%s/images" % (self.glance['host'],
self.glance['port'], self.glance['apiver'])
@@ -110,7 +110,7 @@
links it to the initrd and kernel uploaded
earlier
"""
- image = "sample_vm/ubuntu-lucid.img"
+ image = self.config['environment']['image']
upload_data = ""
for chunk in self._read_in_chunks(image):
upload_data += chunk
@@ -168,7 +168,7 @@
test_005_set_image_meta_property.tags = ['glance']
def test_006_list_image_metadata(self):
- image = "sample_vm/ubuntu-lucid.img"
+ image = self.config['environment']['image']
if 'apiver' in self.glance:
path = "http://%s:%s/%s/images/%s" % (self.glance['host'],
self.glance['port'], self.glance['apiver'],
diff --git a/tests/__init__.py b/tests/__init__.py
index 515bfc3..8db7896 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -19,6 +19,7 @@
from hashlib import md5
import nose.plugins.skip
import os
+from pprint import pprint
import unittest2
from xmlrpclib import Server
@@ -90,6 +91,7 @@
self.keystone = KEYSTONE_DATA
self._parse_defaults_file()
+ pprint(self.config)
# Swift Setup
if 'swift' in self.config: