yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-usb-hcd-xhci-test-add-a-test-for-ccid-hotplug.patch

26ba25
From b5a0b93a8a4bf1074456515a370e5e7a17de7272 Mon Sep 17 00:00:00 2001
26ba25
From: Serhii Popovych <spopovyc@redhat.com>
26ba25
Date: Mon, 9 Jul 2018 11:31:17 +0200
26ba25
Subject: [PATCH 201/268] usb-hcd-xhci-test: add a test for ccid hotplug
26ba25
MIME-Version: 1.0
26ba25
Content-Type: text/plain; charset=UTF-8
26ba25
Content-Transfer-Encoding: 8bit
26ba25
26ba25
RH-Author: Serhii Popovych <spopovyc@redhat.com>
26ba25
Message-id: <1531135878-18813-3-git-send-email-spopovyc@redhat.com>
26ba25
Patchwork-id: 81267
26ba25
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH v2 2/3] usb-hcd-xhci-test: add a test for ccid hotplug
26ba25
Bugzilla: 1556678
26ba25
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
26ba25
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
26ba25
RH-Acked-by: David Gibson <dgibson@redhat.com>
26ba25
26ba25
From: Marc-André Lureau <marcandre.lureau@redhat.com>
26ba25
26ba25
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
26ba25
Message-id: 20180531195119.22021-5-marcandre.lureau@redhat.com
26ba25
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
26ba25
(cherry picked from commit 1a3ff20e67330a15d62b00c2916e3541872103c0)
26ba25
Signed-off-by: Serhii Popovych <spopovyc@redhat.com>
26ba25
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
26ba25
Conflicts:
26ba25
	tests/usb-hcd-xhci-test.c
26ba25
26ba25
Due to disabled UAS that adds if/endif and comment line.
26ba25
---
26ba25
 tests/usb-hcd-xhci-test.c | 11 +++++++++++
26ba25
 1 file changed, 11 insertions(+)
26ba25
26ba25
diff --git a/tests/usb-hcd-xhci-test.c b/tests/usb-hcd-xhci-test.c
26ba25
index 192b7f7..8c3fb36 100644
26ba25
--- a/tests/usb-hcd-xhci-test.c
26ba25
+++ b/tests/usb-hcd-xhci-test.c
26ba25
@@ -37,6 +37,15 @@ static void test_usb_uas_hotplug(void)
26ba25
 }
26ba25
 #endif
26ba25
 
26ba25
+static void test_usb_ccid_hotplug(void)
26ba25
+{
26ba25
+    qtest_qmp_device_add("usb-ccid", "ccid", NULL);
26ba25
+    qtest_qmp_device_del("ccid");
26ba25
+    /* check the device can be added again */
26ba25
+    qtest_qmp_device_add("usb-ccid", "ccid", NULL);
26ba25
+    qtest_qmp_device_del("ccid");
26ba25
+}
26ba25
+
26ba25
 int main(int argc, char **argv)
26ba25
 {
26ba25
     int ret;
26ba25
@@ -48,6 +57,8 @@ int main(int argc, char **argv)
26ba25
 #if 0 /* Disabled for Red Hat Enterprise Linux 7 */
26ba25
     qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug);
26ba25
 #endif
26ba25
+    qtest_add_func("/xhci/pci/hotplug/usb-ccid", test_usb_ccid_hotplug);
26ba25
+
26ba25
     qtest_start("-device nec-usb-xhci,id=xhci"
26ba25
                 " -drive id=drive0,if=none,file=null-co://,format=raw");
26ba25
     ret = g_test_run();
26ba25
-- 
26ba25
1.8.3.1
26ba25