From patchwork Sun Nov 20 07:53:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: venkata.pyla@toshiba-tsip.com X-Patchwork-Id: 2224 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sun, 20 Nov 2022 08:50:09 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ot1-f61.google.com (mail-ot1-f61.google.com [209.85.210.61]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 2AK7o8s8018097 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 20 Nov 2022 08:50:09 +0100 Received: by mail-ot1-f61.google.com with SMTP id l31-20020a9d1b22000000b0066c48e9249fsf4024113otl.5; Sat, 19 Nov 2022 23:50:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668930602; cv=pass; d=google.com; s=arc-20160816; b=FeXEKlX2+iPxNwTagPKGDciitKexhXeaHyfdGkZFdLdmwWGQSFaYhwKs5QDYRnpak3 XA7t2pioiekx2Im5q1JtUg4oSRG5IJ8ySE7+HYa0Jm72eLR5AqxZhLu7MkdQDHT4oDoH sBX0W/X2v13Nsd1gkQC4aqquNIbpwnVavchXOeMebFplL5htItORHT4n/4c5fixPmVdx flYN9qtshXlmYh1ie1ksbkaQ4uRxOQCIjITN8o+f0w85dagiJNV1AH7iZEW7RckMfUDe DPbjH0hfYrkgVanQUdbhrRERjom0M4xcjlltDIpYiSft5RsIYwvzc+3csVQn7k5eZHmk OEqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=QCwBUKkOQpJE+s57CO6mtP/8anI4Ntq0lD+u/aFK3Xo=; b=kYWwBeGt2L06l3h7Tj4UqmWZ33wugjPCNHon5qtiHew/wEXQXHY4qG9mLcGssgQAMa QgXtXj8GlykVMONewMDVsIg4fxy2OjB711Bh7bs23tLPQx9d7+na2lauNiUsjM6HMdJd 6Vda2awGIBnBmx61F4INYGTypl5oy9WX4T0ui9P9/IxyJycF09t3HmlC6TDsmkemke8A 3e5YuxCib41ysdnptn1HFPq/20gvKNcVokuwLZS2OuOyeIejzdBkAdP3UsVb5V0WvjIg O6L9KudFPybpCJEwni4aNtjNGbsgIXxSo6tvZe3fRxXlpodp3hqcS+zAGN/ziP1bKBVH XJCA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.155 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=QCwBUKkOQpJE+s57CO6mtP/8anI4Ntq0lD+u/aFK3Xo=; b=arNxvf8gHB6ZauN0ghTUggalO4N1LUVidrrbwlvS+T64qIziWQLpLCphvNFSBHf+Jd smBYr3qKcYDJiyGqxSN4s2F0KCx/8L/ePaz/0T11Siu6IDNiUW+AoV2ZxRuhQxnTPjor Ep4Xkv8s4rDDhL5ChHDdpQlLbVDdf8DWxaC0Ds6oB4BEzVD23cA7fder1QSPfKJGkfZj v+oVGu5mX9FVXXaBALLfK0YWXJA8xVhuBlWz2ss2Qh+e7g1sXwR/pi2CuJGtEXCe+Jg7 dI7WHYvcSLIh+zbGvMIUjEU1GRRjs7Y+NfWSiyxIeoaU7n6ufUFKd1x9pzGlkNkuJAnb GC0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=QCwBUKkOQpJE+s57CO6mtP/8anI4Ntq0lD+u/aFK3Xo=; b=ukjxL/n3+5QjunS4w5cVpi2VyqtjNtNWND+Y4PYxM26miQUb7855KNodWfR//oMJpJ m7RRGt4Nb3hsPjr5GWNT044fVjdjtHJkJArlzBVlJ/2ERiuB6s4cgaBxLX6ZzWtIprEJ zCpXX7FZWCHkAq7lPeVp0lwhfgf2MLzk0s6CPjp8DzmPh9zpxtPSQV43AZiSafbiC+lc 9OZ3pRAsrPSTjPU2CmoZ99Mbf2JU3RiZ68e5MPLeF2LT2MpLsDQ+n9y+uIfhVGzyDIno VhRio6qXmbJR8L+LoU5t7YpJvWlmDrIw5EgyM4rF0I+hgu1kf1gKAxL6sHDItBv+HYMe L71w== Sender: isar-users@googlegroups.com X-Gm-Message-State: ANoB5pl08u5xYxKYPjX1qdGi3d6TL1fQuFqa4Jz3XKnnRgVuYbfE2hxT yocFHpsMEUNb2d9gQvl6q9E= X-Google-Smtp-Source: AA0mqf5l6Yx05CD/sZ5eZCG9G/2LhNW5bXdK8y6qq44PoBnnoBluTMU6QRF9UDaC5JoAHXb0Cy7C2Q== X-Received: by 2002:a05:6870:cd04:b0:132:524b:ae14 with SMTP id qk4-20020a056870cd0400b00132524bae14mr7312452oab.283.1668930602751; Sat, 19 Nov 2022 23:50:02 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aca:3683:0:b0:345:bc21:cf7a with SMTP id d125-20020aca3683000000b00345bc21cf7als2654054oia.1.-pod-prod-gmail; Sat, 19 Nov 2022 23:50:02 -0800 (PST) X-Received: by 2002:a54:4e8d:0:b0:350:d677:ca32 with SMTP id c13-20020a544e8d000000b00350d677ca32mr9598429oiy.26.1668930602280; Sat, 19 Nov 2022 23:50:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668930602; cv=none; d=google.com; s=arc-20160816; b=Vd5yAAGFVja9Fw1lAWXrXs+ful2HU/Yv2w9cTJar+Z8UUfc+VrGSVMVL35x7iQJjNA xGOeUNYstD0UN+Nn5N6oondidRE6iCeO34kyn/IZ/Bts0I6XofRNkeC0aWG6BVLocfGa DX4/dE0tcerJ5I8EejxWdT9561nfRAOj+Un0HI77OAdSA3W/3jmC/cNXkvGPkc99/qTR 77zxzylTtr0/+qKdOv50zTtGWVFdVa2+ywXfeneycu1vR/ADPIrAEbgeiDRWBgJF5WYQ D0YgKJzCFMXxvSK4dhNACQIM0l9dBNiwotfdzj7HkdtQbQmjm/MaMD2NXXYsMogkz8kS 1UmA== 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:cc:to:from; bh=yvl1kUcTV/ZBG1wKovDxCaLXP7AXX8Hc3aK02jJPzwg=; b=gBjBPSqsE7wPMW04jeftemI17HoCO7aJn+diArhAUe+op6KHmUOm2x9y+jGhPeVS9+ x/o8iyQYk8BQZQpSONtjGh2sE/esoEZZI84QtAdmvwEz9SpKX+8ysV1QupsNt1IouAYs ylPbzjX5Ofj7sSWSBYBxkdIv4dWI96B2X9+nDwWc69aLzoIUzauG8zIj9stqwAaPqLzX YBXffxlrwEBA1zdM9XDfbfvDUncNQJGNnTLYMJrQCmTh9QDzO9BEl7+qs274QGMcle0F Io2HYcjSkhtAaN4zR1CyiXdbyGniWxr9tf8skTA3PedYcpXrycD10Rtk/I8XTbmzZjQl L/mw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.155 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com Received: from mo-csw.securemx.jp (mo-csw1516.securemx.jp. [210.130.202.155]) by gmr-mx.google.com with ESMTPS id g8-20020acab608000000b0035522fd7d98si498417oif.1.2022.11.19.23.50.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Nov 2022 23:50:02 -0800 (PST) Received-SPF: pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.155 as permitted sender) client-ip=210.130.202.155; Received: by mo-csw.securemx.jp (mx-mo-csw1516) id 2AK7nxQO025981; Sun, 20 Nov 2022 16:49:59 +0900 X-Iguazu-Qid: 34trSN9b0BlMoYzG7N X-Iguazu-QSIG: v=2; s=0; t=1668930599; q=34trSN9b0BlMoYzG7N; m=6K8ASsQwyd1UNJjuY6VpSgCBzsHtYKiwDvcLQFKm8aY= Received: from imx12-a.toshiba.co.jp ([38.106.60.135]) by relay.securemx.jp (mx-mr1512) id 2AK7nwY2005280 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Sun, 20 Nov 2022 16:49:59 +0900 From: venkata.pyla@toshiba-tsip.com To: isar-users@googlegroups.com Cc: venkata pyla , jan.kiszka@siemens.com, henning.schild@siemens.com, kazuhiro3.hayashi@toshiba.co.jp, dinesh.kumar@toshiba-tsip.com Subject: [PATCH] scripts/repro-test.sh: script to test reproducibility of Isar image Date: Sun, 20 Nov 2022 13:23:36 +0530 X-TSB-HOP2: ON Message-Id: <20221120075336.16006-1-venkata.pyla@toshiba-tsip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221110091226.4a3695f2@md1za8fc.ad001.siemens.net> References: <20221110091226.4a3695f2@md1za8fc.ad001.siemens.net> MIME-Version: 1.0 X-OriginalArrivalTime: 20 Nov 2022 07:49:56.0862 (UTC) FILETIME=[AF0D31E0:01D8FCB4] X-Original-Sender: venkata.pyla@toshiba-tsip.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.155 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: venkata pyla This script helps to identify reproducible problems in isar image, it uses 'diffoscope'[1] tool to check the difference between two consecutive builds and copy the differeneces in html format. [1] https://diffoscope.org/ Signed-off-by: venkata pyla --- scripts/repro-test.sh | 105 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100755 scripts/repro-test.sh diff --git a/scripts/repro-test.sh b/scripts/repro-test.sh new file mode 100755 index 0000000..0509f32 --- /dev/null +++ b/scripts/repro-test.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +set -e + +DISTRO="debian-bullseye" +MACHINE="qemuamd64" +DISTRO_ARCH="amd64" +IMAGE_TYPE="isar-image-base" + +clean(){ + if [ $? -eq 0 ]; then + [ -d $tmpdir ] && sudo rm -rf $tmpdir + else + echo "Keep build artifacts at $tmpdir" + fi +} + +build(){ + build_id="$1" + echo "Build name: $build_id" + mkdir "$tmpdir/build" + + cd "$isar_root_dir" + . isar-init-build-env "$tmpdir/build" && bitbake mc:${MACHINE}-${DISTRO#*-}:${IMAGE_TYPE} + + mv "$tmpdir/build" "$tmpdir/$build_id" +} + +repro_check(){ + image1="$tmpdir/$1/tmp/deploy/images/${MACHINE}/${IMAGE_TYPE}-${DISTRO}-${MACHINE}.tar.gz" + image2="$tmpdir/$2/tmp/deploy/images/${MACHINE}/${IMAGE_TYPE}-${DISTRO}-${MACHINE}.tar.gz" + + # Compare two build artifacts + if diffoscope --html-dir "$tmpdir/diffoscope_html_output" "$image1" "$image2"; then + echo "[Success] The build artifacts are reproduicible" + else + echo "[Fail] The build artifacts are not matching" + fi +} + +usage() { + echo "This script verifies the reproducibility of the Isar images." + echo + echo "Usage:" + echo " $0 [params]" + echo + echo "Parameters:" + echo " -d, --distro DISTRO set DISTRO variable for the builds (e.g.: debian-buster, debian-bullseye)" + echo " -m, --machine MACHINE set MACHINE variable for the builds (e.g.: qemuamd64, qemuarm64, qemuarmhf)" + echo " -a, --arch DISTRO_ARCH set DISTRO_ARCH variable for the builds (e.g.: amd64, arm64, armhf)" + echo " -h, --help" + echo +} + +while [ "$1" != "" ]; do + case $1 in + -d | --distro ) + shift + DISTRO="$1" + ;; + -m | --mahcine ) + shift + MACHINE="$1" + ;; + -a | --arch ) + shift + DISTRO_ARCH="$1" + ;; + -h | --help ) + usage + exit + ;; + * ) + usage + exit 1 + esac + shift +done + +if ! command -v diffoscope &> /dev/null +then + echo "diffoscope could not be found" + exit +fi + +cd "$(dirname "$0")/.." +isar_root_dir="$(pwd)" + +echo "Distro: $DISTRO" +echo "MACHINE: $MACHINE" +echo "DISTRO_ARCH: $DISTRO_ARCH" + +# export the variables for the build +export DISTRO=${DISTRO} +export MACHINE=${MACHINE} +export DISTRO_ARCH=${DISTRO_ARCH} + +# Temorary directory for keeping build artifacts +tmpdir=$(mktemp --directory --tmpdir /home/seshu/temp/isar.repro.test.XXXXXXXXXX) +trap clean INT TERM EXIT + +build build1 +build build2 + +repro_check build1 build2