Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions zaza/openstack/charm_tests/nova/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,28 @@ def wait_for_nova_compute_count(expected_count):
class NovaCompute(NovaCommonTests):
"""Run nova-compute specific tests."""

def test_305_encrypted_ephemeral_fstab_options(self):
"""Verify encrypted ephemeral storage has a device timeout."""
config = zaza.model.get_application_config(
'nova-compute', model_name=self.model_name)
if not config['encrypt']['value']:
self.skipTest('Encrypted ephemeral storage is not enabled')

device_timeout = config['encrypt-device-timeout']['value']
command = (
"awk '$2 == \"/var/lib/nova/instances\" && "
"$4 ~ /comment=vaultlocker/ && "
"$4 ~ /x-systemd.device-timeout={}s/ {{found = 1}} "
"END {{exit !found}}' /etc/fstab".format(device_timeout))
for unit in zaza.model.get_units('nova-compute',
model_name=self.model_name):
result = zaza.model.run_on_unit(
unit.entity_id, command, model_name=self.model_name)
self.assertEqual(
int(result['Code']), 0,
'Missing vaultlocker timeout in /etc/fstab on {}: {}'.format(
unit.entity_id, result['Stderr']))

def test_311_pci_alias_config_compute(self):
"""Verify that the pci alias data is rendered properly.

Expand Down
Loading