From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7197811629045579776 X-Received: by 2002:a02:a898:0:b0:3c4:8532:71b with SMTP id l24-20020a02a898000000b003c48532071bmr105622jam.79.1675871117064; Wed, 08 Feb 2023 07:45:17 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:88cf:0:b0:6c0:1c0e:f3d0 with SMTP id i15-20020a5d88cf000000b006c01c0ef3d0ls3785744iol.11.-pod-prod-gmail; Wed, 08 Feb 2023 07:45:16 -0800 (PST) X-Google-Smtp-Source: AK7set/wwzTqVjSh6R7MpW4awT4P4ZL1HUGnHqOGLXZYhTll/vuw20iAUiwOMeBN/MhWJqAzd1vd X-Received: by 2002:a6b:d919:0:b0:734:e7c0:2058 with SMTP id r25-20020a6bd919000000b00734e7c02058mr4786657ioc.9.1675871116561; Wed, 08 Feb 2023 07:45:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675871116; cv=none; d=google.com; s=arc-20160816; b=bJ362vo7+mKHObMEHZunyIGDZFD5p/1RhX817Ch2L9jSvvmgcbT1k9RM/yvenZky9j 1QDijGFYGGB00CWzuhsNFCFvRv4EyeEXwwwvImUI17j2FMZaKS6SnrWcdan+51ftSGcg FCzrIOBu+pDATukkPoz9ulmxQ5CCiuFQUirHkTkCcg/iHA4BpoCXG4Fz/eJ/Pg3czH6b amIV0SEh1eHBBdP02OXZUq388t0Z4fnlslPr3bFN04rVngHm2NZ/Nsaf+dMASvi1xy+Q DIDljQSlhkdcP72OYthjAxo5jqxco0zXKWq7fdubI88eVnczoyeLnLjTwpo8SQsLcciw S5vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=maxvaTY2jqlCe4VWMjpcJdc1AdJrtiyOVpLDtu827Dw=; b=K9yJ6/sQnUwjlgU+KcwwjmsStIfc92q7aanpOBSsHGLpAM7JEOzkEUqpt6FtD7lczJ ET7g+5a88CpOT4HGWSDA9Bn4wCur1EMz09e+QMJww6lxGxC6BRQXdh9kqvDyg04fMD1X ZMngDifCqGyyVO+jqjylAVSgZ81teYIBeVDwZtnsYFJFx32v+knwWpg4ioVpfJbEBLqQ SUoXiv0TqhbWRuMum/pqZaR3Yje0VHMdnkLWTCFRp5JFCEiNDF5sTpvG42r7vg5F++vq drOTBG/NQhHEi2fbWdLXUts2/qaEH6s+9AmUe6ACC078nbRxeLqfxNVPLgrxcnliJsOf Amkw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id cp5-20020a056638480500b003b1f379322esi1728455jab.6.2023.02.08.07.45.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Feb 2023 07:45:16 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 318FjB52015298 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Feb 2023 16:45:15 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v2 9/9] testsuite: Update testsuite qemu-related documentation Date: Wed, 8 Feb 2023 16:45:11 +0100 Message-Id: <20230208154511.1884-10-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230208154511.1884-1-ubely@ilbers.de> References: <20230208154511.1884-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: HEJ1hX8+Sp6G Added examples of avocado tests that run custom commands and scripts under previously qemu image built. Signed-off-by: Uladzimir Bely --- testsuite/README.md | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/testsuite/README.md b/testsuite/README.md index 4f2a8da8..50698da5 100644 --- a/testsuite/README.md +++ b/testsuite/README.md @@ -48,6 +48,43 @@ $ avocado run ../testsuite/citest.py -t startvm,fast -p time_to_wait=300 $ avocado run ../testsuite/citest.py -t startvm,full -p time_to_wait=300 ``` -# Other +# Running qemu images -There is a tool start_vm.py which is the replacement for the bash script in isar/scripts directory. +## Manual running + +There is a tool `start_vm.py` which is the replacement for the bash script in +`isar/scripts` directory. It can be used to run image previously built: + +``` +./start_vm.py -a amd64 -b /build -d bullseye -i isar-image-base +``` + +# Tests for running commands under qemu images + +Package `isar-image-ci` configures `ci` user with non-interactive SSH access +to the machine. Image `isar-image-ci` preinstalls this package. + +Example of test that runs qemu image and executes remote command under it: + +``` + def test_getty_target(self): + self.init() + self.vm_start('amd64','bookworm', \ + image='isar-image-ci', + cmd='systemctl is-active getty.target') +``` + +To run something more complex than simple command, custom test script +can be executed instead of command: + +``` + def test_getty_target(self): + self.init() + self.vm_start('amd64','bookworm', \ + image='isar-image-ci', + script='test_getty_target.sh') +``` + +The default location of custom scripts is `isar/testsuite/`. It can be changed +by passing `-p test_script_dir="custom_path"` to `avocado run` +arguments. -- 2.20.1