Config-Drive happiness, minus smoketest
This commit is contained in:
1
Authors
1
Authors
@@ -16,6 +16,7 @@ Chiradeep Vittal <chiradeep@cloud.com>
|
||||
Chmouel Boudjnah <chmouel@chmouel.com>
|
||||
Chris Behrens <cbehrens@codestud.com>
|
||||
Christian Berendt <berendt@b1-systems.de>
|
||||
Christopher MacGown <chris@pistoncloud.com>
|
||||
Chuck Short <zulcss@ubuntu.com>
|
||||
Cory Wright <corywright@gmail.com>
|
||||
Dan Prince <dan.prince@rackspace.com>
|
||||
|
@@ -41,6 +41,7 @@ class SimpleScheduler(chance.ChanceScheduler):
|
||||
|
||||
def _schedule_instance(self, context, instance_id, *_args, **_kwargs):
|
||||
"""Picks a host that is up and has the fewest running instances."""
|
||||
|
||||
instance_ref = db.instance_get(context, instance_id)
|
||||
if (instance_ref['availability_zone']
|
||||
and ':' in instance_ref['availability_zone']
|
||||
|
@@ -162,6 +162,20 @@ class ComputeTestCase(test.TestCase):
|
||||
db.security_group_destroy(self.context, group['id'])
|
||||
db.instance_destroy(self.context, ref[0]['id'])
|
||||
|
||||
def test_create_instance_associates_config_drive(self):
|
||||
"""Make sure create associates a config drive."""
|
||||
|
||||
instance_id = self._create_instance(params={'config_drive': True,})
|
||||
|
||||
try:
|
||||
self.compute.run_instance(self.context, instance_id)
|
||||
instances = db.instance_get_all(context.get_admin_context())
|
||||
instance = instances[0]
|
||||
|
||||
self.assertTrue(instance.config_drive)
|
||||
finally:
|
||||
db.instance_destroy(self.context, instance_id)
|
||||
|
||||
def test_default_hostname_generator(self):
|
||||
cases = [(None, 'server_1'), ('Hello, Server!', 'hello_server'),
|
||||
('<}\x1fh\x10e\x08l\x02l\x05o\x12!{>', 'hello')]
|
||||
|
@@ -59,7 +59,7 @@ function run_tests {
|
||||
ERRSIZE=`wc -l run_tests.log | awk '{print \$1}'`
|
||||
if [ "$ERRSIZE" -lt "40" ];
|
||||
then
|
||||
cat run_tests.log
|
||||
echo cat run_tests.log
|
||||
fi
|
||||
fi
|
||||
return $RESULT
|
||||
|
Reference in New Issue
Block a user