[libvirt] [PATCH rust 1/5] fix bug integration test with rust multithreading

Sahid Orentino Ferdjaoui sahid.ferdjaoui at canonical.com
Thu Jul 4 10:15:25 UTC 2019


The open_auth test cases were randomly failling. It seems that because
tests are executed in parallel if a sasl connection is open when an
other happen in same time from the same libvirt connection an error
happens: "Failed to start SASL negotiation: -4 (SASL(-4): no mechanism
available: No worthy mechs found)".

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui at canonical.com>
---
 tests/integration_qemu.rs | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/tests/integration_qemu.rs b/tests/integration_qemu.rs
index 49e07c4..7db43d5 100644
--- a/tests/integration_qemu.rs
+++ b/tests/integration_qemu.rs
@@ -89,6 +89,16 @@ fn test_create_storage_pool_and_vols() {
 #[test]
 #[ignore]
 fn test_connection_with_auth() {
+    // Rust is excecuting tests in parallel (threads), if a sasl
+    // connection is open when an other happen in same time from the
+    // same libvirt connection an error happens: "Failed to start SASL
+    // negotiation: -4 (SASL(-4): no mechanism available: No worthy
+    // mechs found)".
+    connection_with_auth_ok();
+    connection_with_auth_wrong();
+}
+
+fn connection_with_auth_ok() {
     fn callback(creds: &mut Vec<ConnectCredential>) {
         for cred in creds {
             match cred.typed {
@@ -118,10 +128,7 @@ fn test_connection_with_auth() {
     }
 }
 
-
-#[test]
-#[ignore]
-fn test_connection_with_auth_wrong() {
+fn connection_with_auth_wrong() {
     fn callback(creds: &mut Vec<ConnectCredential>) {
         for cred in creds {
             match cred.typed {
-- 
2.20.1




More information about the libvir-list mailing list