From patchwork Tue Feb 7 10:07:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 651261 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp2779883pva; Tue, 7 Feb 2023 02:11:12 -0800 (PST) X-Google-Smtp-Source: AK7set9kSE8xNAWmUglNNda07w6UBWuK4B8mB53rjsMhQFU6wm0q2W6U+cnWnPS5IyN7u+sVT9r7 X-Received: by 2002:a05:622a:1a26:b0:3b9:cd2a:f13d with SMTP id f38-20020a05622a1a2600b003b9cd2af13dmr3752142qtb.59.1675764672197; Tue, 07 Feb 2023 02:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675764672; cv=none; d=google.com; s=arc-20160816; b=sJGy5CuU7P/nU77BPCzQw0id4ORya1pSCvgsWdvmRJX4YVFlGs7lrqE+pD/PIqSamA VOItwWzMemPriEwGqFdW+DBQfQdFTMHAKGoeigIkXCN6QJGYYvMOOuZo+Vjst049ayzn NBMxB5nxXwtRCgrDkYT1DsRs7wOZ7HcO/VR5tI8Pge7voImnMn8Uxc9zKJRxCRcZzzpi NC0bEaUb5FXh/XLYvj+ekHOPn0Kc8sBFQTc7jElqaaZ+mqRKr+POlxqxM7aC63GW1V8p nY7Bo9qb8QmiZ7pzx5o7gl5u6JgR9Ve5TSsRB0TmWisKJQyDFiqLgs18l9ceZY0cGojl PsAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from; bh=TyYCKwrZnDpgNZ4syhoxxhohuXTd9EgetizyUrRIrHA=; b=h2DmrdXpZY7sjPX+u4aOZ9zuccy8ur8RG6iXz8mcVqefvD5Aw0Hv7DDjHKH0Unv/K+ jG6QBiNQBv0CfRUcbXiB/Hnb0XVwwJfQpo5DYj0wnWWVGXewp9JEBoF7KRE8MO9HCryJ r2yu6S8QcXPjMaDda2VfNNfgEAjVVFjE/2Ks7hsrC1CDjN3VStRTX99PsZmoYMfW/LEn 8vxiQrmkGBtMrt6bk4FmIA/G5JoVDWY9kzcnShoxyV3gH7XLbUTtijkEa9x21StuUwaN pX8/Li4jAJYH7hSRgswuyUT/aEgpBQi4L8ryDJ4bVp96LeE/AFHuA26yfNuCM1/xV1vP 5KUw== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f42-20020a05622a1a2a00b003b0d885a064si10614007qtb.513.2023.02.07.02.11.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 02:11:12 -0800 (PST) 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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPKu0-0000XV-3O; Tue, 07 Feb 2023 05:08:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPKtS-0000Oz-Az; Tue, 07 Feb 2023 05:08:06 -0500 Received: from gandalf.ozlabs.org ([150.107.74.76]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPKtQ-0002Lo-Hn; Tue, 07 Feb 2023 05:08:06 -0500 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4P9zMt49ZPz4xwl; Tue, 7 Feb 2023 21:07:54 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4P9zMr5jwKz4wgv; Tue, 7 Feb 2023 21:07:52 +1100 (AEDT) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: [PULL 01/25] tests/avocado: Introduce file_truncate() Date: Tue, 7 Feb 2023 11:07:20 +0100 Message-Id: <20230207100744.698694-2-clg@kaod.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230207100744.698694-1-clg@kaod.org> References: <20230207100744.698694-1-clg@kaod.org> MIME-Version: 1.0 Received-SPF: pass client-ip=150.107.74.76; envelope-from=SRS0=a43c=6D=kaod.org=clg@ozlabs.org; helo=gandalf.ozlabs.org X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20230120134314.81956-2-philmd@linaro.org [ clg: remove image_pow2ceil_expand() factoring ] Signed-off-by: Cédric Le Goater --- tests/avocado/boot_linux_console.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 8c1d981586..13e6688624 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -30,6 +30,11 @@ def pow2ceil(x): return 1 if x == 0 else 2**(x - 1).bit_length() +def file_truncate(path, size): + if size != os.path.getsize(path): + with open(path, 'ab+') as fd: + fd.truncate(size) + """ Expand file size to next power of 2 """