From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7188033154287927296 X-Received: by 2002:a05:6871:2598:b0:158:3f08:21a1 with SMTP id yy24-20020a056871259800b001583f0821a1mr1807916oab.45.1673594385392; Thu, 12 Jan 2023 23:19:45 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6808:499:b0:354:b362:347f with SMTP id z25-20020a056808049900b00354b362347fls1354066oid.2.-pod-prod-gmail; Thu, 12 Jan 2023 23:19:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXuM60Di3xl6DBsLlWQ1rfs6+V3YOMpmHCvpa4hiwILgDhwz2+mdOIFAHrpUpAzFXUnHeNzV X-Received: by 2002:a05:6808:16:b0:35e:9270:7b0e with SMTP id u22-20020a056808001600b0035e92707b0emr36616828oic.29.1673594384724; Thu, 12 Jan 2023 23:19:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673594384; cv=none; d=google.com; s=arc-20160816; b=uzZ2ZBujQGnN9z3mjzgaxFKqMk5bjwBieS0xFxvWODB5hdi+5BCeJm5fRu6K4Hi0HV lTw1sXU6HjTKknuULjClTIA7QeGxjiursgMRc4CBqxhZjCII30Kgamgoec2Vojl/0Kob ep1QW/05w5MLzAa5IyJn+ag1CkzJN346gDzcU2VBKp1Jwgep/8LjGC7mpwbAoGUpesJr 6hTcYZQ59N4TR9jX9ZrWfIgosYg301hlAAztD3TYlZ87I/c6q17EVzE7z2lNDbIlytTt 3p6uC2OyOEv7oRil0WMeAm9DHxAZO1s5JzSJ+S4+hAQ4eqtpjFxhPjfTEBpHG12f3Nbj D4Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from; bh=DhF+ZmnPtxKiyq9pkSya1L2HiWiHEAKQw0Q2RJYngRA=; b=vwjLsL0lTHzQKOTmHRv+GfHzQQkqNKW9yKbk7dcfzfGonXRqAPyEWD9lw3UcKVBUXp +Gjfd1nPQjJCZQVW08TWip87KxMKYbHvJ+olI7iQq4aqmziG21q6GD/H0cZH5O9SmBzB pWgMmic/LpM0SWAFbLzCicCYqB/n1QBPjP1YyH9nG6fZWhnVoVBLMehavsU1n/z8TC9w VjvJcxsljaiq+gvfMCmYZTI9HAhEGfVNK5nQ3rfSWCS4cjMcVejh9irUszfMKnN6JRnh Wk8PpgmqWNstlJOamippeHH7JR+YJKf9dATMO7HU7VWY5zZfehJZofCKR3qw6jZuHsdo Axgg== 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 e19-20020a544f13000000b0035c06b99516si2383871oiy.3.2023.01.12.23.19.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jan 2023 23:19:44 -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 30D7JgEo027786 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 13 Jan 2023 08:19:42 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH 00/11] Support running custom commands in VM Date: Fri, 13 Jan 2023 08:19:31 +0100 Message-Id: <20230113071942.22506-1-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 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: WJiqFXULo1yH VM run tests implementation in Isar testsuite allows only parsing virtual machine boot logs, so the functionality is limited. This patchset implements running custom commands on VM running in qemu that allows to implement any custom tests. The concept is the following: For running custom tests SSH is used. So: - SSH server on machine should be configured, so `sshd-regen-keys` package needs to be installed in the image. - Ethernet interface on machine should be automatically brought up to make host-to-vm port forwarding working. - User in VM we use to connect via SSH should have public SSH key in his `~/.ssh/` directory preinstalled. - Since base isar image don't have this included, custom image name for vm run tests should be supported. This also allows to make reusing Isar testsuite in downstream simpler. Uladzimir Bely (11): testsuite: Fix failing hostname service in qemu guest testsuite: Allow custom image names in start_vm.py testsuite: Fix terminal broken after run test executed testsuite: Add SSH key pair for using in CI image-account-extension: Add copy-ci-key flag for user meta-isar: Fix PCI bus initialization in qemuarm machine testsuite: Use random free port for qemu SSH forwarding testsuite: Support running custom commands in VM meta-isar: Use a separate image recipe in CI isar-image-ci: Make ethernet inerface auto bring up in ubuntu-focal testsuite: Run custom commands on some qemu targets meta-isar/conf/machine/qemuarm.conf | 2 +- .../recipes-core/images/isar-image-ci.bb | 38 ++++++++++ meta/classes/image-account-extension.bbclass | 14 +++- testsuite/cibuilder.py | 69 ++++++++++++++++-- testsuite/citest.py | 72 +++++++++++++++---- testsuite/keys/ssh/id_rsa | 38 ++++++++++ testsuite/keys/ssh/id_rsa.pub | 1 + testsuite/start_vm.py | 31 ++++---- 8 files changed, 230 insertions(+), 35 deletions(-) create mode 100644 meta-isar/recipes-core/images/isar-image-ci.bb create mode 100644 testsuite/keys/ssh/id_rsa create mode 100644 testsuite/keys/ssh/id_rsa.pub -- 2.20.1