From 18458e8fd151dae14923b9b22c5ac4dd2ac8bd24 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 19 Mar 2018 12:51:20 +0100 Subject: [PATCH] tests: qemublock: Add test combining authentication and encryption iscsi and rbd support authentication of the connection. Combine it with encryption of qcow2. The top level disk image would generate the following '-drive' cmdline: -drive file=rbd:rbdpool/rbdimg:id=testuser-rbd:auth_supported=cephx\;none: mon_host=host1.example.com\;host2.example.com, file.password-secret=node-a-s-secalias,encrypt.format=luks, encrypt.key-secret=node-b-f-encalias,format=qcow2, if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- tests/qemublocktest.c | 1 + ...k-qcow2-backing-chain-encryption_auth.json | 51 +++++++++++++++++++ ...rk-qcow2-backing-chain-encryption_auth.xml | 40 +++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json create mode 100644 tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.xml diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 8c19b8ef49..f8ecbcc3d8 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -464,6 +464,7 @@ mymain(void) TEST_DISK_TO_JSON("file-qcow2-backing-chain-noopts"); TEST_DISK_TO_JSON("file-qcow2-backing-chain-unterminated"); TEST_DISK_TO_JSON("file-qcow2-backing-chain-encryption"); + TEST_DISK_TO_JSON("network-qcow2-backing-chain-encryption_auth"); cleanup: virHashFree(diskxmljsondata.schema); diff --git a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json new file mode 100644 index 0000000000..7e7a4e44f7 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json @@ -0,0 +1,51 @@ +{ + "node-name": "node-b-f", + "read-only": false, + "driver": "qcow2", + "encrypt": { + "format": "luks", + "key-secret": "node-b-f-encalias" + }, + "file": { + "driver": "rbd", + "pool": "rbdpool", + "image": "rbdimg", + "server": [ + { + "host": "host1.example.com", + "port": "0" + }, + { + "host": "host2.example.com", + "port": "0" + } + ], + "user": "testuser-rbd", + "node-name": "node-a-s", + "read-only": false, + "discard": "unmap" + }, + "backing": "node-b-f" +} +{ + "node-name": "node-b-f", + "read-only": true, + "driver": "qcow2", + "encrypt": { + "format": "aes", + "key-secret": "node-b-f-encalias" + }, + "file": { + "driver": "iscsi", + "portal": "example.org:3260", + "target": "iqn.2016-09.com.example:iscsitarget", + "lun": 1, + "transport": "tcp", + "user": "testuser-iscsi", + "password-secret": "node-b-s-secalias", + "node-name": "node-b-s", + "read-only": true, + "discard": "unmap" + }, + "backing": null +} diff --git a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.xml b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.xml new file mode 100644 index 0000000000..bc2925b4cf --- /dev/null +++ b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +