]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: add test for authenticating a https network disk
authorJonathon Jongsma <jjongsma@redhat.com>
Thu, 11 Aug 2022 20:08:13 +0000 (15:08 -0500)
committerJonathon Jongsma <jjongsma@redhat.com>
Tue, 19 Sep 2023 19:28:50 +0000 (14:28 -0500)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tests/qemunbdkitdata/disk-network-source-curl.args.disk1
tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.780
tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.782 [new file with mode: 0644]
tests/qemunbdkitdata/disk-network-source-curl.args.disk2
tests/qemunbdkitdata/disk-network-source-curl.args.disk2.pipe.784 [new file with mode: 0644]
tests/qemuxml2argvdata/disk-network-source-curl.x86_64-latest.args
tests/qemuxml2argvdata/disk-network-source-curl.xml

index fde6a4f5330f9b738503a1085100f67d82948705..d1288dd242e16d3c94db236de1cb8350bc20ca89 100644 (file)
@@ -3,5 +3,7 @@ nbdkit \
 --foreground curl \
 protocols=https \
 'url=https://https.example.org:8443/path/to/disk5.iso?foo=bar' \
-cookie=-779 \
+user=myname \
+password=-779 \
+cookie=-781 \
 sslverify=false
index 20af4ae383ed02ef6f0d71b5f7da46c0d7248e8b..ccdd4033fc96778e87cb5f439e5bf77ad24392cb 100644 (file)
@@ -1 +1 @@
-cookie1=cookievalue1; cookie2=cookievalue2
\ No newline at end of file
+iscsi-mycluster_myname-secret
\ No newline at end of file
diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.782 b/tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.782
new file mode 100644 (file)
index 0000000..20af4ae
--- /dev/null
@@ -0,0 +1 @@
+cookie1=cookievalue1; cookie2=cookievalue2
\ No newline at end of file
index 88c9fa35a101870181272b4ce4df2ab16174b162..f1d0e1929eb02702b4dd47083295098c62ca3638 100644 (file)
@@ -4,4 +4,4 @@ nbdkit \
 --readonly curl \
 protocols=http,https \
 url=http://http.example.org:8080/path/to/disk2.iso \
-cookie=-781
+cookie=-783
diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk2.pipe.784 b/tests/qemunbdkitdata/disk-network-source-curl.args.disk2.pipe.784
new file mode 100644 (file)
index 0000000..5c035e8
--- /dev/null
@@ -0,0 +1 @@
+cookie1=cookievalue1; cookie2=cookievalue2; cookie3=cookievalue3
\ No newline at end of file
index cb0e5a92ea288073e99b3a29c6e41b51e5a12969..f6ab5532cc810416d0fd9bc688550274125df72a 100644 (file)
@@ -32,9 +32,10 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"https","url":"https://https.example.org:8443/path/to/disk1.iso","cookie-secret":"libvirt-5-storage-httpcookie-secret0","node-name":"libvirt-5-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-5-format","read-only":true,"driver":"raw","file":"libvirt-5-storage"}' \
 -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","drive":"libvirt-5-format","id":"virtio-disk0","bootindex":1}' \
+-object '{"qom-type":"secret","id":"libvirt-4-storage-auth-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \
 -object '{"qom-type":"secret","id":"libvirt-4-storage-httpcookie-secret0","data":"BUU0KmnWfonHdjzhYhwVQZ5iTI1KweTJ22q8XWUVoBCVu1z70reDuczPBIabZtC3","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \
 -object '{"qom-type":"secret","id":"libvirt-4-format-encryption-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \
--blockdev '{"driver":"https","url":"https://https.example.org:8443/path/to/disk5.iso?foo=bar","sslverify":false,"cookie-secret":"libvirt-4-storage-httpcookie-secret0","node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"https","url":"https://https.example.org:8443/path/to/disk5.iso?foo=bar","username":"myname","password-secret":"libvirt-4-storage-auth-secret0","sslverify":false,"cookie-secret":"libvirt-4-storage-httpcookie-secret0","node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"luks","key-secret":"libvirt-4-format-encryption-secret0","file":"libvirt-4-storage"}' \
 -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x4","drive":"libvirt-4-format","id":"virtio-disk4"}' \
 -object '{"qom-type":"secret","id":"libvirt-3-storage-httpcookie-secret0","data":"BUU0KmnWfonHdjzhYhwVQZ5iTI1KweTJ22q8XWUVoBBv7TuTgTkyAyOPpC2P5qLbOIypLoHpppjz+u5O+X8oT+jA1m7q/OJQ8dk2EFD5c0A=","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \
index 1e50314abe8dcf3c91f95feddbadc69541f4fb7d..8c3982cd73adac1dc9ccda3afe258993542e0cf6 100644 (file)
@@ -59,6 +59,9 @@
         <encryption format='luks'>
           <secret type='passphrase' uuid='1148b693-0843-4cef-9f97-8feb4e1ae365'/>
         </encryption>
+        <auth username='myname'>
+          <secret type='iscsi' usage='mycluster_myname'/>
+        </auth>
       </source>
       <target dev='vde' bus='virtio'/>
     </disk>