From patchwork Mon Jun 22 14:31:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191345 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1098434ile; Mon, 22 Jun 2020 07:34:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz29ZUY6xyQi+21sKHZfMvUyB+YYbfEoMSBvgWpjYpz5CGzzxL2qO+DtBtmlupZu8l6n5iD X-Received: by 2002:a25:1344:: with SMTP id 65mr27768518ybt.183.1592836473517; Mon, 22 Jun 2020 07:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836473; cv=none; d=google.com; s=arc-20160816; b=txVQxDn12Bk0S/ogD4m77PKqpvBCyqZWgd7uIJ6el/mN0UygT4wijPqcLWj+LVI5cn Ip5V3GprvbmpN1qrX+bSG1K4OzPklaXDjk11G5i4sRE4Bv0oHgHhFTW4Oewk6MapQ+2a hPxdCg1FvrgcJcguT3uj9gOP8amkKn87AtbLF6pA6KI+nCqJlRj5E8igB1wEV851gXLm 3O1okVLBdIprANq5RY7cWWwBHvQKhgJ2NOJrnHskWgLVpHiO9jOzusUrARB+L7Je2s/t sdHNxMwAP09HpJxoCM0klSZGf8bwSL+jgUUtBQ3FhYwJ09BI8MREq9kWEk/GvoHq/wIA n7jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=c2Ux+T+fS/HESUzVrNCO1n2kjnwyS/C8XASbbm6Vx/0=; b=TWDGmdj3FxSIT9/FpYXyrBy/HFZbLNoGIupY+A9Scq+o3vJVOsRv5h9Pvb2eMb833p 93M8AdGSNt9VlAV1zYQZvqDg3eKDE42O/PzH6ZIr1qgaBXGJAM+CB25PVd9yh7U17dwE VgLFqozzVSRXlT2/olbH7dv8d0Tstpkn5TuLDNc4woSCZ5k6Br0l1J2RuMs664NQO0Cg qdEZjnTZfngN/FwR2c7/GA6KuJcInc1aOx6CRz6w23om4n5w/xNB2tFYIfssjDjcjf3S Mi0lbSZyYSJnVwlyYR1/oVJfCjgq/0YgpixW5amr3RY6UNvaxIIk9+P+i6lVZr+hvHbF p1uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SiUJ905T; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f83si13977277ybg.22.2020.06.22.07.34.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SiUJ905T; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNWq-0008Gk-UI for patch@linaro.org; Mon, 22 Jun 2020 10:34:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUZ-0006mm-6N for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:12 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:41748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUW-0005dx-TZ for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:10 -0400 Received: by mail-wr1-x42a.google.com with SMTP id q2so14474522wrv.8 for ; Mon, 22 Jun 2020 07:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c2Ux+T+fS/HESUzVrNCO1n2kjnwyS/C8XASbbm6Vx/0=; b=SiUJ905Tp4BepS/nhSEDC8wpgQWD2B9BJWGJEInLKFctofPnZeoJqSoB1wyM3LzkJu iwTxDYqyvvB7FFfJF3Y6XZOuCLuRIaZysyfIWzX7rYaaY5EwbF7scQLhp4O6rtTOWBcF +a0q7MDtJym+hAHU7NhnvmsboLIudwNEaON3BQZCTIV5W7M6Vy0YS1aTFytNW4aiwLcZ I9gOzSGJ/1F/01faouW1Qo6c9zc5nLee92r2UDqLRGUy0yrz6vnbdpSNJ+rTyMmdFtqW IMSBXcIH3cTus08xv83hZinL+83PQruG+sqIUIFy4B5ynBIeUI0leuLA2QvcHOvgfJL8 xGfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c2Ux+T+fS/HESUzVrNCO1n2kjnwyS/C8XASbbm6Vx/0=; b=X4MUw7Q84jY6bcu7mAkDXO9grOFd43kWUZNCK5Xgglg/3r1pr5jR8gzvk89XVJXyIx y4Bb8L2HT1qIHSFDgCG7hqSXvDywy1spT+rSplxnIcOJwta2Grs0c+8oPtL5mIm96DVz Zf9R0Kzk+BZOiCIJ0B2tCbmC4+DrFJ7FsTzYzIjZbo8YklJvxcE+eq/Hyz6Deamevz82 YLdbVMfIMbNiRiAkjZcgg1eu67fo/76J6YUJ4aluu0E6WwBDPV7S4u+a7qcS7a3yl2Y8 O896FYFcuqk3LgNbDSfb+9LjCLXDXjKwNML80oemnKl0kK5sHmunY9pgbYItyH7+2mas 2e1Q== X-Gm-Message-State: AOAM531wJFXw7SiviLe94zdbqvXeSWK/wZtEGuNVHZ5OPPSixF9xvkP/ YjSZ+qzE5GPSw51WKvCLQwoXBQ== X-Received: by 2002:adf:ce8d:: with SMTP id r13mr17219444wrn.392.1592836326792; Mon, 22 Jun 2020 07:32:06 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a15sm20640436wrh.54.2020.06.22.07.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CD6D71FF87; Mon, 22 Jun 2020 15:32:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 01/18] iotests: Fix 051 output after qdev_init_nofail() removal Date: Mon, 22 Jun 2020 15:31:47 +0100 Message-Id: <20200622143204.12921-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, Kevin Wolf , Thomas Huth , berrange@redhat.com, "open list:Block layer core" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , richard.henderson@linaro.org, f4bug@amsat.org, Max Reitz , =?utf-8?q?Alex_Benn=C3=A9e?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Commit 96927c744 replaced qdev_init_nofail() call by isa_realize_and_unref() which has a different error message. Update the test output accordingly. Gitlab CI error after merging b77b5b3dc7: https://gitlab.com/qemu-project/qemu/-/jobs/597414772#L4375 Reported-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200616154949.6586-1-philmd@redhat.com> --- tests/qemu-iotests/051.pc.out | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: John Snow Reviewed-by: Thomas Huth diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index 0ea80d35f0e..da8ad871876 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -142,7 +142,7 @@ QEMU X.Y.Z monitor - type 'help' for more information Testing: -drive if=ide QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs media, but drive is empty +(qemu) QEMU_PROG: Device needs media, but drive is empty Testing: -drive if=virtio QEMU X.Y.Z monitor - type 'help' for more information @@ -214,7 +214,7 @@ QEMU X.Y.Z monitor - type 'help' for more information Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is read-only +(qemu) QEMU_PROG: Block node is read-only Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on QEMU X.Y.Z monitor - type 'help' for more information From patchwork Mon Jun 22 14:31:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191353 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1103702ile; Mon, 22 Jun 2020 07:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/UFiS0zRUegBdZZ0fbSxajH0ZnPV7UuattboxSDw+ZRvUEi5clympIkJlsnlU+axBa+zx X-Received: by 2002:a25:8404:: with SMTP id u4mr29371121ybk.515.1592836856687; Mon, 22 Jun 2020 07:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836856; cv=none; d=google.com; s=arc-20160816; b=EQFl5SdXN3YZSZj6bwVROowHwnSOwSdUh+mMIFO5BE5ohkfR3faKQKhOvrGuWjx3f5 7cZSdkZjOPNyTd8MOF3vgCZQG5PZKRGuJ5Vh0qy6OWGi/s6v/3s0kXn/rvC/fcn2wNzp 6ZnVZ8uAo/RucLDrUAlGfZN7NeMLBPqdLtRJV0fGPTdDtYPOzt29Wht/T4vGAIhieAhj EEBPQt3tKxgxhpqNxJNn0KCk8ETb88fr12x3CZZPfbIEvoN3ayDnwoGNQ07mCpPNtohC 7/XCIuLZnQMTZDbjdK0+uE1XxmDb6yiRfYWOMQKhWNd6H640RR1f23CXlMLPpp96dPYo V76A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=FL66FVyM4ucFlxEoT/6ZRqrVr318IjU8NLOuS9PY7cWsYYdjAu4odRpBaGGrHJ8LLl Z4s2WgJplJpe1062hV34F2FZZWTyzJMfRPVRGfTeu/B/JNy45K0mKb0A2NetaUpt7b8b MV/SlPVTGh3g6yxXrKwxCKpg8Dwwiyfg2oWbSb+n1S+VCfMeMxAf/lgSpQvS7FftkCzq 7ezbt6VHEdVDnPKxh3/R2vefKcepL8+JNv5C+cYZ/HSkSeogUUg2qiKmp54DqlnHQDkI 9fv52MPUaRj7lrWaITyA7Z89ggUWjel/xicGg90vDWtZupvDb7cQH+dj073oBJLuNVyB 672Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oGBYxPyO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a202si13647428ybg.327.2020.06.22.07.40.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oGBYxPyO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNd1-0001mm-UJ for patch@linaro.org; Mon, 22 Jun 2020 10:40:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUb-0006qX-6k for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:14 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:33186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUY-0005eM-SE for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:12 -0400 Received: by mail-wr1-x42f.google.com with SMTP id l11so16942630wru.0 for ; Mon, 22 Jun 2020 07:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=oGBYxPyOAYgmZ0GopkO8p/KIEz05emt4dkR/2HqeZUD9ZoWK0WNhvz/X9s35UsfWqB Vwfr8xkTrbh5gp3JaueBe1o2YJdiLPG8dUi5AnVFO0Q22/YPgedfBwP1XpES+PSIMyYA jUWj35azekwx7kmi1ymlx1SWiMl6d1XkjJlg6zTvPEHC2hPeoGsruXYf/CdcMNSKAUho nZJz4XYAl/QrUIZRWGj9hj2ZUWgyNhcEeL/H1Nf2vTmQIkpTA6ekErXYGUbDlnbu6po3 MIAAfB561yc969VzTB0gREPmg719VvcYY4WQ26SEqcm1K9DZohD4TtlpIfEEXNAeNVKo mOeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=aCYe/RYNpFKwKHVJm7u4xpGP9XYKVEju28X4aLaXbVHypDQaBeElsQBG3wEizwF+y5 LvSP+K0Akc2o8/jb2en2XoP8SEULTsjWWyItDyBaL2G9EH2HGGwFVhXor3BCdS5JpbVJ FWG2h4rD5fKsr9JmLoho8t3EYT7/4dSyZ32F5GOKq6Ds1wPDv6pHhmI7zjAKpDShmXU9 LYULQW/3xsplmll+tectQMemUgBvV6gSCQ4RAYNl0ztzQR0eb15QQthC2xWtX3SEw9Er 0RDnekTDW/Sa6GTj36lEBFUYdxElHHMr6t5xQUTtoUxHCfW35oJyb2g1u/Qu9wcyqoj/ Dp6g== X-Gm-Message-State: AOAM531dDH/3ib+6f6bspJnLLyr04M9OOEmUWxYCxkzLoCmgf+pQ8uLv eX01UzTgziJLMACIVJpY2M/68w== X-Received: by 2002:adf:e811:: with SMTP id o17mr5962257wrm.53.1592836329459; Mon, 22 Jun 2020 07:32:09 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o6sm18265567wrp.3.2020.06.22.07.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E3E571FF8C; Mon, 22 Jun 2020 15:32:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 02/18] tests/vm: pass args through to BaseVM's __init__ Date: Mon, 22 Jun 2020 15:31:48 +0100 Message-Id: <20200622143204.12921-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Adding the args parameter to BaseVM's __init__. We will shortly need to pass more parameters to the class so let's just pass args rather than growing the parameter list. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-2-robert.foley@linaro.org> --- tests/vm/basevm.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index a80b616a08d..5a58e6c3930 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -61,11 +61,10 @@ class BaseVM(object): # 4 is arbitrary, but greater than 2, # since we found we need to wait more than twice as long. tcg_ssh_timeout_multiplier = 4 - def __init__(self, debug=False, vcpus=None, genisoimage=None, - build_path=None): + def __init__(self, args): self._guest = None - self._genisoimage = genisoimage - self._build_path = build_path + self._genisoimage = args.genisoimage + self._build_path = args.build_path self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-", suffix=".tmp", dir=".")) @@ -78,7 +77,7 @@ class BaseVM(object): self._ssh_pub_key_file = os.path.join(self._tmpdir, "id_rsa.pub") open(self._ssh_pub_key_file, "w").write(SSH_PUB_KEY) - self.debug = debug + self.debug = args.debug self._stderr = sys.stderr self._devnull = open(os.devnull, "w") if self.debug: @@ -92,8 +91,8 @@ class BaseVM(object): (",ipv6=no" if not self.ipv6 else ""), "-device", "virtio-net-pci,netdev=vnet", "-vnc", "127.0.0.1:0,to=20"] - if vcpus and vcpus > 1: - self._args += ["-smp", "%d" % vcpus] + if args.jobs and args.jobs > 1: + self._args += ["-smp", "%d" % args.jobs] if kvm_available(self.arch): self._args += ["-enable-kvm"] else: @@ -456,8 +455,7 @@ def main(vmcls): return 1 logging.basicConfig(level=(logging.DEBUG if args.debug else logging.WARN)) - vm = vmcls(debug=args.debug, vcpus=args.jobs, - genisoimage=args.genisoimage, build_path=args.build_path) + vm = vmcls(args) if args.build_image: if os.path.exists(args.image) and not args.force: sys.stderr.writelines(["Image file exists: %s\n" % args.image, From patchwork Mon Jun 22 14:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191355 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1104863ile; Mon, 22 Jun 2020 07:42:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3x7w+VfhG/02I21p5KWKubvrZpbF5pR1YOOLmFpb6tFIGMPt+by8hgzu2uRdXyYBh88RN X-Received: by 2002:a25:20c4:: with SMTP id g187mr28748796ybg.347.1592836948806; Mon, 22 Jun 2020 07:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836948; cv=none; d=google.com; s=arc-20160816; b=LUeWb96eQhgXOc3BZOG8go5l7v/qc4IpmDYhl1vk4idae9eHM3mrikQ9JJ3nTIHfKz qVmEmvO7KFOWJXGnab/OE5tEX8vYufhB/Pga4AIdYdYuJsg2d21anfHzDQXOzyMRBGNR Dm2ymiD4XGWuffSru6/KRyPZgj9I+z1cBtUBoUYuOg0rx0G+2FEcBw7wtal3mRXPaXOg 6YT0zrClIfCATuA9BQ50uUe9EuCJaoclZkqdZ0KQocJOvk1qePc5DVzCQi6GGBPvj3bA PvQs9fDSht1pkWPpXA8digdSq8+eUi5ROCnlos97/UH5rNNms9VHmSMm9GQWa12wMsz2 wUDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Uqu+G7KWNLFFsBFSWuF2fzigErk1o01AVduM2CJF95Y=; b=dC6887kP1gohj8N/PpvVr5cRJzkyz9ooCxOmhp6Pk1xSjw/eB853xEs+sqmqf3nfra EQo9EY9jBfSdqzYKMWD8dd2yxNbEer40TiQ1goao5t6UA0q+DSAVX9799JAMhsZK+fvQ nbfJ1mz8WbESkgY5JTut7xvgozOcZRDLZqXodYraKugPH3M4rJf8odxDjy24FonHdJEZ jINISShD/2wgrl97kppGRt+MXM/+KYIDc9THKxkTQIUok11kSK+rhXpcdzgyrtiD1RwT tdDkbJSio3jH9RAFVX2YGTu1h6hzcQd0Flbeyb6h/Ml4ew5dN/gaLRcp7CDnjPvMCVLa KcIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sbnRHdlo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s6si12739693ybq.239.2020.06.22.07.42.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:42:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sbnRHdlo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNeW-0005o1-58 for patch@linaro.org; Mon, 22 Jun 2020 10:42:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUd-0006tm-Iy for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:15 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:36256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUa-0005eW-Sa for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:15 -0400 Received: by mail-wr1-x42d.google.com with SMTP id k6so4452863wrn.3 for ; Mon, 22 Jun 2020 07:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uqu+G7KWNLFFsBFSWuF2fzigErk1o01AVduM2CJF95Y=; b=sbnRHdloFlnP6e2dlUbwNezFOjToBjyM5/4MDayOl3y8lz9ZVNkGGXa1FRNZ86/pAZ pItxpPbBeNjMj34UX9yO6ARuuVqQjgC8YsRJTNfs5TYwUnESFwL74XTO0Kl+vhEeDN6V 1oiHfrbGQ+4QMXkNojdH+pXxW7ZKATsCxg75mYm8RQ0vXGIPzJ23BZ1B7vagOwc2xCb+ 1jDKeyBoGye8RV3QtsAqB3OB0LBnnbJAw6J+kR4kWzUE6HGYfOWPl4JTdS5Ldv/iQKtg bZn80fzU3keVltrvRgVB+nQ32oR1/yojHqwxO+Apqks232JzOidx+Z7nubGJ6qOF01hy ZCLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uqu+G7KWNLFFsBFSWuF2fzigErk1o01AVduM2CJF95Y=; b=lOK7ElB4qr7PdP8WEkrubFTVVVaXbqR4QoGdj5jawIjKxrNNCvwhdWg4GE4TUYfGwJ he5dJc3+9MaR7p3STBJITvRNcHDlNr100UQQ7Fkwbm5OP9TLpcEqWN0rb3qEtzmcuB5R uVg9WRHhDYs4PEdmpDLDFrTmz5onG0lsjBYOJyTUyPxk0JtVw7aN02Y0fEwon3EcfJrN F3D7oiA8pqOB6547aSCGt1VBeJ6QcKT2OihL+zQb6kbFMppht4gSCPzWYX1GMoyk8v2n 1WDO/hU22bcXHTgX4mkQkvwHJTtQfP7z9uDqullJYA6CzzAsV0t88YaaYlHriwP16zDq 7noQ== X-Gm-Message-State: AOAM531tj7CNDXUcu4PEukFvixTZhrGFOpwMuYj+U9BP7iaSX7AHzsTo t+zAH9Af5yxK3/BwSMqoCPxmDQ== X-Received: by 2002:a5d:4710:: with SMTP id y16mr19924700wrq.189.1592836331156; Mon, 22 Jun 2020 07:32:11 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y17sm18970877wrd.58.2020.06.22.07.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:08 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0566A1FF8F; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 03/18] tests/vm: Add configuration to basevm.py Date: Mon, 22 Jun 2020 15:31:49 +0100 Message-Id: <20200622143204.12921-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Added use of a configuration to tests/vm/basevm.py. The configuration provides parameters used to configure a VM. This allows for providing alternate configurations to the VM being created/launched. cpu, machine, memory, and NUMA configuration are all examples of configuration which we might want to vary on the VM being created or launched. This will for example allow for creating an aarch64 vm. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-3-robert.foley@linaro.org> --- tests/vm/basevm.py | 172 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 133 insertions(+), 39 deletions(-) -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5a58e6c3930..cfe20c58f7e 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -29,16 +29,41 @@ import tempfile import shutil import multiprocessing import traceback - -SSH_KEY = open(os.path.join(os.path.dirname(__file__), - "..", "keys", "id_rsa")).read() -SSH_PUB_KEY = open(os.path.join(os.path.dirname(__file__), - "..", "keys", "id_rsa.pub")).read() - +import shlex + +SSH_KEY_FILE = os.path.join(os.path.dirname(__file__), + "..", "keys", "id_rsa") +SSH_PUB_KEY_FILE = os.path.join(os.path.dirname(__file__), + "..", "keys", "id_rsa.pub") + +# This is the standard configuration. +# Any or all of these can be overridden by +# passing in a config argument to the VM constructor. +DEFAULT_CONFIG = { + 'cpu' : "max", + 'machine' : 'pc', + 'guest_user' : "qemu", + 'guest_pass' : "qemupass", + 'root_pass' : "qemupass", + 'ssh_key_file' : SSH_KEY_FILE, + 'ssh_pub_key_file': SSH_PUB_KEY_FILE, + 'memory' : "4G", + 'extra_args' : [], + 'qemu_args' : "", + 'dns' : "", + 'ssh_port' : 0, + 'install_cmds' : "", + 'boot_dev_type' : "block", + 'ssh_timeout' : 1, +} +BOOT_DEVICE = { + 'block' : "-drive file={},if=none,id=drive0,cache=writeback "\ + "-device virtio-blk,drive=drive0,bootindex=0", + 'scsi' : "-device virtio-scsi-device,id=scsi "\ + "-drive file={},format=raw,if=none,id=hd0 "\ + "-device scsi-hd,drive=hd0,bootindex=0", +} class BaseVM(object): - GUEST_USER = "qemu" - GUEST_PASS = "qemupass" - ROOT_PASS = "qemupass" envvars = [ "https_proxy", @@ -57,25 +82,38 @@ class BaseVM(object): poweroff = "poweroff" # enable IPv6 networking ipv6 = True + # This is the timeout on the wait for console bytes. + socket_timeout = 120 # Scale up some timeouts under TCG. # 4 is arbitrary, but greater than 2, # since we found we need to wait more than twice as long. tcg_ssh_timeout_multiplier = 4 - def __init__(self, args): + def __init__(self, args, config=None): self._guest = None self._genisoimage = args.genisoimage self._build_path = args.build_path + # Allow input config to override defaults. + self._config = DEFAULT_CONFIG.copy() + if config != None: + self._config.update(config) + self.validate_ssh_keys() self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-", suffix=".tmp", dir=".")) atexit.register(shutil.rmtree, self._tmpdir) - - self._ssh_key_file = os.path.join(self._tmpdir, "id_rsa") - open(self._ssh_key_file, "w").write(SSH_KEY) - subprocess.check_call(["chmod", "600", self._ssh_key_file]) - - self._ssh_pub_key_file = os.path.join(self._tmpdir, "id_rsa.pub") - open(self._ssh_pub_key_file, "w").write(SSH_PUB_KEY) + # Copy the key files to a temporary directory. + # Also chmod the key file to agree with ssh requirements. + self._config['ssh_key'] = \ + open(self._config['ssh_key_file']).read().rstrip() + self._config['ssh_pub_key'] = \ + open(self._config['ssh_pub_key_file']).read().rstrip() + self._ssh_tmp_key_file = os.path.join(self._tmpdir, "id_rsa") + open(self._ssh_tmp_key_file, "w").write(self._config['ssh_key']) + subprocess.check_call(["chmod", "600", self._ssh_tmp_key_file]) + + self._ssh_tmp_pub_key_file = os.path.join(self._tmpdir, "id_rsa.pub") + open(self._ssh_tmp_pub_key_file, + "w").write(self._config['ssh_pub_key']) self.debug = args.debug self._stderr = sys.stderr @@ -84,11 +122,14 @@ class BaseVM(object): self._stdout = sys.stdout else: self._stdout = self._devnull + netdev = "user,id=vnet,hostfwd=:127.0.0.1:{}-:22" self._args = [ \ - "-nodefaults", "-m", "4G", - "-cpu", "max", - "-netdev", "user,id=vnet,hostfwd=:127.0.0.1:0-:22" + - (",ipv6=no" if not self.ipv6 else ""), + "-nodefaults", "-m", self._config['memory'], + "-cpu", self._config['cpu'], + "-netdev", + netdev.format(self._config['ssh_port']) + + (",ipv6=no" if not self.ipv6 else "") + + (",dns=" + self._config['dns'] if self._config['dns'] else ""), "-device", "virtio-net-pci,netdev=vnet", "-vnc", "127.0.0.1:0,to=20"] if args.jobs and args.jobs > 1: @@ -99,6 +140,55 @@ class BaseVM(object): logging.info("KVM not available, not using -enable-kvm") self._data_args = [] + if self._config['qemu_args'] != None: + qemu_args = self._config['qemu_args'] + qemu_args = qemu_args.replace('\n',' ').replace('\r','') + # shlex groups quoted arguments together + # we need this to keep the quoted args together for when + # the QEMU command is issued later. + args = shlex.split(qemu_args) + self._config['extra_args'] = [] + for arg in args: + if arg: + # Preserve quotes around arguments. + # shlex above takes them out, so add them in. + if " " in arg: + arg = '"{}"'.format(arg) + self._config['extra_args'].append(arg) + + def validate_ssh_keys(self): + """Check to see if the ssh key files exist.""" + if 'ssh_key_file' not in self._config or\ + not os.path.exists(self._config['ssh_key_file']): + raise Exception("ssh key file not found.") + if 'ssh_pub_key_file' not in self._config or\ + not os.path.exists(self._config['ssh_pub_key_file']): + raise Exception("ssh pub key file not found.") + + def wait_boot(self, wait_string=None): + """Wait for the standard string we expect + on completion of a normal boot. + The user can also choose to override with an + alternate string to wait for.""" + if wait_string is None: + if self.login_prompt is None: + raise Exception("self.login_prompt not defined") + wait_string = self.login_prompt + # Intentionally bump up the default timeout under TCG, + # since the console wait below takes longer. + timeout = self.socket_timeout + if not kvm_available(self.arch): + timeout *= 8 + self.console_init(timeout=timeout) + self.console_wait(wait_string) + + def __getattr__(self, name): + # Support direct access to config by key. + # for example, access self._config['cpu'] by self.cpu + if name.lower() in self._config.keys(): + return self._config[name.lower()] + return object.__getattribute__(self, name) + def _download_with_cache(self, url, sha256sum=None, sha512sum=None): def check_sha256sum(fname): if not sha256sum: @@ -130,8 +220,9 @@ class BaseVM(object): "-t", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=" + os.devnull, - "-o", "ConnectTimeout=1", - "-p", self.ssh_port, "-i", self._ssh_key_file] + "-o", + "ConnectTimeout={}".format(self._config["ssh_timeout"]), + "-p", self.ssh_port, "-i", self._ssh_tmp_key_file] # If not in debug mode, set ssh to quiet mode to # avoid printing the results of commands. if not self.debug: @@ -180,14 +271,14 @@ class BaseVM(object): "virtio-blk,drive=%s,serial=%s,bootindex=1" % (name, name)] def boot(self, img, extra_args=[]): - args = self._args + [ - "-drive", "file=%s,if=none,id=drive0,cache=writeback" % img, - "-device", "virtio-blk,drive=drive0,bootindex=0"] - args += self._data_args + extra_args + boot_dev = BOOT_DEVICE[self._config['boot_dev_type']] + boot_params = boot_dev.format(img) + args = self._args + boot_params.split(' ') + args += self._data_args + extra_args + self._config['extra_args'] logging.debug("QEMU args: %s", " ".join(args)) qemu_path = get_qemu_path(self.arch, self._build_path) guest = QEMUMachine(binary=qemu_path, args=args) - guest.set_machine('pc') + guest.set_machine(self._config['machine']) guest.set_console() try: guest.launch() @@ -301,7 +392,8 @@ class BaseVM(object): self.console_send(command) def console_ssh_init(self, prompt, user, pw): - sshkey_cmd = "echo '%s' > .ssh/authorized_keys\n" % SSH_PUB_KEY.rstrip() + sshkey_cmd = "echo '%s' > .ssh/authorized_keys\n" \ + % self._config['ssh_pub_key'].rstrip() self.console_wait_send("login:", "%s\n" % user) self.console_wait_send("Password:", "%s\n" % pw) self.console_wait_send(prompt, "mkdir .ssh\n") @@ -360,23 +452,23 @@ class BaseVM(object): "local-hostname: {}-guest\n".format(name)]) mdata.close() udata = open(os.path.join(cidir, "user-data"), "w") - print("guest user:pw {}:{}".format(self.GUEST_USER, - self.GUEST_PASS)) + print("guest user:pw {}:{}".format(self._config['guest_user'], + self._config['guest_pass'])) udata.writelines(["#cloud-config\n", "chpasswd:\n", " list: |\n", - " root:%s\n" % self.ROOT_PASS, - " %s:%s\n" % (self.GUEST_USER, - self.GUEST_PASS), + " root:%s\n" % self._config['root_pass'], + " %s:%s\n" % (self._config['guest_user'], + self._config['guest_pass']), " expire: False\n", "users:\n", - " - name: %s\n" % self.GUEST_USER, + " - name: %s\n" % self._config['guest_user'], " sudo: ALL=(ALL) NOPASSWD:ALL\n", " ssh-authorized-keys:\n", - " - %s\n" % SSH_PUB_KEY, + " - %s\n" % self._config['ssh_pub_key'], " - name: root\n", " ssh-authorized-keys:\n", - " - %s\n" % SSH_PUB_KEY, + " - %s\n" % self._config['ssh_pub_key'], "locale: en_US.UTF-8\n"]) proxy = os.environ.get("http_proxy") if not proxy is None: @@ -447,15 +539,17 @@ def parse_args(vmcls): parser.disable_interspersed_args() return parser.parse_args() -def main(vmcls): +def main(vmcls, config=None): try: + if config == None: + config = {} args, argv = parse_args(vmcls) if not argv and not args.build_qemu and not args.build_image: print("Nothing to do?") return 1 logging.basicConfig(level=(logging.DEBUG if args.debug else logging.WARN)) - vm = vmcls(args) + vm = vmcls(args, config=config) if args.build_image: if os.path.exists(args.image) and not args.force: sys.stderr.writelines(["Image file exists: %s\n" % args.image, From patchwork Mon Jun 22 14:31:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191357 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1106776ile; Mon, 22 Jun 2020 07:45:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws+4i/zituRozg7x1tixCFq9nsu3PSg9D4dlxqlYtYi+6O44NsSiStGDC8FauXqx64HW+r X-Received: by 2002:a5b:c82:: with SMTP id i2mr26569041ybq.340.1592837105719; Mon, 22 Jun 2020 07:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592837105; cv=none; d=google.com; s=arc-20160816; b=URaaOggPWT3q2IO+FcfjAPwTapRyCAvHTa7Y7GOZWsBemiR63ng5Y4ACQ1+rkhA29w wzfIcS+zLnMRQv/7QwnCln07r9HTkh++5I/hx6zOn2JEv7JpcmWpPBGli/XC3l1O6BYr iJQXXxPJpVTzIqRcY1Rxs/ubI7p5nlWFWIlyFK7oXelVTrRm0e8PhfJyxa3azobC4X0A ez+2oN3yMfadagYRJsEF6pc3wnK7Nk4zVG8AMCrxKg0eBSGoZ4ntLRMjSGZ8JyON/u1c VV0Vq18RHyj6288cH8EN34/W3uiu2uRODSy/oHX9lLP1ypXxuKcokTQFxepWALn1Aw0x GJxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=pGIpjP7qRP3HOQlOwPPW1ES/n6FIPKIld3S95ijuCnE=; b=sZLzPw+sKuCDQb8+1U2fX55l82QzhUA1pdDz0T1wX8ZlzZxRSeId2ZkhtKUTCVJvOZ Ohka9CSbFfcRY1SR9paihx7ry61YCEG1+xv1uIIX+F8ssjeVoWjv6fPwCeT6z7eaJPjd UxHVKwDUZZHjN1kc14rQjqGeX4CVQJSfqOYSCaUZkcC9hPLgnIdTBSY+gPbjyZzImEDk YFAZoLVD5H51rTZ/yFOMbYEPANk3N6e0iDpVexgBjaJOGlvirwI/0y7wxotfCS3lX8ft JYH3ytBPqpejgkOk/qEFMsW2IfeWBn3dOSqUbQadGxaCab1p7MldMSxuld0JK1bSACk7 jaIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DZis4CAX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i127si16497105ybb.475.2020.06.22.07.45.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DZis4CAX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNh3-0000R5-55 for patch@linaro.org; Mon, 22 Jun 2020 10:45:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUh-0006wZ-Om for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:19 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUb-0005ec-OT for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:19 -0400 Received: by mail-wr1-x441.google.com with SMTP id a6so14952896wrm.4 for ; Mon, 22 Jun 2020 07:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pGIpjP7qRP3HOQlOwPPW1ES/n6FIPKIld3S95ijuCnE=; b=DZis4CAXG2iqBDuLCmUd6y2etihQE/tjUqAG8Xx6XP8Qukh0wUvytsE1ZbhLQW2pJs 8vGOyoxSUEHQH2kqaKJ+bSsd3FF4Tg1rT1dy/Bkkfk2jMFRTDieBxFxPwXueqEyALUeo EvJv5eELKXX7SCxy2WfCgw2U9phMe4aARedgwOf2buyvWzVt02mjcvFMkVzSCVEx6flH Eu8I0nRIytj1UcyqbSAw4OtRIHlmPB+tWCxF4Vlxu+oWLX9ubxSgk/XVZo/4uroVoqrU jVKOFBqCi4zcT2A5hqgnprR09J2g/sgHRLEnzprTPS9N1mjE5F4/MtWDhA4/0UE5ZYkn ECCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pGIpjP7qRP3HOQlOwPPW1ES/n6FIPKIld3S95ijuCnE=; b=nuCs5sQX2GbbMhbtkXgTgvZv+OUtElWgO/h+imP4ph/kLrh6YVxW0Rvatc8vSqeKkv MichJupaBIACwxTYcGsgO33qYUL7w+aljpFtKwwpQWAC5nbdfgZyQ9Vivb5hCRQUy3/M YVq7Z5MDND0aW7YEyl2c0P4j6ciiZseGvIqEL8OB2lOXN7YNqaZDf0NaUe68FYnSBQAF kRUBPL1sf9VMfWZtn2hElaERs4lCx179blYn2bxtPDP5p5GJckNg37web98NItHV3V0i nK8N4LAIS+1M0mpzzsLVWMjxq50CSQt4b2Gz5sULOIBjUc9IEIlfXXJKqrd2YUDDtFN+ IJpA== X-Gm-Message-State: AOAM533SQsZevLZ/E2lTdZkvoMLobq9JfES1JYwO5JxFg/Z4aAMVo6ST RHCrvZYuKkKE+KA/6a1TVO0sNg== X-Received: by 2002:adf:ded2:: with SMTP id i18mr19738123wrn.109.1592836332230; Mon, 22 Jun 2020 07:32:12 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w14sm18273942wrt.55.2020.06.22.07.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 22AC01FF90; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 04/18] tests/vm: Added configuration file support Date: Mon, 22 Jun 2020 15:31:50 +0100 Message-Id: <20200622143204.12921-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Changes to tests/vm/basevm.py to allow accepting a configuration file as a parameter. Allows for specifying VM options such as cpu, machine, memory, and arbitrary qemu arguments for specifying options such as NUMA configuration. Also added an example conf_example_aarch64.yml and conf_example_x86.yml. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-4-robert.foley@linaro.org> --- configure | 9 ++++++ tests/vm/Makefile.include | 6 ++++ tests/vm/basevm.py | 40 +++++++++++++++++++++++- tests/vm/conf_example_aarch64.yml | 51 +++++++++++++++++++++++++++++++ tests/vm/conf_example_x86.yml | 50 ++++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 tests/vm/conf_example_aarch64.yml create mode 100644 tests/vm/conf_example_x86.yml -- 2.20.1 diff --git a/configure b/configure index ba88fd18244..6d14f2c2d6c 100755 --- a/configure +++ b/configure @@ -958,6 +958,13 @@ do fi done +# Check for existence of python3 yaml, needed to +# import yaml config files into vm-build. +python_yaml="no" +if $(python3 -c "import yaml" 2> /dev/null); then + python_yaml="yes" +fi + : ${smbd=${SMBD-/usr/sbin/smbd}} # Default objcc to clang if available, otherwise use CC @@ -6751,6 +6758,7 @@ if test "$docs" != "no"; then echo "sphinx-build $sphinx_build" fi echo "genisoimage $genisoimage" +echo "python_yaml $python_yaml" echo "slirp support $slirp $(echo_version $slirp $slirp_version)" if test "$slirp" != "no" ; then echo "smbd $smbd" @@ -7830,6 +7838,7 @@ echo "PYTHON=$python" >> $config_host_mak echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak echo "GENISOIMAGE=$genisoimage" >> $config_host_mak +echo "PYTHON_YAML=$python_yaml" >> $config_host_mak echo "CC=$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then echo "IASL=$iasl" >> $config_host_mak diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index a253aba4579..f6c3892bb28 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -44,6 +44,12 @@ endif @echo " QEMU_LOCAL=1 - Use QEMU binary local to this build." @echo " QEMU=/path/to/qemu - Change path to QEMU binary" @echo " QEMU_IMG=/path/to/qemu-img - Change path to qemu-img tool" +ifeq ($(PYTHON_YAML),yes) + @echo " QEMU_CONFIG=/path/conf.yml - Change path to VM configuration .yml file." +else + @echo " (install python3-yaml to enable support for yaml file to configure a VM.)" +endif + @echo " See conf_example_*.yml for file format details." vm-build-all: $(addprefix vm-build-, $(IMAGES)) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index cfe20c58f7e..fa56fbbb4b6 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -481,7 +481,6 @@ class BaseVM(object): cwd=cidir, stdin=self._devnull, stdout=self._stdout, stderr=self._stdout) - return os.path.join(cidir, "cloud-init.iso") def get_qemu_path(arch, build_path=None): @@ -497,6 +496,41 @@ def get_qemu_path(arch, build_path=None): qemu_path = "qemu-system-" + arch return qemu_path +def parse_config(config, args): + """ Parse yaml config and populate our config structure. + The yaml config allows the user to override the + defaults for VM parameters. In many cases these + defaults can be overridden without rebuilding the VM.""" + if args.config: + config_file = args.config + elif 'QEMU_CONFIG' in os.environ: + config_file = os.environ['QEMU_CONFIG'] + else: + return config + if not os.path.exists(config_file): + raise Exception("config file {} does not exist".format(config_file)) + # We gracefully handle importing the yaml module + # since it might not be installed. + # If we are here it means the user supplied a .yml file, + # so if the yaml module is not installed we will exit with error. + try: + import yaml + except ImportError: + print("The python3-yaml package is needed "\ + "to support config.yaml files") + # Instead of raising an exception we exit to avoid + # a raft of messy (expected) errors to stdout. + exit(1) + with open(config_file) as f: + yaml_dict = yaml.safe_load(f) + + if 'qemu-conf' in yaml_dict: + config.update(yaml_dict['qemu-conf']) + else: + raise Exception("config file {} is not valid"\ + " missing qemu-conf".format(config_file)) + return config + def parse_args(vmcls): def get_default_jobs(): @@ -536,6 +570,9 @@ def parse_args(vmcls): help="run tests with a snapshot") parser.add_option("--genisoimage", default="genisoimage", help="iso imaging tool") + parser.add_option("--config", "-c", default=None, + help="Provide config yaml for configuration. "\ + "See config_example.yaml for example.") parser.disable_interspersed_args() return parser.parse_args() @@ -547,6 +584,7 @@ def main(vmcls, config=None): if not argv and not args.build_qemu and not args.build_image: print("Nothing to do?") return 1 + config = parse_config(config, args) logging.basicConfig(level=(logging.DEBUG if args.debug else logging.WARN)) vm = vmcls(args, config=config) diff --git a/tests/vm/conf_example_aarch64.yml b/tests/vm/conf_example_aarch64.yml new file mode 100644 index 00000000000..9d44ae356f7 --- /dev/null +++ b/tests/vm/conf_example_aarch64.yml @@ -0,0 +1,51 @@ +# +# Example yaml for use by any of the scripts in tests/vm. +# Can be provided as an environment variable QEMU_CONFIG +# +qemu-conf: + + # If any of the below are not provided, we will just use the qemu defaults. + + # Login username and password(has to be sudo enabled) + guest_user: qemu + guest_pass: "qemupass" + + # Password for root user can be different from guest. + root_pass: "qemupass" + + # If one key is provided, both must be provided. + #ssh_key: /complete/path/of/your/keyfile/id_rsa + #ssh_pub_key: /complete/path/of/your/keyfile/id_rsa.pub + + cpu: max + machine: virt,gic-version=max + memory: 16G + + # The below is a example for how to configure NUMA topology with + # 4 NUMA nodes and 2 different NUMA distances. + qemu_args: "-smp cpus=16,sockets=2,cores=8 + -numa node,cpus=0-3,nodeid=0 -numa node,cpus=4-7,nodeid=1 + -numa node,cpus=8-11,nodeid=2 -numa node,cpus=12-15,nodeid=3 + -numa dist,src=0,dst=1,val=15 -numa dist,src=2,dst=3,val=15 + -numa dist,src=0,dst=2,val=20 -numa dist,src=0,dst=3,val=20 + -numa dist,src=1,dst=2,val=20 -numa dist,src=1,dst=3,val=20" + + # By default we do not set the DNS. + # You override the defaults by setting the below. + #dns: 1.234.567.89 + + # By default we will use a "block" device, but + # you can also boot from a "scsi" device. + # Just keep in mind your scripts might need to change + # As you will have /dev/sda instead of /dev/vda (for block device) + boot_dev_type: "block" + + # By default the ssh port is not fixed. + # A fixed ssh port makes it easier for automated tests. + #ssh_port: 5555 + + # To install a different set of packages, provide a command to issue + #install_cmds: "apt-get update ; apt-get build-dep -y qemu" + + # Or to skip the install entirely, just provide "" + #install_cmds: "" diff --git a/tests/vm/conf_example_x86.yml b/tests/vm/conf_example_x86.yml new file mode 100644 index 00000000000..78d3f5830fa --- /dev/null +++ b/tests/vm/conf_example_x86.yml @@ -0,0 +1,50 @@ +# +# Example yaml for use by any of the x86 based scripts in tests/vm. +# Can be provided as an environment variable QEMU_CONFIG +# +qemu-conf: + + # If any of the below are not provided, we will just use the qemu defaults. + + # Login username and password(has to be sudo enabled) + guest_user: "qemu" + guest_pass: "qemupass" + + # Password for root user can be different from guest. + root_pass: "qemupass" + + # Provide default ssh keys of current user. + # You need to edit the below for your user. + #ssh_key_file: /home//.ssh/id_rsa + #ssh_pub_key_file: /home//.ssh/id_rsa.pub + + cpu: max + machine: pc + memory: 8G + + # The below is a example for how to configure NUMA topology with + # 4 NUMA nodes and 2 different NUMA distances. + qemu_args: "-smp cpus=8,sockets=2,cores=4 + -object memory-backend-ram,size=4G,policy=bind,host-nodes=0,id=ram-node0 + -object memory-backend-ram,size=4G,policy=bind,host-nodes=0,id=ram-node1 + -object memory-backend-ram,size=4G,policy=bind,host-nodes=1,id=ram-node2 + -object memory-backend-ram,size=4G,policy=bind,host-nodes=1,id=ram-node3 + -numa node,cpus=0-1,nodeid=0 -numa node,cpus=2-3,nodeid=1 + -numa node,cpus=4-5,nodeid=2 -numa node,cpus=6-7,nodeid=3 + -numa dist,src=0,dst=1,val=15 -numa dist,src=2,dst=3,val=15 + -numa dist,src=0,dst=2,val=20 -numa dist,src=0,dst=3,val=20 + -numa dist,src=1,dst=2,val=20 -numa dist,src=1,dst=3,val=20" + + # By default we do not set the DNS. + # You override the defaults by setting the below. + #dns: "1.234.567.89" + + # By default we will use a "block" device, but + # you can also boot from a "scsi" device. + # Just keep in mind your scripts might need to change + # As you will have /dev/sda instead of /dev/vda (for block device) + boot_dev_type: "block" + + # By default the ssh port is not fixed. + # A fixed ssh port makes it easier for automated tests. + ssh_port: 5555 From patchwork Mon Jun 22 14:31:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191344 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1097791ile; Mon, 22 Jun 2020 07:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZwA+P917Ek0HF1mlJLFjFStYFIHZwwVRh1s6bJCgcZXcWqRpZ3FU1iY4ex4Rc5KXSvtp2 X-Received: by 2002:a5b:b89:: with SMTP id l9mr27359902ybq.82.1592836424646; Mon, 22 Jun 2020 07:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836424; cv=none; d=google.com; s=arc-20160816; b=tSsbZQd5DH8eY8owSPOt+6J3lIho0W2172YYdZ+VHPSirvmUCTfeP5kKXE7LALzSZF ItvnE/V7o29K8QMYy7qrgssUIARXMCMEOsZFdFVozV62TL5opMz7FPz760yIobiODQ9l JV2WLKq6MVdGZ0yhTS9cHe/bzft4KI/xGq6btW5g2DNV0kxn98+u4axlvza9De0KG+zZ ddw6pYs60xWDnlTakWlTpy5bGyUHj4VJ7WKiB/sqKwI88+u3HJz674i1KM0IdXOYEBOx cT26ZJaS35n4xKqm2zP9jGZ1F2p+SsbFTGrUxN5tSemuM/QihVbgKatM+h556aQ+DTxN c7eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=yfaWvkBHiSQ15nCnLOaiCfwwNxNyBgCuiCJ/EYYdU+8=; b=TsCQ3dncAwCE/2iSL6rC8uTC3K1tjyjv0VlGDoqsx2cz8giIJplSFl1N+/bAQ+R2q/ d5q9x06sXR4QAOAwfZCe+Urq0BsyBjKgVMjFURSwNZVoRuBPRPJqvGkn4pd4LeUR1Boc HNJh40jOLeZV8xDUBl1Wm4jkowLCbhYnk1xyaXPR+6Oo9cAkigWYD8TG8JJG8fOUl3Oh 6bPjxoDd3AsTLx7qIz6uc5volq2DZ6NFHviAGWFeG5LooyqnqqkBOU5vVaEWLrgKhMH/ uCcH5VccirS2tq1pnw4H3bU62K6/BjozNF5ovDG1df0XSRUIl752PD57wIbVsy2z9tdg +YnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SEir2Ahm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o20si13330246ybg.371.2020.06.22.07.33.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SEir2Ahm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNW4-0006yw-1C for patch@linaro.org; Mon, 22 Jun 2020 10:33:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUg-0006vn-8p for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:18 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:33186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUd-0005eu-Sw for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:17 -0400 Received: by mail-wr1-x42e.google.com with SMTP id l11so16942929wru.0 for ; Mon, 22 Jun 2020 07:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yfaWvkBHiSQ15nCnLOaiCfwwNxNyBgCuiCJ/EYYdU+8=; b=SEir2Ahmo7Nd8yYiRd1WY5NTq6XP8EapsZxIfXHKNxxTIH4rVqBKKe+lqTPduXe/aB GJcuInCEAuGbIuxTUT5opCJYtM+gLX5EzbvZ8dpV0amp1aqGid/NT5xzD+8Fi59HZDkl c5fa6gQZQN4HdR9t8Tz7XpvW/wq6BNV2pN31BrmEq9fza7BZJb/C6lPG75LI1ZAJWzzM nOJV0oRsV/VCsqlpFyGN0aajuwrE7TYZGhkA3ejQUr7FRCRBArZuzScFX+ZqU/Ah8pft IRvEffzjCrM/aezdP+1Qjw7FXfCr3Sc2LeLgESQSEi+kVp4yA5b666OgwJQbR703zD3C ejEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yfaWvkBHiSQ15nCnLOaiCfwwNxNyBgCuiCJ/EYYdU+8=; b=DZdTIXg/HadSrWOkXeK4N+8BpYNumUfbXvvdDtkhq4EonSx4oTgxc3dzbgohVjDIfG 3qnQtTgAfUaf4xbI9o/Xshond5zCVTjBgnbtQxpLgXSmTgL7D9NatCJm/x3Js3sHL+bL ohxH2q9vSGQj5gToSqpJdUIJgdI7fXcLqXvTb7cQYVaI419iQDjOeZuu65lpSFmnFw5C 8irrZjIbk1gvr2Z3bkzZgbXiOS+DMY6Hq7ZiK9YufIWN9+ul1qfsGo/MeUcWzQrOccrJ PM/XlPiXNFba955y8miMxwarHGgPuXcWszDsH7j4LTlClpu9q6MMub9VBLs+Jq2zHHdF 55Eg== X-Gm-Message-State: AOAM533zpFlqyadootKqoMGUF7QcNFUYeeXyQsg4i/0tQeVoV6bGpQOP XvPBmQJQVTD3BbxO03NKAXUXISI4y20= X-Received: by 2002:a5d:4687:: with SMTP id u7mr4093252wrq.357.1592836334123; Mon, 22 Jun 2020 07:32:14 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v20sm18654864wrb.51.2020.06.22.07.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3BDB11FF91; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 05/18] tests/vm: Add common Ubuntu python module Date: Mon, 22 Jun 2020 15:31:51 +0100 Message-Id: <20200622143204.12921-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Add a common Ubuntu python module and make use of it with the ubuntu.i386 script. This is preparation for adding an Ubuntu script ubuntu.aarch64. Splitting out the common logic such as build_image() will reduce duplication. Signed-off-by: Robert Foley Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-5-robert.foley@linaro.org> --- tests/vm/ubuntu.i386 | 46 +++++++++------------------------ tests/vm/ubuntuvm.py | 60 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 34 deletions(-) create mode 100644 tests/vm/ubuntuvm.py -- 2.20.1 diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386 index 24527cc78c7..5ce72610a6c 100755 --- a/tests/vm/ubuntu.i386 +++ b/tests/vm/ubuntu.i386 @@ -11,15 +11,22 @@ # the COPYING file in the top-level directory. # -import os import sys -import subprocess import basevm -import time +import ubuntuvm -class UbuntuX86VM(basevm.BaseVM): +DEFAULT_CONFIG = { + 'install_cmds' : "apt-get update,"\ + "apt-get build-dep -y qemu,"\ + "apt-get install -y libfdt-dev language-pack-en", +} + +class UbuntuX86VM(ubuntuvm.UbuntuVM): name = "ubuntu.i386" arch = "i386" + image_link="https://cloud-images.ubuntu.com/releases/bionic/"\ + "release-20191114/ubuntu-18.04-server-cloudimg-i386.img" + image_sha256="28969840626d1ea80bb249c08eef1a4533e8904aa51a327b40f37ac4b4ff04ef" BUILD_SCRIPT = """ set -e; cd $(mktemp -d); @@ -29,34 +36,5 @@ class UbuntuX86VM(basevm.BaseVM): make --output-sync {target} -j{jobs} {verbose}; """ - def build_image(self, img): - cimg = self._download_with_cache( - "https://cloud-images.ubuntu.com/releases/bionic/release-20191114/ubuntu-18.04-server-cloudimg-i386.img", - sha256sum="28969840626d1ea80bb249c08eef1a4533e8904aa51a327b40f37ac4b4ff04ef") - img_tmp = img + ".tmp" - subprocess.check_call(["cp", "-f", cimg, img_tmp]) - self.exec_qemu_img("resize", img_tmp, "50G") - self.boot(img_tmp, extra_args = [ - "-device", "VGA", - "-cdrom", self.gen_cloud_init_iso() - ]) - self.wait_ssh() - self.ssh_root_check("touch /etc/cloud/cloud-init.disabled") - self.ssh_root_check("apt-get update") - self.ssh_root_check("apt-get install -y cloud-initramfs-growroot") - # Don't check the status in case the guest hang up too quickly - self.ssh_root("sync && reboot") - time.sleep(5) - self.wait_ssh() - # The previous update sometimes doesn't survive a reboot, so do it again - self.ssh_root_check("sed -ie s/^#\ deb-src/deb-src/g /etc/apt/sources.list") - self.ssh_root_check("apt-get update") - self.ssh_root_check("apt-get build-dep -y qemu") - self.ssh_root_check("apt-get install -y libfdt-dev language-pack-en") - self.ssh_root("poweroff") - self.wait() - os.rename(img_tmp, img) - return 0 - if __name__ == "__main__": - sys.exit(basevm.main(UbuntuX86VM)) + sys.exit(basevm.main(UbuntuX86VM, DEFAULT_CONFIG)) diff --git a/tests/vm/ubuntuvm.py b/tests/vm/ubuntuvm.py new file mode 100644 index 00000000000..6689ad87aa8 --- /dev/null +++ b/tests/vm/ubuntuvm.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +# +# Ubuntu VM testing library +# +# Copyright 2017 Red Hat Inc. +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# Originally based on ubuntu.i386 Fam Zheng +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. + +import os +import subprocess +import basevm + +class UbuntuVM(basevm.BaseVM): + + def __init__(self, args, config=None): + self.login_prompt = "ubuntu-{}-guest login:".format(self.arch) + basevm.BaseVM.__init__(self, args, config) + + def build_image(self, img): + """Build an Ubuntu VM image. The child class will + define the install_cmds to init the VM.""" + os_img = self._download_with_cache(self.image_link, + sha256sum=self.image_sha256) + img_tmp = img + ".tmp" + subprocess.check_call(["cp", "-f", os_img, img_tmp]) + self.exec_qemu_img("resize", img_tmp, "+50G") + ci_img = self.gen_cloud_init_iso() + + self.boot(img_tmp, extra_args = [ "-device", "VGA", "-cdrom", ci_img, ]) + + # First command we issue is fix for slow ssh login. + self.wait_ssh(wait_root=True, + cmd="chmod -x /etc/update-motd.d/*") + # Wait for cloud init to finish + self.wait_ssh(wait_root=True, + cmd="ls /var/lib/cloud/instance/boot-finished") + self.ssh_root("touch /etc/cloud/cloud-init.disabled") + # Disable auto upgrades. + # We want to keep the VM system state stable. + self.ssh_root('sed -ie \'s/"1"/"0"/g\' '\ + '/etc/apt/apt.conf.d/20auto-upgrades') + self.ssh_root("sed -ie s/^#\ deb-src/deb-src/g /etc/apt/sources.list") + + # If the user chooses not to do the install phase, + # then we will jump right to the graceful shutdown + if self._config['install_cmds'] != "": + # Issue the install commands. + # This can be overriden by the user in the config .yml. + install_cmds = self._config['install_cmds'].split(',') + for cmd in install_cmds: + self.ssh_root(cmd) + self.graceful_shutdown() + os.rename(img_tmp, img) + return 0 From patchwork Mon Jun 22 14:31:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191350 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1102436ile; Mon, 22 Jun 2020 07:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfnbI4hyCF20iKcNJs/jTynphY4SNqojcT6TBSgt1MMvrWFfeh+S0FJcUeli6kJcRxcDMQ X-Received: by 2002:a25:258:: with SMTP id 85mr24895824ybc.394.1592836754678; Mon, 22 Jun 2020 07:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836754; cv=none; d=google.com; s=arc-20160816; b=FyWmiHI2L5fu76Qa9fatGZSWvkP3r8pTnUzbJpOXkpu/sGy3HuFQWxHYOmxRwWhiby yqT3PBVCXZ5gMqh/vBMlViz6C11HXRVxuIhnPZPOMpxISJ7LDGBMQ2Q44ItHOMwSh38g 8qWiw1Mn44ICdtgfJyFDcNZqiaZEH/XWKDKpCl8A01EreDi/4w6csqxXxIqnha1hLDAm /BBYntffX21PYYHxbNxCprM3cOYHDUxaE8tip5CiXO6oKJMHttHv0IzfnzY78nBkBNh7 pFeMCpyrWYSMx/MflIqk4Vjf7yw2AH7xdOGMvqWb6//QcAOe5lMPe2yMnlFRAjyPnFzH 91TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=jbHRXShDrv/4W9ykS91A4mqd/64E3Bx1bZyQFn8BAsA=; b=fYzgA5utxuzWfNdzoo2HYtIRV0nujx0Zkw2aZeIEm5gPHXMqsW0zRRvUbc6gVfu1Dk a1Gtx2x9XwBs0rDB7y3blxPT9qe9zcVrqFGln5Ia0kxoYwLKnvcRMIWi+rvVZwsr1OSH U64V6GCLXbhjZqZiqew0LlU1CGhhVDD7FegU/REWHc9hIZXvsDO7wN/mrgsFhn1kOzpL fdV4bkMKDX5Vj3IwGSHJA2IQO3v8b5j3Iiaz79VgahudlpLjgu7rFJeY22sxUq/F1S+f tsp9++/QWf3fZwLcTno5spLkYxD4U+rsrGNK1g1olN6rjaepRq22D6DGBU/UVuRzUeE8 O9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cbSKRDjX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e5si14047086ybo.380.2020.06.22.07.39.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:39:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cbSKRDjX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNbN-0007G3-U0 for patch@linaro.org; Mon, 22 Jun 2020 10:39:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUi-0006xT-NS for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:20 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:33193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUe-0005fC-Tw for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:20 -0400 Received: by mail-wr1-x435.google.com with SMTP id l11so16943010wru.0 for ; Mon, 22 Jun 2020 07:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jbHRXShDrv/4W9ykS91A4mqd/64E3Bx1bZyQFn8BAsA=; b=cbSKRDjXX7uEIvHzzX8XukmK7CaRCucNNUXYkaVYT3zVm+tcSi/qoaXHyOg586kbhw X4IjYyeeAHPb4oqU+UrFv0nAbO7yAdsUyZvFJcIgpbgRdXd02hxmDAXcQZGU/MXBkhsl SMOOQHdZSW8dVjlnMcwx9KcjapgV0dwSxd9h5MvrVX3KC+Fdg/whyKCOAvNQq5k8Xhf1 cMAk1WIZjmtiF9OUIw5JCtZMhMUAM0oxgNlFyFsHD4vy8h9RsFt/DDxOKKdhR+clq7/7 NJ/rdIfpQVt50FAxtMXnnDpRfgFh10E1WozAIVbiL49A2yet8KmJs0p3uWrnRhB1dwBB KciA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jbHRXShDrv/4W9ykS91A4mqd/64E3Bx1bZyQFn8BAsA=; b=Sp5xzmkryJbdFGVJNVnkGqh3Z4Idlaw9N2H6kgWYuTN3rfKKrYfpJibTuEarwC4tYy B9MvrF2il/sESNuLPvN5ruH89BCu1Ubx5yDmfQOjHL0N8tEToMM8HefbcRec4wrvrniU t/G7CVPEmky2lxJF4H1UmFP5myK0UdvEVXsqlBJIpv+2pcQOQyaWoOrt7p7vSp9BoAtr ChguTMxLANx/cd2NKplnNqMdW82M/2QnirVGulSx5jttkwPMUaQflltF+G+eWPRk8vuq AO4A+rhiDuWCdgpHp7rXDhyUfv4APYV7/iQ9owPj1RsoqZf6e6sCNSSNgZTGpaULGuIC lMWA== X-Gm-Message-State: AOAM531UiL9qDZ88PVUwpPCp7XQ8rJ3NYX5SvpmZoskvGL7G+FagKNtU K3A9pOwMuOM5w/HePnHzBCzCkA== X-Received: by 2002:adf:ef8a:: with SMTP id d10mr9976062wro.126.1592836335103; Mon, 22 Jun 2020 07:32:15 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t125sm5191848wmf.10.2020.06.22.07.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 599FE1FF92; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 06/18] tests/vm: Added a new script for ubuntu.aarch64. Date: Mon, 22 Jun 2020 15:31:52 +0100 Message-Id: <20200622143204.12921-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley ubuntu.aarch64 provides a script to create an Ubuntu 18.04 VM. Another new file is also added aarch64vm.py, which is a module with common methods used by aarch64 VMs, such as how to create the flash images. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-6-robert.foley@linaro.org> --- configure | 20 +++++++ tests/vm/Makefile.include | 11 ++++ tests/vm/aarch64vm.py | 106 ++++++++++++++++++++++++++++++++++++++ tests/vm/basevm.py | 12 +++++ tests/vm/ubuntu.aarch64 | 68 ++++++++++++++++++++++++ 5 files changed, 217 insertions(+) create mode 100644 tests/vm/aarch64vm.py create mode 100755 tests/vm/ubuntu.aarch64 -- 2.20.1 diff --git a/configure b/configure index 6d14f2c2d6c..b4420e0c2a2 100755 --- a/configure +++ b/configure @@ -417,6 +417,7 @@ prefix="/usr/local" mandir="\${prefix}/share/man" datadir="\${prefix}/share" firmwarepath="\${prefix}/share/qemu-firmware" +efi_aarch64="" qemu_docdir="\${prefix}/share/doc/qemu" bindir="\${prefix}/bin" libdir="\${prefix}/lib" @@ -1107,6 +1108,8 @@ for opt do ;; --firmwarepath=*) firmwarepath="$optarg" ;; + --efi-aarch64=*) efi_aarch64="$optarg" + ;; --host=*|--build=*|\ --disable-dependency-tracking|\ --sbindir=*|--sharedstatedir=*|\ @@ -1777,6 +1780,7 @@ Advanced options (experts only): --sysconfdir=PATH install config in PATH$confsuffix --localstatedir=PATH install local state in PATH (set at runtime on win32) --firmwarepath=PATH search PATH for firmware files + --efi-aarch64=PATH PATH of efi file to use for aarch64 VMs. --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix] --with-pkgversion=VERS use specified string as sub-version of the package --enable-debug enable common debug build options @@ -3593,6 +3597,20 @@ EOF fi fi +############################################ +# efi-aarch64 probe +# Check for efi files needed by aarch64 VMs. +# By default we will use the efi included with QEMU. +# Allow user to override the path for efi also. +if ! test -f "$efi_aarch64"; then + if test -f $source_path/pc-bios/edk2-aarch64-code.fd.bz2; then + # valid after build + efi_aarch64=$PWD/pc-bios/edk2-aarch64-code.fd + else + efi_aarch64="" + fi +fi + ########################################## # libcap-ng library probe if test "$cap_ng" != "no" ; then @@ -6758,6 +6776,7 @@ if test "$docs" != "no"; then echo "sphinx-build $sphinx_build" fi echo "genisoimage $genisoimage" +echo "efi_aarch64 $efi_aarch64" echo "python_yaml $python_yaml" echo "slirp support $slirp $(echo_version $slirp $slirp_version)" if test "$slirp" != "no" ; then @@ -7838,6 +7857,7 @@ echo "PYTHON=$python" >> $config_host_mak echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak echo "GENISOIMAGE=$genisoimage" >> $config_host_mak +echo "EFI_AARCH64=$efi_aarch64" >> $config_host_mak echo "PYTHON_YAML=$python_yaml" >> $config_host_mak echo "CC=$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index f6c3892bb28..4fa292765d5 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -5,6 +5,9 @@ IMAGES := freebsd netbsd openbsd centos fedora ifneq ($(GENISOIMAGE),) IMAGES += ubuntu.i386 centos +ifneq ($(EFI_AARCH64),) +IMAGES += ubuntu.aarch64 +endif endif IMAGES_DIR := $(HOME)/.cache/qemu-vm/images @@ -23,6 +26,11 @@ vm-help vm-test: ifneq ($(GENISOIMAGE),) @echo " vm-build-centos - Build QEMU in CentOS VM, with Docker" @echo " vm-build-ubuntu.i386 - Build QEMU in ubuntu i386 VM" +ifneq ($(EFI_AARCH64),) + @echo " vm-build-ubuntu.aarch64 - Build QEMU in ubuntu aarch64 VM" +else + @echo " (to build centos/ubuntu aarch64 images use configure --efi-aarch64)" +endif else @echo " (install genisoimage to build centos/ubuntu images)" endif @@ -65,6 +73,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \ $(if $(V)$(DEBUG), --debug) \ $(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --image "$@" \ --force \ --build-image $@, \ @@ -80,6 +89,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(if $(J),--jobs $(J)) \ $(if $(V),--verbose) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ --snapshot \ @@ -102,6 +112,7 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(if $(J),--jobs $(J)) \ $(if $(V)$(DEBUG), --debug) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --image "$<" \ --interactive \ false, \ diff --git a/tests/vm/aarch64vm.py b/tests/vm/aarch64vm.py new file mode 100644 index 00000000000..bb04cb19c91 --- /dev/null +++ b/tests/vm/aarch64vm.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# +# VM testing aarch64 library +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# +import os +import sys +import subprocess +import basevm +from qemu.accel import kvm_available + +# This is the config needed for current version of QEMU. +# This works for both kvm and tcg. +CURRENT_CONFIG = { + 'cpu' : "max", + 'machine' : "virt,gic-version=max", +} + +# The minimum minor version of QEMU we will support with aarch64 VMs is 3. +# QEMU versions less than 3 have various issues running these VMs. +QEMU_AARCH64_MIN_VERSION = 3 + +# The DEFAULT_CONFIG will default to a version of +# parameters that works for backwards compatibility. +DEFAULT_CONFIG = {'kvm' : {'cpu' : "host", + 'machine' : "virt,gic-version=host"}, + 'tcg' : {'cpu' : "cortex-a57", + 'machine' : "virt"}, +} + +def get_config_defaults(vmcls, default_config): + """Fetch the configuration defaults for this VM, + taking into consideration the defaults for + aarch64 first, followed by the defaults for this VM.""" + config = default_config + config.update(aarch_get_config_defaults(vmcls)) + return config + +def aarch_get_config_defaults(vmcls): + """Set the defaults for current version of QEMU.""" + config = CURRENT_CONFIG + args, argv = basevm.parse_args(vmcls) + qemu_path = basevm.get_qemu_path(vmcls.arch, args.build_path) + qemu_version = basevm.get_qemu_version(qemu_path) + if qemu_version < QEMU_AARCH64_MIN_VERSION: + error = "\nThis major version of QEMU {} is to old for aarch64 VMs.\n"\ + "The major version must be at least {}.\n"\ + "To continue with the current build of QEMU, "\ + "please restart with QEMU_LOCAL=1 .\n" + print(error.format(qemu_version, QEMU_AARCH64_MIN_VERSION)) + exit(1) + if qemu_version == QEMU_AARCH64_MIN_VERSION: + # We have an older version of QEMU, + # set the config values for backwards compatibility. + if kvm_available('aarch64'): + config.update(DEFAULT_CONFIG['kvm']) + else: + config.update(DEFAULT_CONFIG['tcg']) + return config + +def create_flash_images(flash_dir="./", efi_img=""): + """Creates the appropriate pflash files + for an aarch64 VM.""" + flash0_path = get_flash_path(flash_dir, "flash0") + flash1_path = get_flash_path(flash_dir, "flash1") + fd_null = open(os.devnull, 'w') + subprocess.check_call(["dd", "if=/dev/zero", "of={}".format(flash0_path), + "bs=1M", "count=64"], + stdout=fd_null, stderr=subprocess.STDOUT) + # A reliable way to get the QEMU EFI image is via an installed package or + # via the bios included with qemu. + if not os.path.exists(efi_img): + sys.stderr.write("*** efi argument is invalid ({})\n".format(efi_img)) + sys.stderr.write("*** please check --efi-aarch64 argument or "\ + "install qemu-efi-aarch64 package\n") + exit(3) + subprocess.check_call(["dd", "if={}".format(efi_img), + "of={}".format(flash0_path), + "conv=notrunc"], + stdout=fd_null, stderr=subprocess.STDOUT) + subprocess.check_call(["dd", "if=/dev/zero", + "of={}".format(flash1_path), + "bs=1M", "count=64"], + stdout=fd_null, stderr=subprocess.STDOUT) + fd_null.close() + +def get_pflash_args(flash_dir="./"): + """Returns a string that can be used to + boot qemu using the appropriate pflash files + for aarch64.""" + flash0_path = get_flash_path(flash_dir, "flash0") + flash1_path = get_flash_path(flash_dir, "flash1") + pflash_args_str = "-drive file={},format=raw,if=pflash "\ + "-drive file={},format=raw,if=pflash" + pflash_args = pflash_args_str.format(flash0_path, flash1_path) + return pflash_args.split(" ") + +def get_flash_path(flash_dir, name): + return os.path.join(flash_dir, "{}.img".format(name)) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index fa56fbbb4b6..5fd66f6b26a 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -92,6 +92,7 @@ class BaseVM(object): self._guest = None self._genisoimage = args.genisoimage self._build_path = args.build_path + self._efi_aarch64 = args.efi_aarch64 # Allow input config to override defaults. self._config = DEFAULT_CONFIG.copy() if config != None: @@ -496,6 +497,14 @@ def get_qemu_path(arch, build_path=None): qemu_path = "qemu-system-" + arch return qemu_path +def get_qemu_version(qemu_path): + """Get the version number from the current QEMU, + and return the major number.""" + output = subprocess.check_output([qemu_path, '--version']) + version_line = output.decode("utf-8") + version_num = re.split(' |\(', version_line)[3].split('.')[0] + return int(version_num) + def parse_config(config, args): """ Parse yaml config and populate our config structure. The yaml config allows the user to override the @@ -573,6 +582,9 @@ def parse_args(vmcls): parser.add_option("--config", "-c", default=None, help="Provide config yaml for configuration. "\ "See config_example.yaml for example.") + parser.add_option("--efi-aarch64", + default="/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", + help="Path to efi image for aarch64 VMs.") parser.disable_interspersed_args() return parser.parse_args() diff --git a/tests/vm/ubuntu.aarch64 b/tests/vm/ubuntu.aarch64 new file mode 100755 index 00000000000..21d454c27f1 --- /dev/null +++ b/tests/vm/ubuntu.aarch64 @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 +# +# Ubuntu aarch64 image +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# Originally based on ubuntu.i386 Fam Zheng +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +import sys +import basevm +import aarch64vm +import ubuntuvm + +DEFAULT_CONFIG = { + 'cpu' : "cortex-a57", + 'machine' : "virt,gic-version=3", + 'install_cmds' : "apt-get update,"\ + "apt-get build-dep -y --arch-only qemu,"\ + "apt-get install -y libfdt-dev pkg-config language-pack-en", + # We increase beyond the default time since during boot + # it can take some time (many seconds) to log into the VM + # especially using softmmu. + 'ssh_timeout' : 60, +} + +class UbuntuAarch64VM(ubuntuvm.UbuntuVM): + name = "ubuntu.aarch64" + arch = "aarch64" + image_name = "ubuntu-18.04-server-cloudimg-arm64.img" + image_link = "https://cloud-images.ubuntu.com/releases/18.04/release/" + image_name + image_sha256="0fdcba761965735a8a903d8b88df8e47f156f48715c00508e4315c506d7d3cb1" + BUILD_SCRIPT = """ + set -e; + cd $(mktemp -d); + sudo chmod a+r /dev/vdb; + tar --checkpoint=.10 -xf /dev/vdb; + ./configure {configure_opts}; + make --output-sync {target} -j{jobs} {verbose}; + """ + def boot(self, img, extra_args=None): + aarch64vm.create_flash_images(self._tmpdir, self._efi_aarch64) + default_args = aarch64vm.get_pflash_args(self._tmpdir) + if extra_args: + extra_args.extend(default_args) + else: + extra_args = default_args + # We always add these performance tweaks + # because without them, we boot so slowly that we + # can time out finding the boot efi device. + if '-smp' not in extra_args and \ + '-smp' not in self._config['extra_args'] and \ + '-smp' not in self._args: + # Only add if not already there to give caller option to change it. + extra_args.extend(["-smp", "8"]) + + # We have overridden boot() since aarch64 has additional parameters. + # Call down to the base class method. + super(UbuntuAarch64VM, self).boot(img, extra_args=extra_args) + +if __name__ == "__main__": + defaults = aarch64vm.get_config_defaults(UbuntuAarch64VM, DEFAULT_CONFIG) + sys.exit(basevm.main(UbuntuAarch64VM, defaults)) From patchwork Mon Jun 22 14:31:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191360 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1109756ile; Mon, 22 Jun 2020 07:48:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ+Q5LivSJr+FTWOmvOItZNlT15rU9uqyLSBOOz2VyEO7BdgUq9AWMhNPlLLdDmBi95ZV5 X-Received: by 2002:a25:5186:: with SMTP id f128mr29589660ybb.293.1592837338968; Mon, 22 Jun 2020 07:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592837338; cv=none; d=google.com; s=arc-20160816; b=LwLPyu3gvY9c3opQCiDd7Rr9c/kQ4PCF36kaoyXTbsXLElfy+DQXPdIF2BbEuMnMDm C8geRWj2WUIY996maavoVlJ8Xe20KJ7Cf5MaKvAicaICrcJ/fLLfc/nVqpGdwNTh5wvK 4twe+2YAsSORWDo3WX9sTF296ZPMHFuwA5DXl9dGzU0qOVmLsY30yEtvwAiG7n/d+xdA BwHWDjaYzYiCYCAqTZVx56AuqptJS3KJglSdvTGMc7bBNG9EXeDO7MIjUDmnkgCqFfDv DXhpQFFFp5czYam+M7meG8HJ+EBAOKYseUvj8yYg4s2gObZCX74KRo2QHJdSpttFYrB+ deZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=kdMIZtPe+aZda1/mXQW7aQb8KseTM0tT+oUaOxEz8I4=; b=ezFbIs1qVS5SPjE0L1cfI+zfC4HIAPeqpvBaf5jGvo8N1MijKZXyxqFH+dk1BUBbcr FWDu/OvES56ajyxgietwJDeEGtzJTarCe4ZCvDgF/Cbvb99GEulN2V0SukWjLM/v3vkI SFiFHX8EDXc7YuXTCuvk75q7+PJrE4oKuR2NYIhNQHZ9eQwHRYLKSF0fU2nM82XO0Bvj tIqDKrEtOqh+haMNddNJfssdsPAopolPWQY49/zpJf5ayQsTTmvI+nwWnug+tEK10mBP lkp3d26IohsBN/blAs1Rh4BT+liUejXYr98eifuMVxH1ew4qVjBKvHeEBiu6hJu8ohsS 0rKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RORXMQdB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b125si13560939ybg.145.2020.06.22.07.48.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RORXMQdB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNko-0007R7-C7 for patch@linaro.org; Mon, 22 Jun 2020 10:48:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUl-00071a-CB for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:23 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:39054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUg-0005fV-7D for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:23 -0400 Received: by mail-wm1-x32b.google.com with SMTP id t194so15955171wmt.4 for ; Mon, 22 Jun 2020 07:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kdMIZtPe+aZda1/mXQW7aQb8KseTM0tT+oUaOxEz8I4=; b=RORXMQdBX7FXwpQMA4TazBP6tW5Af4DhJWsMXMtl/eIwkKj7Zv+OJM0tQ09wFgEB7r Aw6O5xOaNHsuF0lsLf94bs6h8A+g7FL+p25qRUIKcJXN9QHCr19iFLXK1SVmvP/0GWhf EFm1uK6H7D2/i9RluukpSF9lGGh/UQqpTTyVNvmNUZjGCXHFz0CkloTD5Fj3ZE1pFK4Q G/QQePX82foNpYB8tIrFt3KB3e2FnEs5ElwHGZCHasDohkejAiwNkjCh6uAOsbEkM4kk /ibUoQM6v5xaKN3h+U/8gF2LHUCokAMD7C0RtPnxxwycxbFNTt7Fzqzi3F0ybskxFJnT Q5mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kdMIZtPe+aZda1/mXQW7aQb8KseTM0tT+oUaOxEz8I4=; b=Xuc9FOUBYH48Y4jHHKe4D0k6RbLsWf64hKyPGxTGEtJA5ng9co6LSA/qQNnnZj/LVB IFjQBX9wWALYl7igqh5OFL8LMp/MkwiOLiQI7PCvKaaUQUN6hblNXzrwzHLULF3zmD9Q 5HyjY7hih5tSjcBD2jTs2DOkTG6janQs5raPFUxy52AaLU4KI3a1eV1WqTSzr7KjD99C QDCkL6VB99QBnljiql09A2JX8g5kWiJmm3OqxhBO1js85DhdtTV6DEC8dpOTbZJrYnkN Rohqu10OxCgLziYu/mif8OO9X2cbU1gMIvfn9d8fx6L/xdxQNQ0tLN/IOKdnu7Cns+/n EBpA== X-Gm-Message-State: AOAM533nRnLqcLdEnVWyYznFa6z5jUJV0vdEpfaiqPj+QbH7NV/wiXMc 2NoWsIpYBGecMhPWK0ckxsfIYg== X-Received: by 2002:a05:600c:21d7:: with SMTP id x23mr19714500wmj.95.1592836336500; Mon, 22 Jun 2020 07:32:16 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 1sm12407654wmf.21.2020.06.22.07.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 74E051FF93; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 07/18] tests/vm: Added a new script for centos.aarch64. Date: Mon, 22 Jun 2020 15:31:53 +0100 Message-Id: <20200622143204.12921-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley centos.aarch64 creates a CentOS 8 image. Also added a new kickstart script used to build the centos.aarch64 image. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-7-robert.foley@linaro.org> --- tests/vm/Makefile.include | 3 +- tests/vm/centos-8-aarch64.ks | 51 ++++++++ tests/vm/centos.aarch64 | 227 +++++++++++++++++++++++++++++++++++ 3 files changed, 280 insertions(+), 1 deletion(-) create mode 100644 tests/vm/centos-8-aarch64.ks create mode 100755 tests/vm/centos.aarch64 -- 2.20.1 diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 4fa292765d5..39f918a430a 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -6,7 +6,7 @@ IMAGES := freebsd netbsd openbsd centos fedora ifneq ($(GENISOIMAGE),) IMAGES += ubuntu.i386 centos ifneq ($(EFI_AARCH64),) -IMAGES += ubuntu.aarch64 +IMAGES += ubuntu.aarch64 centos.aarch64 endif endif @@ -28,6 +28,7 @@ ifneq ($(GENISOIMAGE),) @echo " vm-build-ubuntu.i386 - Build QEMU in ubuntu i386 VM" ifneq ($(EFI_AARCH64),) @echo " vm-build-ubuntu.aarch64 - Build QEMU in ubuntu aarch64 VM" + @echo " vm-build-centos.aarch64 - Build QEMU in CentOS aarch64 VM" else @echo " (to build centos/ubuntu aarch64 images use configure --efi-aarch64)" endif diff --git a/tests/vm/centos-8-aarch64.ks b/tests/vm/centos-8-aarch64.ks new file mode 100644 index 00000000000..fd6ebe4d49e --- /dev/null +++ b/tests/vm/centos-8-aarch64.ks @@ -0,0 +1,51 @@ +# CentOS aarch64 image kickstart file. +# This file is used by the CentOS installer to +# script the generation of the image. +# +# Copyright 2020 Linaro +# +ignoredisk --only-use=vda +# System bootloader configuration +bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=vda +autopart --type=plain +# Partition clearing information +clearpart --linux --initlabel --drives=vda +# Use text mode install +text +repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream +# Use CDROM installation media +cdrom +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='' +# System language +lang en_US.UTF-8 + +# Network information +network --bootproto=dhcp --device=enp0s1 --onboot=off --ipv6=auto --no-activate +network --hostname=localhost.localdomain +# Run the Setup Agent on first boot +firstboot --enable +# Do not configure the X Window System +skipx +# System services +services --enabled="chronyd" +# System timezone +timezone America/New_York --isUtc + +# Shutdown after installation is complete. +shutdown + +%packages +@^server-product-environment +kexec-tools + +%end + +%addon com_redhat_kdump --enable --reserve-mb='auto' + +%end +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty +%end diff --git a/tests/vm/centos.aarch64 b/tests/vm/centos.aarch64 new file mode 100755 index 00000000000..d5232ecdb8c --- /dev/null +++ b/tests/vm/centos.aarch64 @@ -0,0 +1,227 @@ +#!/usr/bin/env python3 +# +# Centos aarch64 image +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# Originally based on ubuntu.aarch64 +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +import os +import sys +import subprocess +import basevm +import time +import traceback +import aarch64vm + +DEFAULT_CONFIG = { + 'cpu' : "max", + 'machine' : "virt,gic-version=max", + 'install_cmds' : "yum install -y make git python3 gcc gcc-c++ flex bison, "\ + "yum install -y glib2-devel pixman-devel zlib-devel, "\ + "yum install -y perl-Test-Harness, "\ + "alternatives --set python /usr/bin/python3, "\ + "sudo dnf config-manager "\ + "--add-repo=https://download.docker.com/linux/centos/docker-ce.repo,"\ + "sudo dnf install --nobest -y docker-ce.aarch64,"\ + "systemctl enable docker", + # We increase beyond the default time since during boot + # it can take some time (many seconds) to log into the VM. + 'ssh_timeout' : 60, +} + +class CentosAarch64VM(basevm.BaseVM): + name = "centos.aarch64" + arch = "aarch64" + login_prompt = "localhost login:" + prompt = '[root@localhost ~]#' + image_name = "CentOS-8-aarch64-1905-dvd1.iso" + image_link = "http://mirrors.usc.edu/pub/linux/distributions/centos/8.0.1905/isos/aarch64/" + image_link += image_name + BUILD_SCRIPT = """ + set -e; + cd $(mktemp -d); + sudo chmod a+r /dev/vdb; + tar --checkpoint=.10 -xf /dev/vdb; + ./configure {configure_opts}; + make --output-sync {target} -j{jobs} {verbose}; + """ + def set_key_perm(self): + """Set permissions properly on certain files to allow + ssh access.""" + self.console_wait_send(self.prompt, + "/usr/sbin/restorecon -R -v /root/.ssh\n") + self.console_wait_send(self.prompt, + "/usr/sbin/restorecon -R -v "\ + "/home/{}/.ssh\n".format(self._config["guest_user"])) + + def create_kickstart(self): + """Generate the kickstart file used to generate the centos image.""" + # Start with the template for the kickstart. + ks_file = "../tests/vm/centos-8-aarch64.ks" + subprocess.check_call("cp {} ./ks.cfg".format(ks_file), shell=True) + # Append the ssh keys to the kickstart file + # as the post processing phase of installation. + with open("ks.cfg", "a") as f: + # Add in the root pw and guest user. + rootpw = "rootpw --plaintext {}\n" + f.write(rootpw.format(self._config["root_pass"])) + add_user = "user --groups=wheel --name={} "\ + "--password={} --plaintext\n" + f.write(add_user.format(self._config["guest_user"], + self._config["guest_pass"])) + # Add the ssh keys. + f.write("%post --log=/root/ks-post.log\n") + f.write("mkdir -p /root/.ssh\n") + addkey = 'echo "{}" >> /root/.ssh/authorized_keys\n' + addkey_cmd = addkey.format(self._config["ssh_pub_key"]) + f.write(addkey_cmd) + f.write('mkdir -p /home/{}/.ssh\n'.format(self._config["guest_user"])) + addkey = 'echo "{}" >> /home/{}/.ssh/authorized_keys\n' + addkey_cmd = addkey.format(self._config["ssh_pub_key"], + self._config["guest_user"]) + f.write(addkey_cmd) + f.write("%end\n") + # Take our kickstart file and create an .iso from it. + # The .iso will be provided to qemu as we boot + # from the install dvd. + # Anaconda will recognize the label "OEMDRV" and will + # start the automated installation. + gen_iso_img = 'genisoimage -output ks.iso -volid "OEMDRV" ks.cfg' + subprocess.check_call(gen_iso_img, shell=True) + + def wait_for_shutdown(self): + """We wait for qemu to shutdown the VM and exit. + While this happens we display the console view + for easier debugging.""" + # The image creation is essentially done, + # so whether or not the wait is successful we want to + # wait for qemu to exit (the self.wait()) before we return. + try: + self.console_wait("reboot: Power down") + except Exception as e: + sys.stderr.write("Exception hit\n") + if isinstance(e, SystemExit) and e.code == 0: + return 0 + traceback.print_exc() + finally: + self.wait() + + def build_base_image(self, dest_img): + """Run through the centos installer to create + a base image with name dest_img.""" + # We create the temp image, and only rename + # to destination when we are done. + img = dest_img + ".tmp" + # Create an empty image. + # We will provide this as the install destination. + qemu_img_create = "qemu-img create {} 50G".format(img) + subprocess.check_call(qemu_img_create, shell=True) + + # Create our kickstart file to be fed to the installer. + self.create_kickstart() + # Boot the install dvd with the params as our ks.iso + os_img = self._download_with_cache(self.image_link) + dvd_iso = "centos-8-dvd.iso" + subprocess.check_call(["cp", "-f", os_img, dvd_iso]) + extra_args = "-cdrom ks.iso" + extra_args += " -drive file={},if=none,id=drive1,cache=writeback" + extra_args += " -device virtio-blk,drive=drive1,bootindex=1" + extra_args = extra_args.format(dvd_iso).split(" ") + self.boot(img, extra_args=extra_args) + self.console_wait_send("change the selection", "\n") + # We seem to need to hit esc (chr(27)) twice to abort the + # media check, which takes a long time. + # Waiting a bit seems to be more reliable before hitting esc. + self.console_wait("Checking") + time.sleep(5) + self.console_wait_send("Checking", chr(27)) + time.sleep(5) + self.console_wait_send("Checking", chr(27)) + print("Found Checking") + # Give sufficient time for the installer to create the image. + self.console_init(timeout=7200) + self.wait_for_shutdown() + os.rename(img, dest_img) + print("Done with base image build: {}".format(dest_img)) + + def check_create_base_img(self, img_base, img_dest): + """Create a base image using the installer. + We will use the base image if it exists. + This helps cut down on install time in case we + need to restart image creation, + since the base image creation can take a long time.""" + if not os.path.exists(img_base): + print("Generate new base image: {}".format(img_base)) + self.build_base_image(img_base); + else: + print("Use existing base image: {}".format(img_base)) + # Save a copy of the base image and copy it to dest. + # which we will use going forward. + subprocess.check_call(["cp", img_base, img_dest]) + + def boot(self, img, extra_args=None): + aarch64vm.create_flash_images(self._tmpdir, self._efi_aarch64) + default_args = aarch64vm.get_pflash_args(self._tmpdir) + if extra_args: + extra_args.extend(default_args) + else: + extra_args = default_args + # We always add these performance tweaks + # because without them, we boot so slowly that we + # can time out finding the boot efi device. + if '-smp' not in extra_args and \ + '-smp' not in self._config['extra_args'] and \ + '-smp' not in self._args: + # Only add if not already there to give caller option to change it. + extra_args.extend(["-smp", "8"]) + # We have overridden boot() since aarch64 has additional parameters. + # Call down to the base class method. + super(CentosAarch64VM, self).boot(img, extra_args=extra_args) + + def build_image(self, img): + img_tmp = img + ".tmp" + self.check_create_base_img(img + ".base", img_tmp) + + # Boot the new image for the first time to finish installation. + self.boot(img_tmp) + self.console_init() + self.console_wait_send(self.login_prompt, "root\n") + self.console_wait_send("Password:", + "{}\n".format(self._config["root_pass"])) + + self.set_key_perm() + self.console_wait_send(self.prompt, "rpm -q centos-release\n") + enable_adapter = "sed -i 's/ONBOOT=no/ONBOOT=yes/g'" \ + " /etc/sysconfig/network-scripts/ifcfg-enp0s1\n" + self.console_wait_send(self.prompt, enable_adapter) + self.console_wait_send(self.prompt, "ifup enp0s1\n") + self.console_wait_send(self.prompt, + 'echo "qemu ALL=(ALL) NOPASSWD:ALL" | '\ + 'sudo tee /etc/sudoers.d/qemu\n') + self.console_wait(self.prompt) + + # Rest of the commands we issue through ssh. + self.wait_ssh(wait_root=True) + + # If the user chooses *not* to do the second phase, + # then we will jump right to the graceful shutdown + if self._config['install_cmds'] != "": + install_cmds = self._config['install_cmds'].split(',') + for cmd in install_cmds: + self.ssh_root(cmd) + self.ssh_root("poweroff") + self.wait_for_shutdown() + os.rename(img_tmp, img) + print("image creation complete: {}".format(img)) + return 0 + +if __name__ == "__main__": + defaults = aarch64vm.get_config_defaults(CentosAarch64VM, DEFAULT_CONFIG) + sys.exit(basevm.main(CentosAarch64VM, defaults)) From patchwork Mon Jun 22 14:31:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191359 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1107873ile; Mon, 22 Jun 2020 07:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3as+zuWlC2kmhUL9NDESAigmfjuH3JhCveOl4Ujp3ToUWWkVvZTA/0HuCVbg0k/UBl0uM X-Received: by 2002:a05:6902:68b:: with SMTP id i11mr28327773ybt.396.1592837194103; Mon, 22 Jun 2020 07:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592837194; cv=none; d=google.com; s=arc-20160816; b=FDap2rxu6gjIxyQ2ImiC8HJyN5W58+Sr1hjYOxAMFETf700jbTc08M5o2L4AcVbMDz CM+rnhLbv3ymhrRWNgQw7KqPgHYq4cOFtQi8FO3AfX4jqLZahXEiKUolFoWpuI//8am8 L8TTx2zJi5R14JJfuqaTm/+JpKR0P6Z5XSC+3XGeThnmCeFg//xDsDl3Bb8JPuli5s/V MkxUu98/GsiFqrrf9kK2RtteAiKNk7zMeik8r0hqJQwhcHLf/eVW1CoPL5A0v0QkGA63 RutYI+RRSXA/LMswc5fToD7kt9VLlOlTlzJekUkGI/9z366Ks250hJxX2ZH5z8/bkD9j RDAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=qDw5tmNjtaEA2MrxzXTWX9WRb/d3hDPxln94PjTXX2k=; b=Z9EvTMpXA0rYhH5Ux/jxWfpVN4CKEwo7HLHufR6G7Ipca8iYGiKFAyqk9eYvrSxKlL SyBHIny3cqmPA5lu2daq+fBT8z9QC0IVaIPP1DEvGrfITI1WgbXikdUqIdTFf7Zg69Sz i4jwLouJ2eV1n7ltN1v7XOXk8tp8d6AK787Vl9KnswIOmV8yfe9x+jgWvgSSnqeeCGFt rRUpvo8bK7dnccsPpcuJsGjD6THaTSs250tJGwdtVRbAkIaSMg+EVeTq912praeeXtvP +bLfyrKwLB5YLKcMB0uOMUYgwcMk3kVGSm4NZFM1p8ra4smWpTfMmfUP48CbwwSH2sFQ 0XXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WIFkl2vj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b203si13012233yba.469.2020.06.22.07.46.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:46:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WIFkl2vj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNiT-0002nB-GH for patch@linaro.org; Mon, 22 Jun 2020 10:46:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUj-0006yg-IL for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:21 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:33404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUh-0005fj-5N for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:21 -0400 Received: by mail-wr1-x442.google.com with SMTP id l11so16943158wru.0 for ; Mon, 22 Jun 2020 07:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qDw5tmNjtaEA2MrxzXTWX9WRb/d3hDPxln94PjTXX2k=; b=WIFkl2vjy4nRo12cfiqpis7I8EBiDRf1kMgpIKp3Zvqw7aGIf7Cx5dgCgcvN2nBfys vt5JknOSKx1eUCcBq5cBrQSm70KIwbokh7Kqtu4m0BAbK9uD14LH4cbVHT9b/FpZiiJF FPWf+b+MwNBUuAIWiSqd5J9XWE/nbvXBZMY8xv2Ef1Uc9acoKKEkobYf4YsSHcbYKY98 fBjpTGYEaClD7z0dwIOTyDiDDleK4XOlcXZRwJjc5fwNwqjDZPhfSb+TDI2JRnCgMW2y pZ947rgna5VzwZC9YBRgs4av80mUEWSkqo0czd8DjFpxrQIzDEXwikzD8G2GY4wYuK/h 2erw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qDw5tmNjtaEA2MrxzXTWX9WRb/d3hDPxln94PjTXX2k=; b=C0y9nlNKOsUuJOMCik3rEnM1sNSFbEiBSoCUB/3ZX5Ed9OJ8sHvsrMVHQ2b4NV3dZd sil2xAVQb2qTgqehQbiQ/K0vK7Vd1PQME4NBIxwI/vRpHPDnl0/Zf5zLUpaP5lmMNOdU lFFtcr4njjZiDib36vpF1BmeLa5y6MqDeWCCMp/yyCVqkbg7a2Gvwv1t06aDM0GYInwt zfISf2+505YntIV1vhCX2lz/e5rw4UMVm7up53LpXTC6/9qnp37psfFJ6hiuUD5NrUc/ 4OQDCPP3lIBTvvO8sJS6rICERluD6LwPBw2r4JYugAa9T12OFGAGK0x6Gzq5i2mUsvyo sHJw== X-Gm-Message-State: AOAM531JdbeId3gVjX5mcyhGJm7A5LsiyeiI7XiJlpvSxLr/PQGMHbeI rb55bWPx/gEKsjZsI44GfHzHfzLQ3Ho= X-Received: by 2002:a5d:4607:: with SMTP id t7mr10974843wrq.251.1592836337667; Mon, 22 Jun 2020 07:32:17 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h2sm5654429wrw.62.2020.06.22.07.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 90D031FF96; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 08/18] tests/vm: change scripts to use self._config Date: Mon, 22 Jun 2020 15:31:54 +0100 Message-Id: <20200622143204.12921-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley This change converts existing scripts to using for example self.ROOT_PASS, to self._config['root_pass']. We made similar changes for GUEST_USER, and GUEST_PASS. This allows us also to remove the change in basevm.py, which adds __getattr__ for backwards compatibility. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-8-robert.foley@linaro.org> --- tests/vm/basevm.py | 11 ++--------- tests/vm/fedora | 17 +++++++++-------- tests/vm/freebsd | 16 ++++++++-------- tests/vm/netbsd | 19 ++++++++++--------- tests/vm/openbsd | 17 +++++++++-------- 5 files changed, 38 insertions(+), 42 deletions(-) -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5fd66f6b26a..f716798b405 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -183,13 +183,6 @@ class BaseVM(object): self.console_init(timeout=timeout) self.console_wait(wait_string) - def __getattr__(self, name): - # Support direct access to config by key. - # for example, access self._config['cpu'] by self.cpu - if name.lower() in self._config.keys(): - return self._config[name.lower()] - return object.__getattribute__(self, name) - def _download_with_cache(self, url, sha256sum=None, sha512sum=None): def check_sha256sum(fname): if not sha256sum: @@ -239,13 +232,13 @@ class BaseVM(object): return r def ssh(self, *cmd): - return self._ssh_do(self.GUEST_USER, cmd, False) + return self._ssh_do(self._config["guest_user"], cmd, False) def ssh_root(self, *cmd): return self._ssh_do("root", cmd, False) def ssh_check(self, *cmd): - self._ssh_do(self.GUEST_USER, cmd, True) + self._ssh_do(self._config["guest_user"], cmd, True) def ssh_root_check(self, *cmd): self._ssh_do("root", cmd, True) diff --git a/tests/vm/fedora b/tests/vm/fedora index a9195670f4b..b2b478fdbca 100755 --- a/tests/vm/fedora +++ b/tests/vm/fedora @@ -108,20 +108,20 @@ class FedoraVM(basevm.BaseVM): self.console_wait_send("7) [!] Root password", "7\n") self.console_wait("Password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("Password (confirm):") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait_send("8) [ ] User creation", "8\n") self.console_wait_send("1) [ ] Create user", "1\n") self.console_wait_send("3) User name", "3\n") - self.console_wait_send("ENTER:", "%s\n" % self.GUEST_USER) + self.console_wait_send("ENTER:", "%s\n" % self._config["guest_user"]) self.console_wait_send("4) [ ] Use password", "4\n") self.console_wait_send("5) Password", "5\n") self.console_wait("Password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Password (confirm):") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait_send("7) Groups", "c\n") while True: @@ -139,7 +139,7 @@ class FedoraVM(basevm.BaseVM): if good: break time.sleep(10) - self.console_send("r\n" % self.GUEST_PASS) + self.console_send("r\n" % self._config["guest_pass"]) self.console_wait_send("'b' to begin install", "b\n") @@ -150,12 +150,13 @@ class FedoraVM(basevm.BaseVM): # setup qemu user prompt = " ~]$" - self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_ssh_init(prompt, self._config["guest_user"], + self._config["guest_pass"]) self.console_wait_send(prompt, "exit\n") # setup root user prompt = " ~]#" - self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) # setup virtio-blk #1 (tarfile) diff --git a/tests/vm/freebsd b/tests/vm/freebsd index f87db2b126e..29252fa4a64 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -113,9 +113,9 @@ class FreeBSDVM(basevm.BaseVM): # post-install configuration self.console_wait("New Password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("Retype New Password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait_send("Network Configuration", "\n") self.console_wait_send("IPv4", "y") @@ -134,9 +134,9 @@ class FreeBSDVM(basevm.BaseVM): # qemu user self.console_wait_send("Add User Accounts", "y") self.console_wait("Username") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_user"]) self.console_wait("Full name") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_user"]) self.console_wait_send("Uid", "\n") self.console_wait_send("Login group", "\n") self.console_wait_send("Login group", "\n") @@ -148,9 +148,9 @@ class FreeBSDVM(basevm.BaseVM): self.console_wait_send("Use an empty password", "\n") self.console_wait_send("Use a random password", "\n") self.console_wait("Enter password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Enter password again:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait_send("Lock out", "\n") self.console_wait_send("OK", "yes\n") self.console_wait_send("Add another user", "no\n") @@ -164,12 +164,12 @@ class FreeBSDVM(basevm.BaseVM): # setup qemu user prompt = "$" - self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_ssh_init(prompt, self._config["guest_user"], self._config["guest_pass"]) self.console_wait_send(prompt, "exit\n") # setup root user prompt = "root@freebsd:~ #" - self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) # setup serial console diff --git a/tests/vm/netbsd b/tests/vm/netbsd index cdac502dad8..dc0e45c1d45 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -120,24 +120,24 @@ class NetBSDVM(basevm.BaseVM): self.console_wait_send("d: Change root password", "d\n") self.console_wait_send("a: Yes", "a\n") self.console_wait("New password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("New password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("Retype new password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait_send("o: Add a user", "o\n") self.console_wait("username") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("to group wheel") self.console_wait_send("a: Yes", "a\n") self.console_wait_send("a: /bin/sh", "a\n") self.console_wait("New password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("New password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Retype new password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait_send("a: Configure network", "a\n") self.console_wait_send("a: vioif0", "a\n") @@ -170,12 +170,13 @@ class NetBSDVM(basevm.BaseVM): # setup qemu user prompt = "localhost$" - self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_ssh_init(prompt, self._config["guest_user"], + self._config["guest_pass"]) self.console_wait_send(prompt, "exit\n") # setup root user prompt = "localhost#" - self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) # setup virtio-blk #1 (tarfile) diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 13e7f9a6d56..dfe633e4532 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -98,9 +98,9 @@ class OpenBSDVM(basevm.BaseVM): self.console_wait_send("Which network interface", "done\n") self.console_wait_send("DNS domain name", "localnet\n") self.console_wait("Password for root account") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("Password for root account") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait_send("Start sshd(8)", "yes\n") self.console_wait_send("X Window System", "\n") self.console_wait_send("xenodm", "\n") @@ -108,13 +108,13 @@ class OpenBSDVM(basevm.BaseVM): self.console_wait_send("Which speed", "\n") self.console_wait("Setup a user") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_user"]) self.console_wait("Full name") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_user"]) self.console_wait("Password") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Password") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait_send("Allow root ssh login", "yes\n") self.console_wait_send("timezone", "UTC\n") @@ -135,12 +135,13 @@ class OpenBSDVM(basevm.BaseVM): # setup qemu user prompt = "$" - self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_ssh_init(prompt, self._config["guest_user"], + self._config["guest_pass"]) self.console_wait_send(prompt, "exit\n") # setup root user prompt = "openbsd#" - self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) # setup virtio-blk #1 (tarfile) From patchwork Mon Jun 22 14:31:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191354 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1103905ile; Mon, 22 Jun 2020 07:41:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWlgfVhGpfahQ4U8iNMI9/uzutuywWxcgLchVxrUQ/k9XmtqmHOvDkeB0gilPjgu53FqAk X-Received: by 2002:a25:c683:: with SMTP id k125mr29621825ybf.305.1592836872241; Mon, 22 Jun 2020 07:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836872; cv=none; d=google.com; s=arc-20160816; b=bzjN32OBNa1X6+F3MDm2YGSlVCEGoVthPo1rb8WnBm7JSQdJNvSE/DL+Pbmg6GyOcu fFTi94pLGE3IiuxNaMyrwdAsz4DVek6lugW9hPloGZMYeeSh/ymwsPMCRVmZNCNl1R71 R24CXqkoPNC0icYoqGgp5btzBcCxuKpOJLjrUQWW67nK46C9N6qm8Wx9t1tEie0okIKL Aw6GXErf8xTw3buQ0ul/QmweG/gVLGkvfTj8xV490qYa1wr+YG/fPsV8BYyA9QgovpcG LvnAwDzP4zEI1H8lzKu3N/Ok4esaJtg1tBkyPrPj5qTL4qx6su1quMlz0Xnkq6eYEJpZ u83A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=SfCKKjXRpSzktD2zHuCdVYnzBzWod3odSIiX8dUA3RA=; b=Kr37YgXIMjgqBnrHXVic49lOmz3LIlHKrgrxrS5mdJwP+2YC0qX3JJDRzBQqb8W7ie Z31EqJGYWKmLi0nN/SsMEudhaNYCKNBkR3EWxgxHTWLOgURBubIS+AHAA+ha1qQFKonD 8AFgi53aS7ON1+YfYeK7KdH/wGX45LWIYYF6JvrwxxbDYZ3qGGRKet9VqiT63u6cSEud UO5HUxgn5KTfOlyR8JWtbP9HL6GOX2duVv4zxqYwv2X6eVGhaYH3Dqt+hiL2l/DCHK5g pC/SAoqAxhBxUHlvIbnoF+3f1BjPFdjHLfMgbcqPp5QHBu/E7lrTaaNz8z7kaVGo1H+3 cTUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Xar42K/1"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d205si12862737ybh.435.2020.06.22.07.41.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:41:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Xar42K/1"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNdH-0003y1-Cr for patch@linaro.org; Mon, 22 Jun 2020 10:41:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUm-00073f-KJ for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:24 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:35651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUk-0005g7-6e for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:24 -0400 Received: by mail-wr1-x42c.google.com with SMTP id g18so7858384wrm.2 for ; Mon, 22 Jun 2020 07:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SfCKKjXRpSzktD2zHuCdVYnzBzWod3odSIiX8dUA3RA=; b=Xar42K/1wjtXTgnbv0KVk7mQFYnxiGeu4JK4TeU0aAiM6kwk4XSzTnkRSCFiNHCWe7 siWnL8D9HevP5Wv+vXMoZlwEy2thSP40n/u1gVFC1ABdURO3y9q9YH3VQYHW1HZBMIpj 3EGy8AEfHXQRZSN9GbdMg4baZASUDbSa6cd8BAcH3Z7ndGfYCDYQ5lQFhM/pE+V+m6jr XTt42PKolpQP9oIzRkQHIMtfS73F7xEeAVP5w4nFZ3gELPd0DQBuqkTFdZ/NxWMsY2y7 wKHuJyO+au0b11EEgGFEO6P1+Y+Ux7flXPHJwX9lDNPTYSoQVEDVcVDGscLcGhcJFCWy iDPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SfCKKjXRpSzktD2zHuCdVYnzBzWod3odSIiX8dUA3RA=; b=Laa/xzEnPcUz6y/nBIEbNO5dJuQFr0MKxPROyifB5+tYR711vk5uxQ+tAegMd8XAxx xIGKfHplMHad1drytKtR2gmU0HGHVNyHQAiYLJdm5JMSDp3+WlJ8PamJHfq+xEu+GPdN L9kr3/OuMVlyRrOajcKiUuDs2jG01isAYZ7mp6BycR/njHGSDkJRndVA3YTspdSN3ei3 aP4ZJ82A+BixUobqWY8lw+CQCJu8wcoDV/nMHqjqTT0iUQE5ji4CVxIvXUUIMtnxG9eA UWLDZQxjiyv/Y+t9CJOQriygpB8w174Dc2j1zkz/Q7VZOkt714L8rGJXjCaeuS0gba4C 9dQw== X-Gm-Message-State: AOAM533r3qPe2XLLUM2C+vCugdAkjumoVh/fAN0JP+eOk5XiobQpgIkf 7h9eNOnWMATwiEj7Dd5dUitBHw== X-Received: by 2002:adf:edc8:: with SMTP id v8mr17920774wro.125.1592836340554; Mon, 22 Jun 2020 07:32:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n16sm12311571wrq.39.2020.06.22.07.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A7DED1FF98; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 09/18] python/qemu: Add ConsoleSocket for optional use in QEMUMachine Date: Mon, 22 Jun 2020 15:31:55 +0100 Message-Id: <20200622143204.12921-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, Cleber Rosa , Peter Puhov , aurelien@aurel32.net, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley We add the ConsoleSocket object, which has a socket interface and which will consume all arriving characters on the socket, placing them into an in memory buffer. This will also provide those chars via recv() as would a regular socket. ConsoleSocket also has the option of dumping the console bytes to a log file. We also give QEMUMachine the option of using ConsoleSocket to drain and to use for logging console to a file. By default QEMUMachine does not use ConsoleSocket. This is added in preparation for use by basevm.py in a later commit. This is a workaround we found was needed for basevm.py since there is a known issue where QEMU will hang waiting for console characters to be consumed. Cc: Eduardo Habkost Cc: Cleber Rosa Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Acked-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-9-robert.foley@linaro.org> --- python/qemu/console_socket.py | 110 ++++++++++++++++++++++++++++++++++ python/qemu/machine.py | 23 +++++-- 2 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 python/qemu/console_socket.py -- 2.20.1 diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py new file mode 100644 index 00000000000..830cb7c6282 --- /dev/null +++ b/python/qemu/console_socket.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +# +# This python module implements a ConsoleSocket object which is +# designed always drain the socket itself, and place +# the bytes into a in memory buffer for later processing. +# +# Optionally a file path can be passed in and we will also +# dump the characters to this file for debug. +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# +import asyncore +import socket +import threading +import io +import os +import sys +from collections import deque +import time +import traceback + +class ConsoleSocket(asyncore.dispatcher): + + def __init__(self, address, file=None): + self._recv_timeout_sec = 300 + self._buffer = deque() + self._asyncore_thread = None + self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + self._sock.connect(address) + self._logfile = None + if file: + self._logfile = open(file, "w") + asyncore.dispatcher.__init__(self, sock=self._sock) + self._open = True + self._thread_start() + + def _thread_start(self): + """Kick off a thread to wait on the asyncore.loop""" + if self._asyncore_thread is not None: + return + self._asyncore_thread = threading.Thread(target=asyncore.loop, + kwargs={'timeout':1}) + self._asyncore_thread.daemon = True + self._asyncore_thread.start() + + def handle_close(self): + """redirect close to base class""" + # Call the base class close, but not self.close() since + # handle_close() occurs in the context of the thread which + # self.close() attempts to join. + asyncore.dispatcher.close(self) + + def close(self): + """Close the base object and wait for the thread to terminate""" + if self._open: + self._open = False + asyncore.dispatcher.close(self) + if self._asyncore_thread is not None: + thread, self._asyncore_thread = self._asyncore_thread, None + thread.join() + if self._logfile: + self._logfile.close() + self._logfile = None + + def handle_read(self): + """process arriving characters into in memory _buffer""" + try: + data = asyncore.dispatcher.recv(self, 1) + # latin1 is needed since there are some chars + # we are receiving that cannot be encoded to utf-8 + # such as 0xe2, 0x80, 0xA6. + string = data.decode("latin1") + except: + print("Exception seen.") + traceback.print_exc() + return + if self._logfile: + self._logfile.write("{}".format(string)) + self._logfile.flush() + for c in string: + self._buffer.extend(c) + + def recv(self, n=1, sleep_delay_s=0.1): + """Return chars from in memory buffer""" + start_time = time.time() + while len(self._buffer) < n: + time.sleep(sleep_delay_s) + elapsed_sec = time.time() - start_time + if elapsed_sec > self._recv_timeout_sec: + raise socket.timeout + chars = ''.join([self._buffer.popleft() for i in range(n)]) + # We choose to use latin1 to remain consistent with + # handle_read() and give back the same data as the user would + # receive if they were reading directly from the + # socket w/o our intervention. + return chars.encode("latin1") + + def set_blocking(self): + """Maintain compatibility with socket API""" + pass + + def settimeout(self, seconds): + """Set current timeout on recv""" + self._recv_timeout_sec = seconds diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 041c615052e..c25f0b42cf6 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -26,6 +26,7 @@ import socket import tempfile from typing import Optional, Type from types import TracebackType +from qemu.console_socket import ConsoleSocket from . import qmp @@ -75,7 +76,8 @@ class QEMUMachine: def __init__(self, binary, args=None, wrapper=None, name=None, test_dir="/var/tmp", monitor_address=None, - socket_scm_helper=None, sock_dir=None): + socket_scm_helper=None, sock_dir=None, + drain_console=False, console_log=None): ''' Initialize a QEMUMachine @@ -86,6 +88,9 @@ class QEMUMachine: @param test_dir: where to create socket and log file @param monitor_address: address for QMP monitor @param socket_scm_helper: helper program, required for send_fd_scm() + @param sock_dir: where to create socket (overrides test_dir for sock) + @param console_log: (optional) path to console log file + @param drain_console: (optional) True to drain console socket to buffer @note: Qemu process is not started until launch() is used. ''' if args is None: @@ -122,6 +127,12 @@ class QEMUMachine: self._console_address = None self._console_socket = None self._remove_files = [] + self._console_log_path = console_log + if self._console_log_path: + # In order to log the console, buffering needs to be enabled. + self._drain_console = True + else: + self._drain_console = drain_console def __enter__(self): return self @@ -580,7 +591,11 @@ class QEMUMachine: Returns a socket connected to the console """ if self._console_socket is None: - self._console_socket = socket.socket(socket.AF_UNIX, - socket.SOCK_STREAM) - self._console_socket.connect(self._console_address) + if self._drain_console: + self._console_socket = ConsoleSocket(self._console_address, + file=self._console_log_path) + else: + self._console_socket = socket.socket(socket.AF_UNIX, + socket.SOCK_STREAM) + self._console_socket.connect(self._console_address) return self._console_socket From patchwork Mon Jun 22 14:31:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191349 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1101765ile; Mon, 22 Jun 2020 07:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6Qaud6torEZ5q6/SlUhgSZP0L1eGvNoazvTQk/KaOF30KB6qKEfQtIQ/UFlUVHXJ1O78N X-Received: by 2002:a25:3bce:: with SMTP id i197mr26913188yba.436.1592836700324; Mon, 22 Jun 2020 07:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836700; cv=none; d=google.com; s=arc-20160816; b=ayCEhLMRd/XzQQ0hBAt3X90NDCmaHda1EDSCwVISBe/PRlDCeLoIKVYPJkT9cpDfNd SJXfTmDCbZC0t0ndtebbtTascRkQ0j0wUxX7K9UL1pX6BwN8iqsLV8uouXrjYzYdGpVJ UsxiSUHCSvsDN0wguPeGKc7/ln73QlphKAp+EcIx/JLxLJZo3ebjB5YFp1UuxrAFueJb ljcNaGjvcOMZh+3BkJG07pH0owW7ybl3xRQUGw2N8c52jYP38cLib+NmfjJD2iVyMaru wvqav04OUp1RayNYY7pwetBpB/qd1qsWttRXtWCYocaGFsG9jF8gXwIQPmHz5Qfhv1Si 2yCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5xSn2L6kzBKcKjTR8zPwxbT757SBhdGuGZ/3k/jBdz8=; b=c6OS0vsSxCYX/AWsSU2LXFlXB8ZNp9HANmO3Ti+LmB9ERm1SywrDWr1lk5SYiDNEuz YY4suokqz0W1Ji3hRqvee6r6a2gppju9K68iphtS4sqX1TjcCCAiO/AD1WFekeuiS+Ec 7vujtDF3qE654JT2M/sSc01dzRX13Lslbhbp01Up3mEQNsMvJncam//gSdbTGMUzir86 HIdDDBTpea9bL3g4YFAmhytlDaaA8ggeeFiAcMvjHrshp1DszB3BSCF2ARI7gU5/nwrs FjJMb6MsU74pIBi03MUKToChpU+I576FkkJmxRhTvnXae/doIQITk0rwd5ZVK4f6qhki mmsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BXega6gZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y3si13412862ybq.160.2020.06.22.07.38.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BXega6gZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNaV-0006iK-PQ for patch@linaro.org; Mon, 22 Jun 2020 10:38:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUk-000706-IE for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:22 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:34983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUi-0005fq-FO for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:22 -0400 Received: by mail-wr1-x444.google.com with SMTP id g18so7858285wrm.2 for ; Mon, 22 Jun 2020 07:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5xSn2L6kzBKcKjTR8zPwxbT757SBhdGuGZ/3k/jBdz8=; b=BXega6gZk1JeXV23r9dnm+EWlgsnTwI+c2Cn8PsTqXzXZBRK7OryEEgFKbS88f++Un qi4wPrlPybPbqodl0zHoulHrnOP6NucY/wYw+489IqvBhnVZnV+2IFMb9k65s/qehRPC KD2DmtLLyGt8IwVr4VeI8pox1VDMDPETew9YBpCdH5OHNAt6xvyvpRmpwUiItyMwoYUx pRWVE3aEZ3ZhdmyAuqNbemj1Q6Er3uosxUBjaMDSy5w3mcKkCC4Q1+lAu5R7SQH9b8Ji P4y8jyD4N+4qgb3R1AWPNogaSDC5YfVAxR7Vb4MV+LNKA5Xrt5ID3uc+PNeI2PJyl7QF MlhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5xSn2L6kzBKcKjTR8zPwxbT757SBhdGuGZ/3k/jBdz8=; b=bypNgLB6sKTX3Pl/2cDA+4Ziq+y1sEVhZcoeIVkWlNRa+6qZI5f8BejSvMfDgqUJbV p73ksUVAU7ZyITWfPKHm2+6MqDkPXa9BcfvMFginBLN2J6sm0yPkvu12dHHJczQ66qT1 gqYAEh+VEP5uit9a0caKhyTXO3SA0/P/O0T7zR4A3KCDwSJTtCbyM3S4Z4iMT15Le31t IKKMYQeb9VrROxZHoQZxcS7ai3D+KuRuJa7iCFSqkcawmujujRrRQORz3c4fneTqrGY1 P1KnVebBQvY0R0Wq+YOn4E9vF/a1tHm13u9eu9xMup1MtGfwfVVB2NlSn9kzXW4YQxXS v94Q== X-Gm-Message-State: AOAM5329Yd0ig5TSKujW/RupTCvXlRcc3IacUC5A8bGdNz24zSXFxiIN wDYDPT2ZQE3UDw5d++P06idF9A== X-Received: by 2002:a5d:498f:: with SMTP id r15mr20672510wrq.175.1592836338920; Mon, 22 Jun 2020 07:32:18 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r12sm18115626wrc.22.2020.06.22.07.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BECA81FF99; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 10/18] tests/vm: Add workaround to consume console Date: Mon, 22 Jun 2020 15:31:56 +0100 Message-Id: <20200622143204.12921-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley This adds support to basevm.py so that we always drain the console chars. This makes use of support added in an earlier commit that allows QEMUMachine to use the ConsoleSocket. This is a workaround we found was needed since there is a known issue where QEMU will hang waiting for console characters to be consumed. We also added the option of logging the console to a file. LOG_CONSOLE=1 will now log the output to a file. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Acked-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-10-robert.foley@linaro.org> --- tests/vm/Makefile.include | 4 ++++ tests/vm/basevm.py | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 39f918a430a..f21948c46a5 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -49,6 +49,7 @@ endif @echo ' EXTRA_CONFIGURE_OPTS="..."' @echo " J=[0..9]* - Override the -jN parameter for make commands" @echo " DEBUG=1 - Enable verbose output on host and interactive debugging" + @echo " LOG_CONSOLE=1 - Log console to file in: ~/.cache/qemu-vm " @echo " V=1 - Enable verbose ouput on host and guest commands" @echo " QEMU_LOCAL=1 - Use QEMU binary local to this build." @echo " QEMU=/path/to/qemu - Change path to QEMU binary" @@ -75,6 +76,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \ $(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ + $(if $(LOG_CONSOLE),--log-console) \ --image "$@" \ --force \ --build-image $@, \ @@ -91,6 +93,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(if $(V),--verbose) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ + $(if $(LOG_CONSOLE),--log-console) \ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ --snapshot \ @@ -114,6 +117,7 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(if $(V)$(DEBUG), --debug) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ + $(if $(LOG_CONSOLE),--log-console) \ --image "$<" \ --interactive \ false, \ diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index f716798b405..04d083409a5 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -117,6 +117,11 @@ class BaseVM(object): "w").write(self._config['ssh_pub_key']) self.debug = args.debug + self._console_log_path = None + if args.log_console: + self._console_log_path = \ + os.path.join(os.path.expanduser("~/.cache/qemu-vm"), + "{}.install.log".format(self.name)) self._stderr = sys.stderr self._devnull = open(os.devnull, "w") if self.debug: @@ -271,7 +276,13 @@ class BaseVM(object): args += self._data_args + extra_args + self._config['extra_args'] logging.debug("QEMU args: %s", " ".join(args)) qemu_path = get_qemu_path(self.arch, self._build_path) - guest = QEMUMachine(binary=qemu_path, args=args) + + # Since console_log_path is only set when the user provides the + # log_console option, we will set drain_console=True so the + # console is always drained. + guest = QEMUMachine(binary=qemu_path, args=args, + console_log=self._console_log_path, + drain_console=True) guest.set_machine(self._config['machine']) guest.set_console() try: @@ -285,6 +296,8 @@ class BaseVM(object): raise atexit.register(self.shutdown) self._guest = guest + # Init console so we can start consuming the chars. + self.console_init() usernet_info = guest.qmp("human-monitor-command", command_line="info usernet") self.ssh_port = None @@ -296,7 +309,9 @@ class BaseVM(object): raise Exception("Cannot find ssh port from 'info usernet':\n%s" % \ usernet_info) - def console_init(self, timeout = 120): + def console_init(self, timeout = None): + if timeout == None: + timeout = self.socket_timeout vm = self._guest vm.console_socket.settimeout(timeout) self.console_raw_path = os.path.join(vm._temp_dir, @@ -578,6 +593,8 @@ def parse_args(vmcls): parser.add_option("--efi-aarch64", default="/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", help="Path to efi image for aarch64 VMs.") + parser.add_option("--log-console", action="store_true", + help="Log console to file.") parser.disable_interspersed_args() return parser.parse_args() From patchwork Mon Jun 22 14:31:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191352 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1103477ile; Mon, 22 Jun 2020 07:40:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8tG6DIfc7GR0Qe25K2hjZgSml0MVJgBI2FA/Kh1SjLn6gOljfpDwzd6V3Co8Rfp5GGb7R X-Received: by 2002:a25:d8d5:: with SMTP id p204mr27863694ybg.28.1592836837801; Mon, 22 Jun 2020 07:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836837; cv=none; d=google.com; s=arc-20160816; b=BC8kHgBPmcQM9hwk0/SRqUdc5hmlo2+UQSoCriK32f1vmcZvxn8TwPf6/Ry6DpBtCW a47DgtTtYhig/T+B32U1xk8nW+x1oYQRomF0XVq8b26XYjMwIXUuhAeZG2/VUc7Xh3AO 5IKDQfyFo9EvIUPVEFMWPTY3GeYTP6iYgH8EQSLcSHY19LE2jCD0JGGz3IImQdBZEWMM Se5/fj8fpJYeBVycy6XszbSFsqbKgoWFuxFL4ZQFbBbRN4I+RRNMwOF05s3Cx6BkaLT6 1Z616ETV7v78u52SaS+4AJDD2HX8YBjgmxScETU5Nk/P1SZ5G/GrOcaVSEERsDZ/Etzq qafg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bm2ly00woNerpONQhYQFASSG/lyJnzbAQIWgk91BqYY=; b=YgyJwmoLQUYgmy5IAQOPms4gDeYxkYOFTuKoLf6sm68nMGBA3KKXTUIyQiBGCzdN0/ SfKSE4gelDlwEv1RHvRcv7c1zadpG1CDQKgDgnW/C/ukEulYng9iXCHir4m6YyfVGGUA A41/2Vn9egp5YWiK07klWu+pwE1VAofjoGs3s3gkdbSKGDlkVoh9tE3m24RxsoPv0pvK jzOVQdSEpLMHYPUZb6agecIeLwBZZY5mP0N+64g+K4CEpuHbUxxsdZ/k/eRao3tqafoB aGKol9fzHJWLjpo7semIeeQkGPqOAoEJ+MrcHdegMYq41rBUqvcDHlv3697EVe2vpYHr Ykeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=suLiJ9lm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a143si14237371ybg.28.2020.06.22.07.40.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:40:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=suLiJ9lm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNcj-0002yH-6n for patch@linaro.org; Mon, 22 Jun 2020 10:40:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUs-000779-54 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:30 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:43134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUp-0005i2-7x for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:29 -0400 Received: by mail-wr1-x444.google.com with SMTP id l10so16921619wrr.10 for ; Mon, 22 Jun 2020 07:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bm2ly00woNerpONQhYQFASSG/lyJnzbAQIWgk91BqYY=; b=suLiJ9lmZh42KbF+odfoQ/v5qXCRBd4mfPOXB5jM8JurChsVXVLT9KSOuCKvxTGb9k ecDyC7Fy8rQ/BtQfkF6sfcPEC6pyOKtXnyZN7+Ji1dMGPhO2s+Y1gWoTptfS4Uaea/Nv G6tExBQxPC+2InuqhDLCS2WVtV2tzCOaM23VazYJxdIaipIQ4RNLy1AXhchJpb8L3HP3 d3vTwtyt/1Dt6xAj3rUE2xgn58eGpShmReYhso6o6Hkx8nE/T+FgZLM0QdrbcoUyU+OX o84dfaIb6D8/5OMCpLv1Y3WvjFOwYHBWbBnlh6Rs3dn6MmemT9MilQ56EkccN5jCow+K qyEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bm2ly00woNerpONQhYQFASSG/lyJnzbAQIWgk91BqYY=; b=PClAvGXCRlQK6N3QG/HeQlc9y9TYqR7KmmbvL2lSC7iyRUpgIgQz+qfX37DvqE40dY jQhjha9PW8dn9PBNhbRTXGAgMaIKRlT8gt0nesCZpmrNu6miDOM4vlwJXhDn0X85YKEi V47Z6a76opoWnY1/pk0FVn5rd4GdlQ07vk5812NqpakWvlkED8w8ay6hGzqjk4opkNVq COAtutGkHE96hULF709RmqRiGPhBnAno9Gwm8vT7TRUtUX9w0jmMvfYX/B56EB3hWIkn NZpSyu/brOs7nMscX5+8ANuw0Oj7ltgZpexQMTCcW5/FHc2rM92qXtFDGlkeU2RD8c2b X8zw== X-Gm-Message-State: AOAM53363X19MY2jNMuZNn8cjTQ1UPdNer4XbzRRF4EJtiYPfM/uFjoc zuKzh5S2znmA5VhHNN0Zg3ezBQ== X-Received: by 2002:adf:c382:: with SMTP id p2mr19131688wrf.283.1592836344914; Mon, 22 Jun 2020 07:32:24 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f13sm16667938wmb.33.2020.06.22.07.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D3BC51FF9A; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 11/18] tests/vm: switch from optsparse to argparse Date: Mon, 22 Jun 2020 15:31:57 +0100 Message-Id: <20200622143204.12921-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" optparse has been deprecated since version 3.2 and argparse is the blessed replacement. Take the opportunity to enhance our help output showing defaults when called. Signed-off-by: Alex Bennée --- tests/vm/basevm.py | 84 +++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 42 deletions(-) -- 2.20.1 Reviewed-by: Robert Foley Reviewed-by: Daniel P. Berrangé diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 04d083409a5..93859362606 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -23,7 +23,7 @@ from qemu.accel import kvm_available from qemu.machine import QEMUMachine import subprocess import hashlib -import optparse +import argparse import atexit import tempfile import shutil @@ -556,47 +556,47 @@ def parse_args(vmcls): else: return 1 - parser = optparse.OptionParser( - description="VM test utility. Exit codes: " - "0 = success, " - "1 = command line error, " - "2 = environment initialization failed, " - "3 = test command failed") - parser.add_option("--debug", "-D", action="store_true", - help="enable debug output") - parser.add_option("--image", "-i", default="%s.img" % vmcls.name, - help="image file name") - parser.add_option("--force", "-f", action="store_true", - help="force build image even if image exists") - parser.add_option("--jobs", type=int, default=get_default_jobs(), - help="number of virtual CPUs") - parser.add_option("--verbose", "-V", action="store_true", - help="Pass V=1 to builds within the guest") - parser.add_option("--build-image", "-b", action="store_true", - help="build image") - parser.add_option("--build-qemu", - help="build QEMU from source in guest") - parser.add_option("--build-target", - help="QEMU build target", default="check") - parser.add_option("--build-path", default=None, - help="Path of build directory, "\ - "for using build tree QEMU binary. ") - parser.add_option("--interactive", "-I", action="store_true", - help="Interactively run command") - parser.add_option("--snapshot", "-s", action="store_true", - help="run tests with a snapshot") - parser.add_option("--genisoimage", default="genisoimage", - help="iso imaging tool") - parser.add_option("--config", "-c", default=None, - help="Provide config yaml for configuration. "\ - "See config_example.yaml for example.") - parser.add_option("--efi-aarch64", - default="/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", - help="Path to efi image for aarch64 VMs.") - parser.add_option("--log-console", action="store_true", - help="Log console to file.") - parser.disable_interspersed_args() - return parser.parse_args() + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Utility for provisioning VMs and running builds", + epilog="""Remaining arguments are passed to the command. + Exit codes: 0 = success, 1 = command line error, + 2 = environment initialization failed, + 3 = test command failed""") + parser.add_argument("--debug", "-D", action="store_true", + help="enable debug output") + parser.add_argument("--image", "-i", default="%s.img" % vmcls.name, + help="image file name") + parser.add_argument("--force", "-f", action="store_true", + help="force build image even if image exists") + parser.add_argument("--jobs", type=int, default=get_default_jobs(), + help="number of virtual CPUs") + parser.add_argument("--verbose", "-V", action="store_true", + help="Pass V=1 to builds within the guest") + parser.add_argument("--build-image", "-b", action="store_true", + help="build image") + parser.add_argument("--build-qemu", + help="build QEMU from source in guest") + parser.add_argument("--build-target", + help="QEMU build target", default="check") + parser.add_argument("--build-path", default=None, + help="Path of build directory, "\ + "for using build tree QEMU binary. ") + parser.add_argument("--interactive", "-I", action="store_true", + help="Interactively run command") + parser.add_argument("--snapshot", "-s", action="store_true", + help="run tests with a snapshot") + parser.add_argument("--genisoimage", default="genisoimage", + help="iso imaging tool") + parser.add_argument("--config", "-c", default=None, + help="Provide config yaml for configuration. "\ + "See config_example.yaml for example.") + parser.add_argument("--efi-aarch64", + default="/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", + help="Path to efi image for aarch64 VMs.") + parser.add_argument("--log-console", action="store_true", + help="Log console to file.") + return parser.parse_known_args() def main(vmcls, config=None): try: From patchwork Mon Jun 22 14:31:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191348 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1101079ile; Mon, 22 Jun 2020 07:37:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAhpEyPTvpDg4ERHOR79Ai0Wrc+EMN2+/kvF77s7Y2SVk1W7mlQbcqZm3TXB/ly3Pbjybo X-Received: by 2002:a25:7ac5:: with SMTP id v188mr29196418ybc.237.1592836654101; Mon, 22 Jun 2020 07:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836654; cv=none; d=google.com; s=arc-20160816; b=wAlWLs6ji0Vf2mTNLXBMQqCxCnsCxUkhi2/noIc0uOBrA5kEGSWiPwLkC5h89/za+R w/otKA6KD72sAeN01p9ydpF7PCI1Z1Yhy8c227rSjCXGpHm7jQbwZ1zRev/i7zw7WFuW dRg+AsFTpYOdO0XYo7omxiyx0XTOysp1eqf0ykg4Sg5brBXWCoKNEjci8rcUTsxMprVO zjgpWdwqtAyzrz2qle5IpQptmfugfcIJVEkYK9tisylfy7jgXqIneyDrOqhWlTVaiTGf Vp4+urwk82IHRmaMpLeT+7lHiDWXkwyZ3CCj0Cq2jZl8L8yY9NDPfF4oylwE/BfzyXcO O9zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=1Wx+3OKlQnJklFN0bA9dHl2yXauQUDmxH1f7TXMpyuU=; b=gQL0RFD+PcvxO4ildqq5Bnbp+pNPvlz636pIdLLQj/4uoSc12iBv8InPwRQ3Rglqlh cXcaOPEc2+vWsgrf4hnsPcQfRNtDGWLgzqhxfEEM7sKLAjMzJGQDx1fjz44qPWe+ZAbL Su4vaOEErVDt5QXggwpg0z4JO4hSyhTcZoYsFC6WrX+WacaAMiou8geUB4JMPn+nTyJY tLPkHS5NKxDirGDVTDkR7EvRiNctjBF8KOJYXryfe9qmaTaDoYwJDFLUpZhdH7i1y2qH CaANbnev48iDpmeCHsSl1PqmI03MbSxJSDxk5BVIOK19WNeAlY1zGuXq9vzSI+LLQuD2 anUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rtxJco2+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 77si13202694ybf.251.2020.06.22.07.37.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:37:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rtxJco2+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNZl-0005bN-Jl for patch@linaro.org; Mon, 22 Jun 2020 10:37:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUp-000764-Hd for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:29 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:36488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUm-0005gd-Ki for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:27 -0400 Received: by mail-wm1-x341.google.com with SMTP id 17so1390750wmo.1 for ; Mon, 22 Jun 2020 07:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1Wx+3OKlQnJklFN0bA9dHl2yXauQUDmxH1f7TXMpyuU=; b=rtxJco2+yMnH4D5lvbxK8/HNQ0DDP3DXmhiFFU72dAsiu81+Vl7BIx/dnuho+GxfzA 5bCat+I0W4XlVntXEUmqM5Gfp5/Wc6odLJmsrlBRLTQBgbTIwNWS+h3j7x3QNC1H6tbF 0BTK/D7AuHdsxy2RUjXwtb2z/uhNKS6I8C8o29Us/NoafMjKYIcZaI7uQaPDyzBENoGl Xt2rHfZhgAdIzVaAMU7pRPQQfZzaTJMHCa6mC4QnH5o0EyUmL9sZutjFAzHUi2XjBjtA J5JD4uGDY+ULUFhDU/QMMswSiIAyc2jeFoZtnxlhvAEKYDEukvThTXpuOeEVK2HWWALV UEPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1Wx+3OKlQnJklFN0bA9dHl2yXauQUDmxH1f7TXMpyuU=; b=KPJbH0cpgXjowCk213HY33umOI7/MQbi5wucxk31rZbukq7oLrVXNLUOHJZOz3nLJq awNp9+yCzdtpvSnGFgF2iv0zlZl2sZnQbAXn9vPyd0h2JOYgFg2qWzXsqUcDwYy9SkDg MT4HGEOROTWzKqrJFhuFCx+DWjjtI7onniSHtaEFWvees4GizJuRJ4UjbxZ40B7bzJ3Z QUWQNqFTX/0PWDbtbliL0LWK98pxjtfaHVQMhUt4Xgl0qniwNp/dIxZGFjSCvAbHaBkd x5YO5PowDmT4jCJk8lmDB+07MQGA8abJfUkEE7p3X1pWTncVohCEQvyUUJWPPmIHiF+g Piuw== X-Gm-Message-State: AOAM531y1ibJ6j0qDOy2nAwlHs85hxTbVFI8ptob3XGNQT0gfY1hrngF N7Gc8LzXp0tpyzgfa1Z0lExRwg== X-Received: by 2002:a7b:c5d5:: with SMTP id n21mr18762611wmk.106.1592836342900; Mon, 22 Jun 2020 07:32:22 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a126sm16899979wme.28.2020.06.22.07.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E84121FF9B; Mon, 22 Jun 2020 15:32:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 12/18] tests/vm: allow us to take advantage of MTTCG Date: Mon, 22 Jun 2020 15:31:58 +0100 Message-Id: <20200622143204.12921-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We currently limit TCG guests to -smp 1 but now we have added some aarch64 guests we can do better when running on x86_64 hardware. Raise the limit for TCG guests when it is safe to do so. Signed-off-by: Alex Bennée --- tests/vm/basevm.py | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 Reviewed-by: Robert Foley Reviewed-by: Philippe Mathieu-Daudé diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 93859362606..dd96a6d4af6 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -553,6 +553,12 @@ def parse_args(vmcls): def get_default_jobs(): if kvm_available(vmcls.arch): return multiprocessing.cpu_count() // 2 + elif os.uname().machine == "x86_64" and \ + vmcls.arch in ["aarch64", "x86_64", "i386"]: + # MTTCG is available on these arches and we can allow more cores. + # But only up to a reasonable limit. User can always override + # these limits with --jobs. + return min(multiprocessing.cpu_count() // 2, 8) else: return 1 From patchwork Mon Jun 22 14:31:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191361 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1110908ile; Mon, 22 Jun 2020 07:50:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaS4olpAih9MCCV3DVx7e1kuBojBm9vK5Q6SumDafEK+YgVHH0FSjO4+F8yS38uU1vwUR4 X-Received: by 2002:a25:7bc1:: with SMTP id w184mr27506958ybc.240.1592837430599; Mon, 22 Jun 2020 07:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592837430; cv=none; d=google.com; s=arc-20160816; b=BPCXpddGTUKBiBSLWzkXM2aa7IqFucAZNJQLqs7NfXsmFszCHUwS/FChMdNFkEu0HX gLgIEAPgOaErEqGKtTVYG9poOMu6QDntpsP9Qmx0InvXMG/AZfn2m8Uinyi+/UfmJIg9 ZgvCqYTARpGYB/1YhLoYbcTfy4Jp3KHDR3tUg1X+swvOqsHP+hUvlGejkzWFGr4J9Ld3 0grtNXxkOSTSXcz/0JUZeshmZfsblsA7KA2Bh2WHwAd7sSAIYT92TQj6XorJqeLiXw+i 88ZQl/LB60QTuBNLXBWL0qac1X/QLyz57f/JgauElGIRrjaJI/d62yRzbx1vkA/i1y25 7KvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4LEU0pltPGXSZOYL7F80Ql3BPnvdmnM8vPzgdqbMG+Y=; b=d1vH1r3RQWSgc7iVC0JiPrjHVz5ubAzzchGjI28RjYTtztIStqekPEqPR2WjUKieoA 2sXkMYULS2twBhJMaf4t8ZP1QBWgtFHiWrJNJteB895wVCRS8t4K8Um1tvdCfmZSJvxP eoPd2DyiLEKYL7v0DKBk3waDomUq2R1UP0paG//WvXd0AB3aJ9amfQ1kU8RU2bwYTC4u GPZYLewnc4+U0XMtpSgYep4MFkAL7boSLCK2myKki0EEKckpngasPGCg+Q3kbqhLJMw1 NWe1paiECXN55a7ePJdx8e5zKYwpnJM+fTmsWgLE2W9w7dSQr824bVbk6GFRchyT3QKy dXyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ClTW9mEP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 8si12928902ybj.14.2020.06.22.07.50.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:50:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ClTW9mEP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNmI-00023W-3i for patch@linaro.org; Mon, 22 Jun 2020 10:50:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUt-00077H-70 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:32 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:37725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUp-0005i7-8H for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:30 -0400 Received: by mail-wm1-x342.google.com with SMTP id y20so15957894wmi.2 for ; Mon, 22 Jun 2020 07:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4LEU0pltPGXSZOYL7F80Ql3BPnvdmnM8vPzgdqbMG+Y=; b=ClTW9mEP2z1SuAZrbYrN4X2uyDDtTeaMHTMAuXtQb0dWLZ7UR/tU9sR4XnTOKCVcYo 10R5TGdKkfpm9h9E6Mfs7fRDDbZ8zKKrQ1e9EoxFYXA2HnkHhp+Fh9LY7dLVvFZgXmk3 nJ1xxev4DfzGB6vxdA4eQzrBQpS2xqN0hvGoeMCot1tAooqIhQ1m/M1NOtsPEBa9scpq 1WOMm6wEmF+E3L+7Tonqm+Y3ZD5KiQGTZrzLk5e4Yr8drt7+lBqQJJE6gs0PzhW+Qwih bwDPP3WPgmugRSAJ5vYid0YEMdFrJGEIVagVckv//ROeuvx9D9KQIKdfIg0QNCSYKjnW 2IwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4LEU0pltPGXSZOYL7F80Ql3BPnvdmnM8vPzgdqbMG+Y=; b=JMjQBW/Dqpqz+68gSwqK77cF7iefdGNFSVrkoe/72a1I6r1q9xFtDebYW0RQNRXlu/ icoJ3kL+Wd76tb/qiaVCcEfRgoSaJswXQCGMALsDduSBL9XDKavI31k+XfSD6Qg+LOVo c3UAJtygXgMQRGbKdRP6SbG3tQHQCdXWNMWn1i0EbXnsAtTe2XkBeXKM71sjPW0CRYU6 kfWgmpYTHWTC1WFuAuzDNUb7i6dVkAWZ1oQqy9qwyS/9kHHUxeoEXrYT8re/xQkTObtp jfg05iZNiUrE1Yb1+oJEWwpI3x3clwMsEsgoo42aUxE1A+hynRCMq6uv0gaigKf7urMM XWjQ== X-Gm-Message-State: AOAM531sN2V+Pmzn5/5DHEfwHgFox2eyY1kvewmKFqz91wqTYIYrjtIw uE1RR7JTFxhUQd7/Q4F5ILcWUw== X-Received: by 2002:a1c:2044:: with SMTP id g65mr20322718wmg.16.1592836345796; Mon, 22 Jun 2020 07:32:25 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g16sm12906153wrh.91.2020.06.22.07.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:20 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0A3FA1FF9C; Mon, 22 Jun 2020 15:32:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 13/18] tests/docker: check for an parameters not empty string Date: Mon, 22 Jun 2020 15:31:59 +0100 Message-Id: <20200622143204.12921-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reported-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- tests/docker/common.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/tests/docker/common.rc b/tests/docker/common.rc index 02cd67a8c5e..b27ce17e333 100755 --- a/tests/docker/common.rc +++ b/tests/docker/common.rc @@ -47,7 +47,7 @@ build_qemu() check_qemu() { # default to make check unless the caller specifies - if test -z "$@"; then + if [ $# == 0 ]; then INVOCATION="check" else INVOCATION="$@" From patchwork Mon Jun 22 14:32:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191346 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1100005ile; Mon, 22 Jun 2020 07:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM7zVtc/BsINYRbBacYp38vNjYAW4+4ZrNHT1JcoVcKGy90e+RnoDNk3qLI0DzIxhDSKlw X-Received: by 2002:a25:cbd8:: with SMTP id b207mr29820082ybg.63.1592836575483; Mon, 22 Jun 2020 07:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836575; cv=none; d=google.com; s=arc-20160816; b=wDd+t4uTAFwEzbNds/twnifS3/zck8cIKtI55uosf4A/H77U0kRw1V6EsbnHsYhFKH C0+jfMigIjllBvNLl4QSme5Dy+N54YncMYwoGPRdJ6HBT5FTG0ikJj4gN1FbA+B73ySn PLIeACYQJ3bm51+CV7VROZ4iUTX/AELwOaffODNF66GKwAEiMQe3GdHU31e4WD9UeO1b EOKv6TKMn75iklTbRzVhAAuqe2iZ+QHYl1S1Q9wsyQIrvCM2VjhmAeHEQ93/a7Yfa1VR MmZAVCsE0nnvohNjiLPLpNF/B+nczFvsM3145usP4lUkcVVnGCzKbKl8aF9TUvfBL/di 2aWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Teb5CYlwDix3ktwKyP7XUM4qHJXbLvwhht+HlFFEsmI=; b=lV62WAT6+fQ33tHEhUa4e8Ai1G6iYjG/wzRQojWJCXUr6y/0FBuEGrF5OdOy1yQSMM 9Os95w6sehC/LcqHi7qHPbX2GUOuW1oZSX+rhLmrUdznJZRtL53URKee2EsjEgBj8b2l Y4ThiMigh8JCQlO6HdyJQoAMwAq3bbHDr8KKYYRTqbMvuxmbnrcEIY9O4jFoS6DhEX0a dCpaTYLyBmfLWfrrfqaIlJ70F4NL4I4GpPMa0Sllhx3SdHuSPm7BoGK0Hvj5baIvUUEs PNR3OyVeasNSIbbAMBY7PVi5jEF0TPNYQLOeQcC8z1TvfvH2ErTAWlAYuSIIFpTDtmPP Iq6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DnrJMFhs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q3si13426715ybo.115.2020.06.22.07.36.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:36:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DnrJMFhs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNYU-00026g-TC for patch@linaro.org; Mon, 22 Jun 2020 10:36:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUr-00076I-2y for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:29 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:39469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUn-0005gr-E0 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:28 -0400 Received: by mail-wm1-x343.google.com with SMTP id t194so15955641wmt.4 for ; Mon, 22 Jun 2020 07:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Teb5CYlwDix3ktwKyP7XUM4qHJXbLvwhht+HlFFEsmI=; b=DnrJMFhspYGXqHtI5Oie2h43khYDeSShJ/ASj99kqUXnXBX/cETlxetXcgj17nod5w is1QW8XeORvhV7Gnm1RFLLxqZmCOKOjmkjvo8SesnixHQ7YDGLaQPcFsb0i+/2ksIyxF 9Rd6/q2HV3GoKtFhMB51vHWUm6US0MWXIwE8eSmvXedED4YNzNoIs2micQ96zEgDYnKz f75DpgBryD4TRqBJYgRO58b78QG0IoEZxIluiLRCcKdEr0FU4AjPOAGQIkFXYshPB762 OThE1n2uRBFKYmewvkxbRIABrXpFJiOUjaHt2mbqpfY4tcpGbj6Y9AVrdbcHKn6EULU1 oFCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Teb5CYlwDix3ktwKyP7XUM4qHJXbLvwhht+HlFFEsmI=; b=IE/7X07olQT2grONZu8kVwBl/LSrZSP1GKMxBst3vwTeJc1DjauSSZaIWVCSa4Maci ZoVaVmlrzkgKW1fbZ8Sy4zoxtABbXZvdIA16uSAGySpKszfaio3pUImL0n4uWu7XluLI G/cLHa9gRLhEEf6knN7edNOLFzqx8Mi4R/r0ZVEfClKX6A8KqFACyEnMiam9VUtz8cbp xGmmztI3/CXesnr7m6XdwhAleRwt5LXSGy3Ah3zG29grnV2mlwMaBAGiv9Ps8Mt4KqJ8 0tXy9lwf9n6dt4jdRrirwnwPuvtcNrveXff6P4j6WewqsdYBWUglVLkejBBV153w2yyF dWVQ== X-Gm-Message-State: AOAM533l5ZVVfdwbILO1rsXujRYt73AdhsRuYsgVI6zbAz62Ssq2cp+g P8Zui6Mmje9cETOPCqy1kvPFOg== X-Received: by 2002:a1c:2485:: with SMTP id k127mr16136950wmk.138.1592836343981; Mon, 22 Jun 2020 07:32:23 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 104sm18668728wrl.25.2020.06.22.07.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:20 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 204E31FF9D; Mon, 22 Jun 2020 15:32:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 14/18] .gitignore: un-ignore .gitlab-ci.d Date: Mon, 22 Jun 2020 15:32:00 +0100 Message-Id: <20200622143204.12921-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The sooner we deprecate in-tree builds the sooner this mess of regexes can be thrown away. Signed-off-by: Alex Bennée --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/.gitignore b/.gitignore index 90acb4347d4..9016ee0a0b4 100644 --- a/.gitignore +++ b/.gitignore @@ -92,7 +92,7 @@ *.toc *.tp *.vr -*.d +!\.*.d !/scripts/qemu-guest-agent/fsfreeze-hook.d *.o .sdk From patchwork Mon Jun 22 14:32:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191362 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1111593ile; Mon, 22 Jun 2020 07:51:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1IXExJC6WtaL3tqGLSaQHZua1stW64hadTjzaE8aeRCbk2I5+OWEyU0xk0bjoj1q6Ui4+ X-Received: by 2002:a25:54e:: with SMTP id 75mr27720093ybf.222.1592837480411; Mon, 22 Jun 2020 07:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592837480; cv=none; d=google.com; s=arc-20160816; b=GVduNYYgBj9Ias5senTLeie68+xTw72liG0bh/rSR35vgaQiZZ3uBw7j94B1StqFTH tKAACcoDYc92HOSbXgCjAOsoH63SFgNnwLuvAK2JlonGq2E798NM3VCAOCL+BafKrMiS 3mElXaUKAT8wuOa9OpdcfoXj6tf5jhKtc8bcpgbAFLBXaMGMYJJVHfrh4ZcBW45VImVC 2eBL3M49tT8DBqZCcPiM0APgQ+nufGJq+gsWYI1q2eK6lvO+w20iQyjBLA1DbX5IkhWK 2zCg6Ajk7E5oSRY1R471t7AFr1eTXVbwvy6smivM3vTp2IXr805XlzbPjxP+qHZRP25C jRCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=kpO6jorqg4gFYmKvuQF8bVTYfoSxIW2vkh7ytMeEuyk=; b=EtfjBepguINhNy7hG5ObgnJruWd6c8ywkQ4LT79mPe3LM8YosNGZXU8cZqlqauJXZs T3Bm8TfCjq4NzqSyrZhoY0GYtg8iMyfX+WbybbKWX9vwMG/+p3GrJT3/JFoBYIK0olhh /yvTFXQVXbPWFXU2iZECk/HA2umoxmKKAqOQelvxG5qrd952b+cEmoTWlgUSup4f0t4z k2M33A5ZRirCIe3vHK52lz68LONAXOKS7b57GZIBnWeQB/2eTt/nikyorZNWFn5beOO2 JsVF9TaZBgXpsTprDUEVjBSUNWCoQAw3HqizVP3pSCyRfJq0C7s/6r8T9NPhF0myh6j0 i7iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rK0ik3pe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n66si13917550yba.117.2020.06.22.07.51.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rK0ik3pe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNn5-0003Ch-RY for patch@linaro.org; Mon, 22 Jun 2020 10:51:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNZk-00061J-7g for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:32 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:36332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNZh-0006a8-RG for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:31 -0400 Received: by mail-wm1-x333.google.com with SMTP id 17so1410850wmo.1 for ; Mon, 22 Jun 2020 07:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kpO6jorqg4gFYmKvuQF8bVTYfoSxIW2vkh7ytMeEuyk=; b=rK0ik3peQ8vYDiJvOQixOTa6eSoI47JBg277LPIRPimM9dnIEzuHvdb97m9kkNK4+J BZqEGhD/2xQvsthTGuHxTYPmssYHb213SIHaF8gutSFE1RzHuLj8bX2LNdU2VtEBhcRS 7tFWzTTQ1Wj79dydAE+7oXghK/jwqyNmQ9VBL53/xVHTB8+ZyYRcV4CSDwPmCDX83cvF MjHTl/XsDhhK5E3rgE48W1Z2rKfQK3w486vuZtkV43jddT4pLVEjGD5g0fa+RqhOnmNy vutLqoSYlrjAm8ZM9QZ4wvGSq9a+snSgdb4pkyMoHcTZu7oxnh8JasiEdocKtJmK4QXA sEFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kpO6jorqg4gFYmKvuQF8bVTYfoSxIW2vkh7ytMeEuyk=; b=MA5JnXHtPeknz4jmTrPpYaeQ7u1ggpcNtNn6rnTOqhOZ6RLI4XkAsyCJZhg+gA8UyE uneMU+dU7R9WHwH7xY4Mc7yzUq937abC+zaJn3CVriqfOTGlRseUd1E8YJwjP5FWIeL8 /K3I+fcpqXfp27yzd9QorlWSGGA5IgkEnP9eFaPL6OHzlCrqpxzZpCJCaofbLqctz1zv chaaEho8g7n1mSgcqE3UDhNgbciH9Pf0uHeaORWOEyWa9z28n/5tsYUhAcN3Dse0J28l q+5dYIsjS9gQ+1ITJckqvOsORWikCIseyu6JR275+FHwcN1HspBu641EKWyDDAKMh9lq kDYA== X-Gm-Message-State: AOAM533M5duMzBi2uhrdyHhpxMd0sSGYVmid1y+kynYFZ+kPY2sBCwdy /Hs9hqBe9NFpfuhLb2lUmkx0zA== X-Received: by 2002:a1c:f203:: with SMTP id s3mr16955752wmc.126.1592836648326; Mon, 22 Jun 2020 07:37:28 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 138sm17498376wma.23.2020.06.22.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:37:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 36FFC1FF9E; Mon, 22 Jun 2020 15:32:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 15/18] .gitlab: add acceptance testing to system builds Date: Mon, 22 Jun 2020 15:32:01 +0100 Message-Id: <20200622143204.12921-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, Thomas Huth , berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As part of migrating things from Travis to GitLab add the acceptance tests. To do this: - split system1 into ubuntu-main and debian-alt - use artifacts to save build stage - rename system2 to fedora-misc - split into build/check/acceptance - remove -j from check stages - add packages needed for acceptance - add post acceptance template and use Signed-off-by: Alex Bennée --- .gitlab-ci.yml | 122 ++++++++++++++++++++++++++++++++++++++++++++++--- .travis.yml | 23 ---------- 2 files changed, 115 insertions(+), 30 deletions(-) -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 349c77aa580..fc3a561d9bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,15 @@ +# +# Currently we have two build stages: +# - build (for traditional build and test or first stage build) +# - test (for test stages, using build artefacts from a build stage) +stages: + - build + - test + +variables: + BASE_CONFIG: "--disable-docs" + MAIN_SOFTMMU_TARGETS: "aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + include: - local: '/.gitlab-ci.d/edk2.yml' - local: '/.gitlab-ci.d/opensbi.yml' @@ -16,22 +28,93 @@ include: make python3 perl-podlators perl-Test-Harness pixman-devel zlib-devel - JOBS=$(expr $(nproc) + 1) -build-system1: +.post_acceptance_template: &post_acceptance + after_script: + - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat + - du -chs $HOME/avocado/data/cache + +build:system-ubuntu-main: image: ubuntu:19.10 + stage: build <<: *before_script_apt script: - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev - mkdir build - cd build - - ../configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu - cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu - mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu" + - ../configure ${BASE_CONFIG} --enable-werror --target-list="${MAIN_SOFTMMU_TARGETS}" - make -j"$JOBS" - - make -j"$JOBS" check + artifacts: + paths: + - build -build-system2: +check:system-ubuntu-main: + image: ubuntu:19.10 + stage: test + dependencies: + - build:system-ubuntu-main + <<: *before_script_apt + script: + - cd build + - make check + +acceptance:system-ubuntu-main: + image: ubuntu:19.10 + stage: test + dependencies: + - build:system-ubuntu-main + <<: *before_script_apt + script: + - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq + python3-pil python3-pip python3-numpy python3-opencv python3-venv + rpm2cpio tesseract-ocr tesseract-ocr-eng + - cd build + - make check-acceptance + <<: *post_acceptance + +build:system-debian-alt: + image: debian:buster-slim + stage: build + <<: *before_script_apt + script: + - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev + libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev + - mkdir build + - cd build + - ../configure ${BASE_CONFIG} --enable-werror --disable-user + --target-list-exclude="${MAIN_SOFTMMU_TARGETS}" + - make -j"$JOBS" + artifacts: + paths: + - build + +check:system-debian-alt: + image: debian:buster-slim + stage: test + dependencies: + - build:system-debian-alt + <<: *before_script_apt + script: + - cd build + - make check + +acceptance:system-debian-alt: + image: debian:buster-slim + stage: test + dependencies: + - build:system-debian-alt + <<: *before_script_apt + script: + - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq + python3-pil python3-pip python3-numpy python3-opencv python3-venv + rpm2cpio tesseract-ocr tesseract-ocr-eng + - cd build + - make check-acceptance + <<: *post_acceptance + +build:system-fedora-misc: image: fedora:latest + stage: build <<: *before_script_dnf script: - yum install -y SDL2-devel libgcrypt-devel brlapi-devel libaio-devel @@ -43,7 +126,32 @@ build-system2: microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-softmmu sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-softmmu" - make -j"$JOBS" - - make -j"$JOBS" check + artifacts: + paths: + - build + +check:system-fedora-misc: + image: fedora:latest + stage: test + dependencies: + - build:system-fedora-misc + <<: *before_script_dnf + script: + - cd build + - make check + +acceptance:system-fedora-misc: + image: fedora:latest + stage: test + dependencies: + - build:system-fedora-misc + <<: *before_script_dnf + script: + - yum install -y python3-pillow python3-pip python3-numpy python3-opencv + python3-virtualenv tesseract tesseract-langpack-eng + - cd build + - make check-acceptance + <<: *post_acceptance build-disabled: image: fedora:latest diff --git a/.travis.yml b/.travis.yml index 74158f741b1..c24dfbe377f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -289,29 +289,6 @@ jobs: python: 3.6 - # Acceptance (Functional) tests - - name: "GCC check-acceptance" - dist: bionic - env: - - CONFIG="--enable-tools --target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sh4-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu" - - TEST_CMD="make check-acceptance" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-acceptance" - after_script: - - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat - - du -chs $HOME/avocado/data/cache - addons: - apt: - packages: - - python3-pil - - python3-pip - - python3-numpy - - python3-opencv - - python3-venv - - rpm2cpio - - tesseract-ocr - - tesseract-ocr-eng - - # Using newer GCC with sanitizers - name: "GCC9 with sanitizers (softmmu)" addons: From patchwork Mon Jun 22 14:32:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191351 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1103346ile; Mon, 22 Jun 2020 07:40:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9LOz+C7mGk7rOeFA9LKY4a/JdbtO0R/OD2jDAX4IAmk5dqRbU0m8sj8tBR03va2tft3/u X-Received: by 2002:a05:6902:725:: with SMTP id l5mr30550309ybt.150.1592836828148; Mon, 22 Jun 2020 07:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836828; cv=none; d=google.com; s=arc-20160816; b=a8ajA3wCY+XdJXVDyRwawuvTNgyHd/TCgQtzSHYaSexCoIjrN9Kv66zglBycUjrwQk 5umzFIIDzl0NKXimJzDnTnAQproiDp7MPnoeDSNk2WLovJ+uMOzXZGSf3Nt/kbCSHZia /aS5W9r4yWSYRHIo1yGIKeXh4R0z+m2psocAk6CT/LUa5J/yW21hFuxMmU0dh2L8dvpr nx5QBSmYc5xP1NctHyvwbpj4OU26uKG+3yVUnWNJ7O7dPt9YCewAE/SPcshEqrIujz1W j0v9CIAiIPJ15k9W7t8Rm2rPE7iz+wi+uQCn8cXVrRgZQKrGidecC3BWa+Ixp8N/rGxv UiWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=r4zwLgzQI1wdPNBnB1IfLtnWJ7YheiR6CeL9tVns6/w=; b=INSbLz8Esyk9HqcS0wkidBo1zJ7wwZtXqhabGrYgvtS9BXIo5/0H+hh306U7bpsAH9 AZ4P95Q5I2SI7xsup0YoK+XTOAisgfgoTV4b+Wm/YMvkdYwEMxsXf9WqZBq2pkEsWmEO 9P2F3encGOPKEKi0Jzn9iADLHElNCzHSfJok1zTaoSuvp8v0SOIeWaOsNyacX50grDIE 4mJMa7js1I1iblNM5kYaXxsPiJ1wzdMu3lKiVDmO6xsg4je8uUIZ4kLw0UiYisHT6/FB LiUsrLtuQZ5vkdA49W6tP6i5J6Mtt0kJVNHejAFCjF6WvopUWadoRzFL1vLuVlIQ3+QZ ++Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="TTGg/oHu"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c203si13849267yba.431.2020.06.22.07.40.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:40:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="TTGg/oHu"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNcZ-00019r-KV for patch@linaro.org; Mon, 22 Jun 2020 10:40:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNZi-0005xY-C3 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:30 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:38430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNZg-0006Zz-Lv for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:30 -0400 Received: by mail-wr1-x441.google.com with SMTP id z13so5177439wrw.5 for ; Mon, 22 Jun 2020 07:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r4zwLgzQI1wdPNBnB1IfLtnWJ7YheiR6CeL9tVns6/w=; b=TTGg/oHughCIbCBUy0ldQCAts8eXYCCTMrFM0zSPCYsW3XqYia57ITz/uM02j5gZ5g nUnWLThkc6sOTAcAUeRpFJjMo3/25+FY284/7m42dj+uLDz3FxEX3RpGs3ZSNd8WZFqf RSYX30whXPYz3e6mAcMATtqZo9CrOXIGivXu76Q1J8QZ53mACmIyUNBrJaXv37ALMob4 mLFY5koHCCl3qyAdqSyJE1sDl1wAxl3PQwbHAzh2euzd+/0BW1sNEufwcrQVVkpvaHIA BU7Y1Xawg+9IeqiOFk0eB577fUu8E2Ps8tKKgGVUPSWcLJ1kvHYKKoSVzGzdzqGG+GD1 Pt1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r4zwLgzQI1wdPNBnB1IfLtnWJ7YheiR6CeL9tVns6/w=; b=sSM+alH6G7fCyuHsuFkQLQzeQIQc0YYL4sGopMEgdTdMmdMxwySoVyJS8TRjA+i9XC g0dBkFg/60rpyJB1GJR6//fr/T3Ez4wd3HFLbxOzPKNRgp7kNNqsS3WAfCLHf4eQAfjq 50h/87xZVuiADiuX6M0UHfGFP6SeMLip8IA4oHrGo47SMR31i5osy45UNC9/nzLVAyEU oDPeH5Hp7JYREEwCuPS8IK7YcyuduBp/ZG3ebYYquPLT6V1FuqEkskMA1WtbC/eXC7CE lT6MzF9Yq+hBISY/l6+TOAjLKWcNGpcRr3rsNqZCpDeYN/HgvxMQ4Ik9HzXr9sQkL1Hg RDkg== X-Gm-Message-State: AOAM532wiYEmI8HfZxgQER69xtktHaEQtx9BRzBYmopXNryDYerTIOUq ZzXpydYOnImOxkyQhje+z6fWNA== X-Received: by 2002:a5d:4f09:: with SMTP id c9mr19019698wru.3.1592836646931; Mon, 22 Jun 2020 07:37:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 104sm18688389wrl.25.2020.06.22.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:37:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4BF441FF9F; Mon, 22 Jun 2020 15:32:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 16/18] .gitlab: split fedora-misc-disabled Date: Mon, 22 Jun 2020 15:32:02 +0100 Message-Id: <20200622143204.12921-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, Thomas Huth , berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As we run check-qtest in "SLOW" mode this can timeout so split into two jobs. Signed-off-by: Alex Bennée --- .gitlab-ci.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc3a561d9bc..5c863562913 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -153,8 +153,9 @@ acceptance:system-fedora-misc: - make check-acceptance <<: *post_acceptance -build-disabled: +build:system-fedora-misc-disabled: image: fedora:latest + stage: build <<: *before_script_dnf script: - mkdir build @@ -167,7 +168,19 @@ build-disabled: --disable-vhost-net --disable-vhost-crypto --disable-vhost-user --target-list="i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user" - make -j"$JOBS" - - make -j"$JOBS" check-qtest SPEED=slow + artifacts: + paths: + - build + +qtest:system-fedora-misc-disabled: + image: fedora:latest + stage: test + dependencies: + - build:system-fedora-misc-disabled + <<: *before_script_dnf + script: + - cd build + - make check-qtest SPEED=slow build-tcg-disabled: image: centos:8 From patchwork Mon Jun 22 14:32:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191356 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1104999ile; Mon, 22 Jun 2020 07:42:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSCQhCLQLNMey10/cA7mcpzHFfnxUrqFGyI5NZSwRcAvni69Nnv/pbRic6sObxFhOVXeL8 X-Received: by 2002:a25:ce84:: with SMTP id x126mr27850949ybe.15.1592836958752; Mon, 22 Jun 2020 07:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836958; cv=none; d=google.com; s=arc-20160816; b=qD7pFPERDcT3oVWpS9g356f3ghzbQNyeftj96gPpUwJKNUiDH4lMY/FMoxxqe0Wjoh LLYN9x4KQ42TW1Klr6IwBMe8i/Cw3LXC6WyXOaMzurxbmrDFs1j/z6/1tdNV+HW8H5mi Iegn8PDkQNg/lmaElUzUQnE6Z1yR/JwG/ERZa7MbdcfFDzCXa1HkaX2ZjLXHmrolOiel ZpZWtnyE6trZhv5HHJ6ZMgZmhp/hvVuE8/3/bS43ac8oYflZoegTcMsgjQ+Sh0A2I8Aw Gh8ufU9zcmJ+q3eJ6Oq8NZI3+wPGHVeUHYUmSH20ShinKVbhtjGc7US4CbYXdeDEpdnO Mv7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=PKCEcn+mdLK6k8p8iASrc3bnXSABtH0c5K5N75Qwt4o=; b=GaOUtbtltAfQ3nYGZhJlxS/s1l8gd7HGI5rgCTYYsmPI1REHHcPu9pWuJ7DrQTyoV+ knoVnhaNZyEHX9I+arlemIGbbkAAjdCoGT1Kqgeal9qA72YajlV/ME2V0AXA91+/9jmv bTitVziCorNTwsuLEEqcYeOwbYErpTRC0c4WNVDzl7nsg0VSFudzbSe5SIqP1BlhUa3S CKM0+ZM6kDV9spG2/hA2DSjoWUYPSRppcFHUxc2C2WWxr3RYUIKaAbIiZbSFzHx9IXEB sX4mQbCaw/BQOHLpB2LktS01LHIi//KujkW/FIVGBlQOm+Fx4ZXlclHN8/mayw+6nKNs 6s8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xt3wuFU9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e9si14132967ybp.419.2020.06.22.07.42.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:42:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xt3wuFU9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNeg-0005A5-6F for patch@linaro.org; Mon, 22 Jun 2020 10:42:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNZj-0005zx-K9 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:31 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:53324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNZh-0006a3-3Q for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:31 -0400 Received: by mail-wm1-x344.google.com with SMTP id j18so1567841wmi.3 for ; Mon, 22 Jun 2020 07:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PKCEcn+mdLK6k8p8iASrc3bnXSABtH0c5K5N75Qwt4o=; b=Xt3wuFU9VYYO57XBATug7KkGFR2WUZkBywG9zvvfEhAbdAKGYWym2KV5aH4mzB8ei1 V2MuzC0FxrXxRoq5uMTT32cW+67JzEFFym4GssWW/r9ec199qvy7y82nU4TbKI+AdYaQ pqFcpLGCf+Y3pAQRMGw2giREW/xodO/dHGtkHjCKn9LDLrARQB5rXUb36L5DA8zNGVXu jS1FG40A0VskJ8dnrkaPDg/zpGYq0g1JhBsRsnl8UvcKdi72PNHERxiQ6aP51juR8p7m M3ids8X9geaMb9+fukRlaJTURLOxF5ZhF0MvKJxkYv4+TelvLrG4Vb3jy3co3HcXd6Or x0Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PKCEcn+mdLK6k8p8iASrc3bnXSABtH0c5K5N75Qwt4o=; b=WRntHPWz/b3CuJNPdZ0g6lXZ72VMf2OKcYq5I7kylWzpLhUbpU1t8sUl9yVh/WcXmo ENkeIHTomB3dUOB4JUlkcCPnn2DbBNSEuwBvU6AlqQ9+l10tQnJDtbsnKsJgbSToxFxL MiYPgn8B56jJuYMOgkwXU1qwKoL+gxYaywGT8UnmOx6lJMMtTpQIy3j9giAxbiVWuWZM 2WP1Uh2Kr+pgR0DTywkKTbD3NsTluzSsUaeHh8ac2i+RV7w2IaFeMQG3f0NAgRVouYYN 7kz9czlnTVVh35hf0AoaeG2TClBletuhAXr0q4lVevaWFoaMldpw0NIkeKY8UkGO9orI eWkw== X-Gm-Message-State: AOAM532czPE/d+2OCFALhtNWTAfs3GnnjSOdz6nwABXMRbAqp8qgqmyd JOeVkxJDyW2J40d9uj+kzcUkNg== X-Received: by 2002:a05:600c:2294:: with SMTP id 20mr19658763wmf.51.1592836647516; Mon, 22 Jun 2020 07:37:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t188sm17525834wmt.27.2020.06.22.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:37:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 631D01FFA5; Mon, 22 Jun 2020 15:32:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 17/18] .gitlab: tag remaining jobs as builds Date: Mon, 22 Jun 2020 15:32:03 +0100 Message-Id: <20200622143204.12921-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, Thomas Huth , berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Technically these are build and test but there is no reason they need to wait for other builds to finish to get going. They might get split latter if the job ever gets too long. Signed-off-by: Alex Bennée --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c863562913..7816f1434c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -184,6 +184,7 @@ qtest:system-fedora-misc-disabled: build-tcg-disabled: image: centos:8 + stage: build <<: *before_script_dnf script: - dnf install -y clang gtk3-devel libusbx-devel libgcrypt-devel @@ -203,6 +204,7 @@ build-tcg-disabled: 260 261 262 263 264 270 272 273 277 279 build-user: + stage: build <<: *before_script_apt script: - mkdir build @@ -214,6 +216,7 @@ build-user: build-clang: image: fedora:latest + stage: build <<: *before_script_dnf script: - yum install -y clang SDL2-devel libattr-devel libcap-ng-devel xfsprogs-devel @@ -228,6 +231,7 @@ build-clang: build-tci: image: centos:8 + stage: build <<: *before_script_dnf script: - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64" From patchwork Mon Jun 22 14:32:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191358 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1107088ile; Mon, 22 Jun 2020 07:45:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/BMkg6JS+wCy3iakPnxwiSjG7rfyl7kxhd7n3f+Cj/JiVD6ppxt+kEQ0as03Oer9+ohH0 X-Received: by 2002:a25:8b05:: with SMTP id i5mr26894669ybl.301.1592837130318; Mon, 22 Jun 2020 07:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592837130; cv=none; d=google.com; s=arc-20160816; b=qBWOr5+trCgC7GxwCaG9F9Uq0RCY4lGehSFbM+mrR+9JYRMK/6xPAEE0CdZxEG7cNZ sXNH975Ai8iuNuaevviX7KatT+GCPeTNzyatL4wBPpC5CJHpVsSWoIBrJtYcYoEGVaGG 9XxprZ1cdwqI/mg8KeBum0XREpNJJArQ7JOBOwmgRa9tCSXJo9nJi0PcYKYfoY55U7E7 CpzTXfCOLB6k0RxHnuQ2d2AV5lthw1ZRrhw/2Xyw/rwngS76b694tHAl6TvJ91bA8rOW jyP2WkwtmvRJy8u83eyJVBRQKTWLw7T5j9PbWx2/DURlznjAZEQXVHXRXBtXa8ftdCA0 4zXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=dpnea5tgBr5eCnz0xsYvFDQLPTuuc6m9Mmvt4C1s0eA=; b=kYzSe060uQCM9DLwe8suf8g47z3UyrIYZU2rZTGlyVCwPsqOCYLOyrU5i0RpkKLcJ7 LEsYzCFi6eTG/7kAYex19Rjz4GaH+WVfpeNrz8Ga32GVYMpEDfznrcszQhP8+M7xa+Y5 v5Zo1dgpxeJ3jvhpdQLFoegv368ro/yLp82q9g/pwMeMxtdLFm4IqLdV1YrOXXy4xbTO VplP4kXikp6Z4mRH27tn0M+Id5ELCx7cpVl/1A7VJPFTNPmlJmwIeM+AnJVgGp4A9bH/ a8Bv2njpM6Cla8sWw+RJQWE1K9eBfoG63yaZPnf0O2PQsU5+Ktm2nXgtdiGglK3ceZ9K kNCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZolPyyYC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d3si15955938yba.205.2020.06.22.07.45.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:45:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZolPyyYC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNhR-0000xF-Pt for patch@linaro.org; Mon, 22 Jun 2020 10:45:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNZk-00061t-Fy for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:32 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:54949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNZi-0006aE-QY for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:32 -0400 Received: by mail-wm1-x342.google.com with SMTP id g10so15103237wmh.4 for ; Mon, 22 Jun 2020 07:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dpnea5tgBr5eCnz0xsYvFDQLPTuuc6m9Mmvt4C1s0eA=; b=ZolPyyYC8yN8buNdSKVSPpCvndq4fcDi/bkkH/ySGqrvTH6Ji5bNgJfoaCKt/RAlym s5ZAO+uDpKG7X3oWldfHi9WVN9eedlxqTDsCN4RgiBV3SV7nWoMLbkAkbHf3XAib7EnM Dgqo4qNAinkcxuifhFOsENeZQzIIwWsQVDMyNYQjQyoP1bL/3XhGRFxn/B/fZCzwctA4 fG2d5/LeKRUJzlmXn+URue0XBSpqKjGPVXJeQlY7KXRoRJKuEA1ESnIYJxx7xVLlbc1i JvqbHaREqLUYBDyCXsrNpxnkkVSGcdIa6MJzdKFqvpoh7EHh718QrhO2bBczzzsRlu1N LVeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dpnea5tgBr5eCnz0xsYvFDQLPTuuc6m9Mmvt4C1s0eA=; b=Lmxsd7VDA3fUB0Ga2iVnxcC13nh/nHU6XVteI5dT/MagVB99e+FndWId81UtfywlGS LyKBbdhWQtnW0oygiNi6AdE+IoaYb40zOB8VvCOLma3gU+yv/XVzfQ3aC6ndUOrAChhz dfZuHvHz5Kv4VgPEfgX2t+OdGeKMJezqijXbPgG9kfnYaxZ7bkTxKN9Dov87Msibm3o/ M0a8uO8ccZ09wYttNaWjkUcSf5XXlIJyf7iNpbowUCb87OKOmCIBYlohhSqblp6SmOa8 TD7/lWwOrl7NR3j8epux1Qw80SXdcoa+A7ZiN4iEzvTlI1WqkZP/LLNc45gBpsOFA7dD LjVw== X-Gm-Message-State: AOAM533p0UxUl5cYQ/oYcu0aRAmn2DUFHlUcDwFpHGMR0hIj7yXnI3A9 wtQ3poaFMJgBqyU54R+Bo6qWlw== X-Received: by 2002:a05:600c:2307:: with SMTP id 7mr5775371wmo.115.1592836649483; Mon, 22 Jun 2020 07:37:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n8sm15088881wrj.44.2020.06.22.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:37:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7939D1FFA6; Mon, 22 Jun 2020 15:32:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 18/18] .gitlab: add avocado asset caching Date: Mon, 22 Jun 2020 15:32:04 +0100 Message-Id: <20200622143204.12921-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: fam@euphon.net, Thomas Huth , berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These can be quite big so lets cache them. I couldn't find any nots on ccache in the gitlab docs so I've just ignored it for now. Signed-off-by: Alex Bennée --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7816f1434c3..693ecad770f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,12 @@ include: - local: '/.gitlab-ci.d/edk2.yml' - local: '/.gitlab-ci.d/opensbi.yml' +# We assume GitLab has it's own caching set up for RPM/APT repositories so we +# just take care of avocado assets here. +cache: + paths: + - $HOME/avocado/data/cache + .update_apt_template: &before_script_apt before_script: - apt-get update -qq