diff options
author | Scott Moser <smoser@brickies.net> | 2017-11-29 15:26:38 -0500 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-11-29 15:26:38 -0500 |
commit | 88368f9851b29dddb5a12e4b21868cbdef906c5c (patch) | |
tree | bc82164948ace765b43dd2edbc7054331de2c7ca /tests/cloud_tests/instances/nocloudkvm.py | |
parent | 4964fb38f11c15ed119ff4c7f4379ae3c8785a9a (diff) | |
download | vyos-cloud-init-88368f9851b29dddb5a12e4b21868cbdef906c5c.tar.gz vyos-cloud-init-88368f9851b29dddb5a12e4b21868cbdef906c5c.zip |
tests: NoCloudKVMImage do not modify the original local cache image.
The NoCloudKVMImage.execute() would modify the image in /srv/citest
that meant that after the first time you ran a test, the image was
dirty.
The change here is to make the image operate on a qcow backed image.
Also modify Snapshot to then copy the qcow rather
than creating another chained qcow. The reason being that the image
might go away or change after the snapshot has been returned.
Also
* drop use of 'override_templates' which was only relevant to LXD.
* NoCloudKVM.create_image() returned an instance before
now it has create_instance which creates an instance.
* NoCloudKVMInstance has a 'disk' attribute separate from 'name'
Diffstat (limited to 'tests/cloud_tests/instances/nocloudkvm.py')
-rw-r--r-- | tests/cloud_tests/instances/nocloudkvm.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/cloud_tests/instances/nocloudkvm.py b/tests/cloud_tests/instances/nocloudkvm.py index cc825800..bc06a79e 100644 --- a/tests/cloud_tests/instances/nocloudkvm.py +++ b/tests/cloud_tests/instances/nocloudkvm.py @@ -25,12 +25,13 @@ class NoCloudKVMInstance(base.Instance): platform_name = "nocloud-kvm" _ssh_client = None - def __init__(self, platform, name, properties, config, features, - user_data, meta_data): + def __init__(self, platform, name, image_path, properties, config, + features, user_data, meta_data): """Set up instance. @param platform: platform object @param name: image path + @param image_path: path to disk image to boot. @param properties: dictionary of properties @param config: dictionary of configuration values @param features: dictionary of supported feature flags @@ -43,6 +44,7 @@ class NoCloudKVMInstance(base.Instance): self.pid = None self.pid_file = None self.console_file = None + self.disk = image_path super(NoCloudKVMInstance, self).__init__( platform, name, properties, config, features) @@ -145,7 +147,7 @@ class NoCloudKVMInstance(base.Instance): self.ssh_port = self.get_free_port() cmd = ['./tools/xkvm', - '--disk', '%s,cache=unsafe' % self.name, + '--disk', '%s,cache=unsafe' % self.disk, '--disk', '%s,cache=unsafe' % seed, '--netdev', ','.join(['user', 'hostfwd=tcp::%s-:22' % self.ssh_port, |