weizhouapache commented on code in PR #11931:
URL: https://github.com/apache/cloudstack/pull/11931#discussion_r4398546542
##########
test/integration/smoke/test_volumes.py:
##########
@@ -1640,14 +1743,25 @@ def check_volume_encryption(self, virtual_machine,
volumes_count):
parser = etree.XMLParser(remove_blank_text=True)
virshxml_root = ET.fromstring(xml_as_str, parser=parser)
- encryption_format =
virshxml_root.findall(".devices/disk/encryption[@format='luks']")
- self.assertIsNotNone(encryption_format, "The volume encryption format
is not luks")
+ # RBD volumes are encrypted natively by librbd: <encryption
format='luks2' engine='librbd'>.
+ # Any other pool type keeps using qemu-native LUKS1: <encryption
format='luks'> (no engine).
+ encryption_format_value = 'luks2' if self.storage_pool_type == "RBD"
else 'luks'
+ encryption_format =
virshxml_root.findall(".devices/disk/encryption[@format='%s']" %
encryption_format_value)
+ self.assertIsNotNone(encryption_format, "The volume encryption format
is not %s" % encryption_format_value)
Review Comment:
addressed the line too
```
secret_type =
virshxml_root.findall(".devices/disk/encryption/secret[@type='passphrase']")
self.assertGreater(len(secret_type), 0,
"No encryption secret of type passphrase in the
domain XML of %s" % instance_name)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]