From patchwork Wed Mar 10 17:29:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyman Huang X-Patchwork-Id: 12128897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50833C433E0 for ; Wed, 10 Mar 2021 18:01:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6F4F64FB2 for ; Wed, 10 Mar 2021 18:01:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6F4F64FB2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=chinatelecom.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK39f-00024J-2K for qemu-devel@archiver.kernel.org; Wed, 10 Mar 2021 13:01:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK2fK-0006Cp-L1 for qemu-devel@nongnu.org; Wed, 10 Mar 2021 12:30:34 -0500 Received: from prt-mail.chinatelecom.cn ([42.123.76.223]:51442 helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK2fB-0006Uc-E7 for qemu-devel@nongnu.org; Wed, 10 Mar 2021 12:30:33 -0500 HMM_SOURCE_IP: 172.18.0.48:64581.1501305303 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-125.69.43.3?logid-0f9132e31a8249f5bd425f9e1b7fbe7b (unknown [172.18.0.48]) by chinatelecom.cn (HERMES) with SMTP id 323C628008E; Thu, 11 Mar 2021 01:30:12 +0800 (CST) X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn Received: from ([172.18.0.48]) by App0024 with ESMTP id 0f9132e31a8249f5bd425f9e1b7fbe7b for qemu-devel@nongnu.org; Thu Mar 11 01:30:15 2021 X-Transaction-ID: 0f9132e31a8249f5bd425f9e1b7fbe7b X-filter-score: filter<0> X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.48 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: qemu-devel Subject: [PATCH] tests/migration: fix unix socket batch migration Date: Thu, 11 Mar 2021 01:29:55 +0800 Message-Id: X-Mailer: git-send-email 1.8.3.1 Received-SPF: pass client-ip=42.123.76.223; envelope-from=huangy81@chinatelecom.cn; helo=chinatelecom.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hyman , Eduardo Habkost , Cleber Rosa Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Hyman when execute the following test command: "guestperf-batch.py --dst-host localhost --transport unix ..." test aborts and error message as the following be throwed: "launching VM Failed: [Errno 98] Address already in use". The reason is that batch script use the same monitor socket in all test cases and do not remove the socket file. The second migration test will launch vm use the same socket file as the first, so we get the error message. To fix it, just remove the socket file each time we have done the migration test. Signed-off-by: Hyman --- tests/migration/guestperf/engine.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py index 83bfc3b..5189cf9 100644 --- a/tests/migration/guestperf/engine.py +++ b/tests/migration/guestperf/engine.py @@ -407,6 +407,13 @@ def run(self, hardware, scenario, result_dir=os.getcwd()): vcpu_timings = ret[2] if uri[0:5] == "unix:": os.remove(uri[5:]) + + if os.path.exists(srcmonaddr): + os.remove(srcmonaddr) + + if self._dst_host == "localhost" and os.path.exists(dstmonaddr): + os.remove(dstmonaddr) + if self._verbose: print("Finished migration")