From nobody Wed Apr 2 02:03:24 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1569521294; cv=none; d=zoho.com; s=zohoarc; b=aKELVy5OHT9GOXueOVSQ5k6zmeE5z/vYpW3l9hQCVwEEpWSKp3wKPuO2pBkHlwMVyUWgRTtj9ylLK72FlKguz6Gr3pVxfOv1oUB0OVnqERrcwlLBv/diSFUe1Tfl6L8HeqRMZFB/lSuFWuw8XWUv2YAWRLbHYcYSDUVWj4ZD9O4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569521294; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Z54O11bD1AbofRei7LiG1f1sZB2nRqAkLzkY3rTTmZI=; b=XXPFV8Xv4KdE/NVfO+JvKsOEhs9acN4tIGYvZvr3/7wbvzM3rKfvq57hFYRLBsy8tfDVJcI6yXf6A94njwDMpJdOZwZMqE8VyTJYuvnP//K7Q4D65RUSYdxLEexz7iztF56hSwIb9wjYgZYNAfR2TdudVcTXt9VeWsFqPw2Rpz8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569521294990203.1853071434498; Thu, 26 Sep 2019 11:08:14 -0700 (PDT) Received: from localhost ([::1]:42030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDYBX-0007m2-6F for importer@patchew.org; Thu, 26 Sep 2019 14:08:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59113) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDXgV-0004lz-9B for qemu-devel@nongnu.org; Thu, 26 Sep 2019 13:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDXgU-00037J-4h for qemu-devel@nongnu.org; Thu, 26 Sep 2019 13:36:07 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:33347) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDXgT-00036d-V9; Thu, 26 Sep 2019 13:36:06 -0400 Received: by mail-wm1-f66.google.com with SMTP id r17so7136180wme.0; Thu, 26 Sep 2019 10:36:05 -0700 (PDT) Received: from x1w.redhat.com (240.red-88-21-68.staticip.rima-tde.net. [88.21.68.240]) by smtp.gmail.com with ESMTPSA id b186sm9918980wmd.16.2019.09.26.10.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z54O11bD1AbofRei7LiG1f1sZB2nRqAkLzkY3rTTmZI=; b=t7wXGZvq12V5hEcgfvWVIZ+8SGse2gghokboAfHp0r+y6hhBb7A6uUVCAUdjhkDuOJ f2H0Zwf7hpMlRI7IyR4roEyhRs21f/LUXCd3wPGbFioe4Ii5uUe/t247FcsMbTMDJf9G wDEd9bgC7FXkFYJe5L+eYClcAcfxPH3DERjK4QelVCp24B+tQmg8/DeuK2FSwUuwoOGv LGv9NdF0hW0BjD/XdEgRn9EjN8GZ4yZ0MM/akgUq+Pu5k0FA/t7pOkYY/Ptqn17C6U1c unKCATtFbHK91Udn7J5rCbRMoLfKbfJvZkBNENokX1ZLDFz+MVqeuN51GanpmpYm8jXW p/mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Z54O11bD1AbofRei7LiG1f1sZB2nRqAkLzkY3rTTmZI=; b=cDVMv8GkPAcYxaG3dkZOnXUgS3UWa3q8ypfhT7tLWLxhwp8aUsIVPfzcoTugrfp+j3 DZQrEIZgQPLJ1LnKCK2gfTJiYCDuYjQbVWgHgX5QqAMgUeO9jJYh2pNipCMRdg1FIkl9 tVZ/NsndvX8OO8dGF8uwkxKWqr2d0R+PuJKP8T2I+HwUv3K2H8lfXkNCAsrE1sAS/tsx W1/0CX+/9wNl7csIDGOTiNWWwOnUen0md3edxna9dFEK194OafMjfPgg+9kwq25h6x+3 F1dN1fpcx+adBLyzsMpyXStAjrgAglszD/2w+3fMqrO0FXHU16PqQPlJjaliUNllc6Rj TM6w== X-Gm-Message-State: APjAAAXkkYAv/nvuV+3l6C+slXmAbuJ50VjQOoWtjPmfPk38Z7a797FR wr7uCMeXdGyve11N8yq9tSVjMqosV6U= X-Google-Smtp-Source: APXvYqzyJvZSIbnP9uUtga136B5UFGxyORKIr07OuneVC0JWA5G6Wf2m+c89CBudBofQo57In7+BPg== X-Received: by 2002:a1c:1981:: with SMTP id 123mr3901961wmz.88.1569519304847; Thu, 26 Sep 2019 10:35:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 15/19] tests/boot_linux_console: Extract the gunzip() helper Date: Thu, 26 Sep 2019 19:34:23 +0200 Message-Id: <20190926173428.10713-16-f4bug@amsat.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190926173428.10713-1-f4bug@amsat.org> References: <20190926173428.10713-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.128.66 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: Peter Maydell , =?UTF-8?q?Zolt=C3=A1n=20Baldaszti?= , Laurent Bonnans , Esteban Bosse , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Baumann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-arm@nongnu.org, Clement Deschamps , Cleber Rosa , Paolo Bonzini , Cheng Xiang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pekka Enberg , Guenter Roeck , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We are going to use the same pattern. Instead of keeping copy/pasting this code, extract as a local function. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Esteban Bosse --- tests/acceptance/boot_linux_console.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot= _linux_console.py index 8a9a314ab4..079590f0c8 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -19,6 +19,11 @@ from avocado.utils import process from avocado.utils import archive =20 =20 +def gunzip(in_pathname_gz, out_pathname): + with gzip.open(in_pathname_gz, 'rb') as f_in: + with open(out_pathname, 'wb') as f_out: + shutil.copyfileobj(f_in, f_out) + class BootLinuxConsole(Test): """ Boots a Linux kernel and checks that the console is operational and the @@ -166,10 +171,7 @@ class BootLinuxConsole(Test): initrd_hash =3D 'bf806e17009360a866bf537f6de66590de349a99' initrd_path_gz =3D self.fetch_asset(initrd_url, asset_hash=3Dinitr= d_hash) initrd_path =3D self.workdir + "rootfs.cpio" - - with gzip.open(initrd_path_gz, 'rb') as f_in: - with open(initrd_path, 'wb') as f_out: - shutil.copyfileobj(f_in, f_out) + gunzip(initrd_path_gz, initrd_path) =20 self.vm.set_machine('malta') self.vm.set_console() --=20 2.20.1