Support lack of ephemeral volumes for baremetal
The agent driver in Ironic does not yet support ephemeral volumes.
This change allows tempest to test Ironic with the agent driver
by skipping ephemeral volume checks if the ephemeral volume size
is 0.
Change-Id: I9525d1c75007555d368a2aa66ab840f41b584a30
diff --git a/tempest/scenario/test_baremetal_basic_ops.py b/tempest/scenario/test_baremetal_basic_ops.py
index 9ad6bc4..efbf4ce 100644
--- a/tempest/scenario/test_baremetal_basic_ops.py
+++ b/tempest/scenario/test_baremetal_basic_ops.py
@@ -133,18 +133,23 @@
# the same size as our flavor definition.
eph_size = self.get_flavor_ephemeral_size()
self.assertIsNotNone(eph_size)
- self.verify_partition(vm_client, 'ephemeral0', '/mnt', eph_size)
+ if eph_size > 0:
+ preserve_ephemeral = True
- # Create the test file
- self.create_remote_file(vm_client, test_filename)
+ self.verify_partition(vm_client, 'ephemeral0', '/mnt', eph_size)
+ # Create the test file
+ self.create_remote_file(vm_client, test_filename)
+ else:
+ preserve_ephemeral = False
- # Rebuild and preserve the ephemeral partition
- self.rebuild_instance(True)
+ # Rebuild and preserve the ephemeral partition if it exists
+ self.rebuild_instance(preserve_ephemeral)
self.verify_connectivity()
# Check that we maintained our data
- vm_client = self.get_remote_client(self.instance)
- self.verify_partition(vm_client, 'ephemeral0', '/mnt', eph_size)
- vm_client.exec_command('ls ' + test_filename)
+ if eph_size > 0:
+ vm_client = self.get_remote_client(self.instance)
+ self.verify_partition(vm_client, 'ephemeral0', '/mnt', eph_size)
+ vm_client.exec_command('ls ' + test_filename)
self.terminate_instance()