From patchwork Wed Oct 30 21:34:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 2004390 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=OMC2LV1S; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf0kd1q3qz1xx7 for ; Thu, 31 Oct 2024 08:34:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1DF948926F; Wed, 30 Oct 2024 22:34:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="OMC2LV1S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1BC328924B; Wed, 30 Oct 2024 22:34:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062b.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::62b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F11B78925C for ; Wed, 30 Oct 2024 22:34:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I1ZyyJUulV4U0SIdFZScEb0XMQGLLFDH21myNugELDdfEUmFRBU676zqKAZWSv5mJUQ/F9ukmXlonL+O28eb+L+zAPVI1iV+BKBQrXMPr0EkrlkXpwoK+lwcvFiKn4OlhBvA57vw8dX+ROoSuWo3RSbMoH+99QJcITDpNvoaTkz5RHT485DIeagmLYWotIlz5VhQNA2Dm6OS1vfR2QSZSiaqUENyFK+yHzqPQM8vtcr2yuL7FbRygGM9BcucqrLG+DUT7IxCMskTj5IErUEzPZ1jLjLaA0SZ+iIDQrMk+1jtFb31BlnZLKjJ+TErvjKbqVGuGv3xrJcELBCOzD6gUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TDLrBIuuGcWeBriDZ4uBWQ2J/MZ0gXBlytHNVnIJplk=; b=Py2Ekf1m4ZSoHGF3pjHeExSVVVXhKHuZ97Jvjl85WCYnlGir3mD8YZn5Vdg3BBX4QdolSnV5HvJrCDy+fSeTaBd67jBczV+TCADNqkvhKJuTemmNe6uKwNgwBumxHReiUPS5aJ+fNiKIQPlMVfvKhOxU/LDFSSlUXEasBmhseVgvBxiXRefzpLlfcMZodta1zs/zI1j3w/bP1FOujF0l2syDB547AI9YM4PKjTORAs2ahaiOdirB9tRP8zifAZehsh/3tFsGOmIcOLpJqa2cv5WyjU6qxzKVBM49MNzPJa1iIXLmOr/fzsCt70iX/X2Nw/Jo4LZ69lPDitoA4n0H+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TDLrBIuuGcWeBriDZ4uBWQ2J/MZ0gXBlytHNVnIJplk=; b=OMC2LV1SXmwuMfMygdEcD6eLFJDZHJhU5tzQ5lSvBQFV7+Re1iWr8/UKQCKYpBS7Lp+RyaImIrZ3F7KjfDx/vSuJw/bcAUVKb0CRLYjXvu6ZfeGslNoP+e1rQr8U7TM0fezBMH/3xFMILWs2tFkL7GtBsi/Qp5c7HdO/Xb5jPCc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=prevas.dk; Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) by AM0PR10MB3201.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:189::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Wed, 30 Oct 2024 21:34:03 +0000 Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::9fcc:5df3:197:6691]) by DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::9fcc:5df3:197:6691%5]) with mapi id 15.20.8114.015; Wed, 30 Oct 2024 21:34:03 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Tom Rini , Joe Hershberger , Ravi Minnikanti , Rasmus Villemoes Subject: [PATCH 1/3] cmd/nvedit.c: teach 'env default' to optionally keep runtime variables Date: Wed, 30 Oct 2024 22:34:02 +0100 Message-ID: <20241030213404.2894247-2-ravi@prevas.dk> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241030213404.2894247-1-ravi@prevas.dk> References: <20241030213404.2894247-1-ravi@prevas.dk> X-ClientProxiedBy: MM0P280CA0076.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:8::18) To DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR10MB7100:EE_|AM0PR10MB3201:EE_ X-MS-Office365-Filtering-Correlation-Id: 22f4c041-e52a-4236-b2b9-08dcf92a9300 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: X2aU7tdt8XWxcToEB+ayNjkjsiJiW7yy0LWNzYHeJv1lrrRF/9cK6g0pOugyCCHInM9AstTq3kiCgRtPx18UyDZJiYyhhSE5bsn9kC4NenGmUplskf5NPuFAb52itiQAX+WsN4iIq/sv4GUrz8Gt1h0+unIverws0zqotEp8SkhhPqMXIX2ahfMR+e7icxg3dkoRdTxrZmsE7RETd74lKIv5voRW0BT2B2bJ8/RjC8deDPqmyjaFi4nQiiUAhTLojFRDa3oi9ZcxOCnybIilwUUIMkfRfRSU8Jmlic2voCOqY9Eouux52qqfHFef7H9RyrlVETwphOABojHFd7MbGOhOQk+uGIKQikIPiI+uzFs12fcrUYVR3Rcg5dPfBeUVqbzXS34zhzNZbRfJYM7QKjEK4nNnzieB3UjJfuILrJ7tFaUR2sd0u9Ssy84/3uwl5BIfFhBzWWRpHK9kC0A2EOgXhNBCyBBG/o0mWyd+ETTmE9VNGbsNUIA4z495xcL3gW5tpGi68q7frq6usxb9AqkEifmTtR4YR3zWIHbek1UIOg1IwrFapNIC/54LLn4VA8xNan1VRJKUOyEEMv9rls68I2kEnU50OdypiqiiLlfFsRl1fQfYTpG+bVvjuPWpfzM7fqlkR4GS8I9gHoa9FtjKQ0AiXNhqRMulQorNEK2XQ57CA0NRe29t+JOGbbRNhJXbxw31NWOPDXVbAOd1eqnLRzek3BNnyhLVIoiNSGJSh4w4xZAvrA9F2S8CCq7oGBVRP3L9KmbR1X83GGopLPQY2v6AhvUKCNINnbSNf+uhnWwtmydJbe7C0/4PQGQknasssdb7QmLUmUpWn9nGHkrsBp47o5eRniwMBQyqu6RVGN/FgOfDNXOyXeCMlv0kstz3t6QY8e901Dor4u96d2d5j67dL/+ZAhBMWfLMA0+iVOYZAHEXj7gch2rFvRYLY4riVyDhw60n4blUd0nUvj9fyyrZm30UpWqx/YsQnl2kmhuc/QY26Xxwq9+jep3YBn/j6B/epjlXQZufHCeYHt8PKx215RxYvB5vNhkh7GHlU9oWqcUQ2BWog+Z6qXGen+HF8nofYCSv9CuvcCn1iZAKkHvXSdnPtRy7Ip56aR7uAyt8oW4RzStYDlvltrdlstHpNQkQ/Uyqq9ebEwe2W6fJMyHSZbzJS1sgszhyoxoNquKidTEm5SJ/6AW6962spsEDaoIRsjfl40HHZO/viRcintTNd2PRqBdYf8tE2Yb6swsGDBPo4heUI5aYdFfmNS7c03UjGc/BOhOn3v1EzTY4DHKa7ckkfAANzQNJimlLbF0hG4WZC4TBO2t1IGwAq80yk5H9QruKDjvQzZ/iXPmjGXiMUHxfxRBjoxUTwfU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)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Q+4qlNyjW0A+35V8yye1QZd+FwCuxC6vBLCoAVEApLD9qHHpA6kk+bXhduPQP8iAL1Fk6DUedMa91u0JZhvTtRbtcbcDh4531v6zVedxiNc4v27BDaBy1Jwi0TyNPzz0YmTwbNieCeDs1SsYBW8guao1wVoUvrRtsJlPPCanvyCi4xo6CMML1mjdo0Qo+Ftn0bGIaAyqlkDaOAyf1x9JVxQmIUG+dzOClLhO3kfKsC4Xz0hewW+zF33rQzUaz9L91NIglOfb/6J+DZmDoOkR/vhD2kkj23m6QDpxdDl0DVdfmho91P6Vu8U4vdCnn1vDcrXV7nasLbkC0m8fd2Ntn9vXX0mAXIqcLAbGRJ3XZl7/3Cp7q23/nWgNBL93/+DVgDsbLWNiVXdmxai6fUKSQVHlxlpyxjnhi825/DdBVbmmJNN3oOaO9Gk86029dtE/nDCGJP7R7ws4DzNI7bZ5nmcDBnKjBctaR2BgtKUCE2zqPKfxjWfUL/33/7muYYSQ1AgqkNrzFfOTwIlEs7/1kww/ktEqEhxez0qYhUQDnbaSKJswzITfEdUwiAkfykhnFC1m4yRpONlA17aIy4ZICfobJL/gxBZ5SyhUU8xF34MHo+9Hqy1/XSxzI+App3W+dX6DFvI4Bvec8Ew== X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 22f4c041-e52a-4236-b2b9-08dcf92a9300 X-MS-Exchange-CrossTenant-AuthSource: DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 21:34:03.0866 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RXHytJBys40APdCj2DoeVqlNXvIdlmRS6x1zISC6Irc40uc7lniOgVDAi/TzbWljZC7x1foTD6yjcZ9BFwU9mC5KDlXnggO9IL+hdIENjZw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3201 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean It can be useful to set all variables defined in the default environment to the value they have there, but without removing variables that are only defined at runtime. This can sort-of be done today, by using the "env default var1 var2 ..." variant, but that requires listing all variables defined in the default environment. It's much more convenient to be able to say env default -k -a The -k flag is also meaningful in the other case: If var1 is not defined in the default environment, but var2 is, env default var1 var2 would emit a warning about var1 not being in the default env and thus being deleted. With -k, there's no warning, and var1 is kept as-is. Signed-off-by: Rasmus Villemoes --- cmd/nvedit.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 392f90f8698..1f259801293 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -523,6 +523,9 @@ static int do_env_default(struct cmd_tbl *cmdtp, int flag, case 'f': /* force */ env_flag |= H_FORCE; break; + case 'k': + env_flag |= H_NOCLEAR; + break; default: return cmd_usage(cmdtp); } @@ -1133,8 +1136,9 @@ U_BOOT_LONGHELP(env, #if defined(CONFIG_CMD_ENV_CALLBACK) "callbacks - print callbacks and their associated variables\nenv " #endif - "default [-f] -a - [forcibly] reset default environment\n" - "env default [-f] var [...] - [forcibly] reset variable(s) to their default values\n" + "default [-k] [-f] -a - [forcibly] reset default environment\n" + "env default [-k] [-f] var [...] - [forcibly] reset variable(s) to their default values\n" + " \"-k\": keep variables not defined in default environment\n" "env delete [-f] var [...] - [forcibly] delete variable(s)\n" #if defined(CONFIG_CMD_EDITENV) "env edit name - edit environment variable\n" From patchwork Wed Oct 30 21:34:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 2004391 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=WzXoEtLM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf0km6m1sz1xx7 for ; Thu, 31 Oct 2024 08:34:24 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B19E89282; Wed, 30 Oct 2024 22:34:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="WzXoEtLM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD3E789265; Wed, 30 Oct 2024 22:34:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2062e.outbound.protection.outlook.com [IPv6:2a01:111:f403:260c::62e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BA75388F47 for ; Wed, 30 Oct 2024 22:34:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DH33NIiUBNCi+BZOED0lyZiQ276kWR3pLAJOJKbn03gVG5sPGtYe4lTWJMOa2vxpyqjgfNE/8NVcf6dtYZkheJ07bP5tmmnwLTFBWENLbApfV+uxIAUdsAfPh3Uuc+Gy57PSkYUfpsPdZvHO0PEX0iwWLbGPwG9TEBuiu7Olu/xfTZ895rWGqrRjYhHSELoRSfIdqv++QTqLlikot6ZhVfekBx1arjXFmrXDLYjLVCsgMjB4AwlPXwAXtuAEo6DVOEBUrvtHUnb0PlQslNkX1SBs0q79A1j8VpqZw0uelkwsRDIOrTIXUZWbVvWhtCWZDF/V/o83KQImgwoJa/Zv7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7bHrKGhsSEo9ZMdBmr9kBt8oBeLt+4n+4vdknhg7g8w=; b=oAel12b6Cj/QzAL+gCzs5qPhizmejkLPDuHsYtpSX3YHnuR2lde0ca4O+Uof/AorycqAvzDJ2SOBRFqcs7LwhCEirIjH7owjvwrIjugWoGXbenQzzJkW7zfFKGZIuWw9fbyVMSiUOXMkP9JD9viG40OHsTUBMElbVcLdGFL4aelZoYGJ0WDh1IOszbb+qMcQdZdlgEXjTmNRoh/x6kRbpLtab3oP3ML6jZeYbtuZVvwSTVvmPHoA386Y9G6trtXS1AYepOwcsi/w2aB1bXqnb+ImygTvZc7knBSK56dC1LKmByh3vGVwdjqi4KRgBA6Fq4fpFIUc2p6SqaCjzj8NOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7bHrKGhsSEo9ZMdBmr9kBt8oBeLt+4n+4vdknhg7g8w=; b=WzXoEtLM32fJWzmxvnBOi5RzjSRWQMhk5mH1057ZOHphGvDxwXjKXKehEWBt6qeEvTTOdnwuFDVsmRuaxkaMr3fJshSonf/fl/mSuHsXTcpHaOB8+eKTlK3D1RRvEqCKr2EPTCPPCTxbS4FTvrgeoeuwHlOWuTzuzFLUcdmFY9c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=prevas.dk; Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) by AM0PR10MB3201.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:189::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Wed, 30 Oct 2024 21:34:04 +0000 Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::9fcc:5df3:197:6691]) by DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::9fcc:5df3:197:6691%5]) with mapi id 15.20.8114.015; Wed, 30 Oct 2024 21:34:04 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Tom Rini , Joe Hershberger , Ravi Minnikanti , Rasmus Villemoes Subject: [PATCH 2/3] test: env: check that non-mentioned variables to "env default" are preserved Date: Wed, 30 Oct 2024 22:34:03 +0100 Message-ID: <20241030213404.2894247-3-ravi@prevas.dk> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241030213404.2894247-1-ravi@prevas.dk> References: <20241030213404.2894247-1-ravi@prevas.dk> X-ClientProxiedBy: MM0P280CA0077.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:8::20) To DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR10MB7100:EE_|AM0PR10MB3201:EE_ X-MS-Office365-Filtering-Correlation-Id: bff974b4-7ff4-4874-14f8-08dcf92a93f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: U1g2qvjsLjHSa+3vyFCw0HrLIj3x6EFip2R1wJxhaEU7mfPnfzFDQIiMw8JDicvRoh4NmPnBTWgHth73QN3eDBGawUgPfNSnx/W1xWvy83h58vNt3AqwnEbS5qiQtgZQr4ZLpyV/hEDIBb/yoGDA72gyDngd6F2QoH+271uz+PxCHIAcnwyISH3t3iTD+pmxiS5chcr0A3BFBAgJQMXFawrldl5dbjV8yJoS6uOsCqlwsklySjfMB0rMi4yyOIczaIOd6Ziw9NWH87MDivMs5KWKvP2+lGmA1aAdwWbMWDihgaRYFeO7hFaSXzR3sLqZHmUVUJj9kbFk328rLPutoq1UKZuiDDYc18RBFoiEJuVHi8LRckNkLV4WEji1OXBmDDd0n8gFCg1imGSTd41DJIvRNNWmaBOLh8sohObf2tgoXhUg24D33h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230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yn8UClV7fpgaKTjlNovCOyecJ8+vRggn5/+EHGRCeqe0ZpKvJ2JCDTbNu3v2tw2G7XMxS844iw+EJAuJ5+RK3YrNIPUo3JSo5ZQhYKPoq8/3pS+uvlwnbGzo+FU9B1lvCwt+DXHes8E1Mb8GR5zFfP1gv9G9h5Tup7GJdivWkdsGboZFBZHnBfO4odNnZ4qKiq/sVq6ah2LiWdEquIg+GAHNtnNkfoTIchCH8bpPwHwoXeTah1isQXpvAT9WdR6UZVSC4WIVzN3KhWhwFojufSV2ivfXB43j4t1i89cikihk5perNLmW/9nVVnK7CtwauRnetVG0RenfMSyX8EGI9rn4p889SlLCFw5SRiWzmewQsOVg5BPP/REkMouB8qOjm/7XcVMuZ5DItUWir/5BQaFtz5ViWBnM0owovL1uvfIJ+fUMQySHxIMCsT5GACXzYcjAwODSGDJSgisPJUuGNfMwXNmQSkUhvas7DdC12NpQLLqUGKN1umhdHMznUtEKE4zRgzYM6cHTHit0DbpDUUnbj/aFdM7NzG1dE1r5js87OLEfPkqfzDeg4soNbEgJgBRFy27ipcoJh0TV2iAk6DclEFpUyYiCqsfGwcmg6ejoY5cZToDkuYJZ7rH16brjFTavPMUVguaUMmuc6p7SBBYdVtizjZ+cOM/gYDFhJbV1afT8xJ2iaYPaeXJI00LLTuN1zXOe2aoA2qEC4iVo50p8n68j5+SgD7CYF7DljSUUJ6PCDJXyT2UtV45vpFsNyGKsIHK9Orgdq5kcXzWdVCY27jo0tr4yii9zA5P7atqSKLXQx8C74PUi4vZk2T2sFrO43FqALr/FXrH/wu3vuU8DL6BKe6Q9GJ5CYT88yezL4aFTaAy/ts2leJlIg0P5H04dwQ6Zt2C/Ph7ENOUv9JwV8VHMLn/aB2ilFdep+e7840dRk0N8hhhpgYnGTlujdswbwbQn4ByD0h3TB3e7z4rQ+l7CudUOyYzm79OFy50cR366m1IKzQa7QepV1udy3EO5ZLpx0N3YkbOZ0IU/hYHQO+ndcJnVroGdUvqAPqrXKKx+CSbq3+Buybj+995+NSRkqElFckYzaP6cRbXUHevQW3k7p5OSQal9OHU9cvExWGWe3AvvYQqrzX51YSsLZociaZwiQhs0LKLmVTM986G8GncIxY9JKpzsJlw68/ya73o+NiBv8qCsfumy/wCJnPWK4/Qz3E9SWaowviKWknmWBStA04FDZMBlM5XrZaS8PY7lQWsBiU4M7WFI0C60Kx3ubzbC5E7M2aNi9NUQHSndR7li283HuknQcpw6WhUwElR38kkpcF+h1LgCx2vutbLMRf1wZI5vIQfsqKezEaCP2RLw0VPYIA/mbiA6I1fGYSVgaQXZL0ty9eES/u2DjfYkWSdn2cgvckDlbcdxGxZa0NuTiU/I5ufMA5xmwbu38XJ3v1P5xjNPu1yK3sFCX4rUjAyAlCceny3kBC2UChXF/0/i6C2MNoTQtmBGFFm8eyDB0mFK7YXsNQhJuKs9X9Xfte11N+RoIPJuC/8YgFVmKneh/tRCbAav9M7uabvEFPrlj1+ElpFKk28HghgrPwVe2S0ipXkklEwWHbgL1g== X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: bff974b4-7ff4-4874-14f8-08dcf92a93f9 X-MS-Exchange-CrossTenant-AuthSource: DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 21:34:04.7016 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: H/J6ekT72A6bCIlP7UIzdlkFOmt+fFls8wUTV3JqAxthT3+QyAIThaWRTfJbgzZCONp0tZUKoo2AG58c30/7DsH5curu3PvmdbyWAFSMQwU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3201 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Instead of testing the same expected behaviour for both non_default_varX, test that when var1 is not in the default env but is mentioned in the "env default" cmdline, it is removed, while var2 is untouched. Signed-off-by: Rasmus Villemoes --- test/env/cmd_ut_env.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/env/cmd_ut_env.c b/test/env/cmd_ut_env.c index 4af05764fb8..e1dd1a14cb0 100644 --- a/test/env/cmd_ut_env.c +++ b/test/env/cmd_ut_env.c @@ -14,22 +14,21 @@ static int env_test_env_cmd(struct unit_test_state *uts) ut_assertok(run_command("setenv non_default_var1 1", 0)); ut_assert_console_end(); - ut_assertok(run_command("setenv non_default_var2 1", 0)); + ut_assertok(run_command("setenv non_default_var2 2", 0)); ut_assert_console_end(); ut_assertok(run_command("env print non_default_var1", 0)); ut_assert_nextline("non_default_var1=1"); ut_assert_console_end(); - ut_assertok(run_command("env default non_default_var1 non_default_var2", 0)); + ut_assertok(run_command("env default non_default_var1", 0)); ut_assert_nextline("WARNING: 'non_default_var1' not in imported env, deleting it!"); - ut_assert_nextline("WARNING: 'non_default_var2' not in imported env, deleting it!"); ut_assert_console_end(); ut_asserteq(1, run_command("env exists non_default_var1", 0)); ut_assert_console_end(); - ut_asserteq(1, run_command("env exists non_default_var2", 0)); + ut_asserteq(0, run_command("env exists non_default_var2", 0)); ut_assert_console_end(); return 0; From patchwork Wed Oct 30 21:34:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 2004392 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=hjwtEeZH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf0kw68Ykz1xx7 for ; Thu, 31 Oct 2024 08:34:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F0DF989289; Wed, 30 Oct 2024 22:34:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="hjwtEeZH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 10B2788F47; Wed, 30 Oct 2024 22:34:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2060c.outbound.protection.outlook.com [IPv6:2a01:111:f403:260c::60c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2863489262 for ; Wed, 30 Oct 2024 22:34:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cNCptWZjDdGPisK4tO/PxPOJYyj9QygFSdr0XstGcNzxhwoA+MULtCGDXMaEcw7gW9fsYeEWuf70p6dR1hXgHGU3lq2QjIM9VHdizbjs2TKxCFvatPb9WkvsjYBN/uV2dQ4yq/sewldyKXnGI5PSEHFT77BQlHbYLyRDoll8pOvE9+HyyeZHc18H2RnZrjZUzhf6bU0R2KSk9ZS9R8Exq0Z/SKrNKfpANquX752DOe7WD+nIthfY3DkhYqwM9CBiEFzlyJSNyTaoGrNQTuChFNZTg/3TyYw9blQ7CPrMp9pjTS8RADxiCb6RJmOvtn6l5TFtbu5Kr/D6lMuCNcwJEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=x0SW/mqCqOj2DtGJDGCJaxxc1J8VR56UIVH5tdw0sL4=; b=BBiq4Kf5nSKmYlbxCqBkvvU++3sLaEh/5l0Wfsl6xjPk1JG3NCMlnmYB8KS/L8AMhj/tYidWo00E1jQ69ZdIMEW8GMGfUAOmDixBoWnnJH8z0lEClYnZRk8tEkciSB76ihJPSlOLQylDJoMu1eu4RHotHr1427TeNeBLSu1MeSQqbyFa2dOnC1GgmQeiwdFITuQnpHyYl2LXr+Y6MBSZ8jGb+/l2AJGA2Cq1uppMNMU2it9pXIS6SxAmmiIL6W7CzdEyuHbYEuFuCm+/DHDue62Hiufx+wGvqm79L8leBT1fth96ivRPGZg7a3RNUkz2XvBCjYyGJIktNNT+zFNLTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x0SW/mqCqOj2DtGJDGCJaxxc1J8VR56UIVH5tdw0sL4=; b=hjwtEeZHSfo3fA1JXKa9tMOUq8R3s2XAtRzzq3U4FIT+MV4DeyhkvWiEtrSVq/sG6QtQKJxwNCejX1++XAH7BYWsMzXNtS0gUA5cYIANh6+B8/+2N4llEwdkizLpbL0+RTTYHACJKbeTD6JBFRvsbM1XrVvjzlYx6gcHXJCM9lM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=prevas.dk; Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) by AM0PR10MB3201.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:189::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Wed, 30 Oct 2024 21:34:06 +0000 Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::9fcc:5df3:197:6691]) by DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::9fcc:5df3:197:6691%5]) with mapi id 15.20.8114.015; Wed, 30 Oct 2024 21:34:06 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Tom Rini , Joe Hershberger , Ravi Minnikanti , Rasmus Villemoes Subject: [PATCH 3/3] test: env: add some test cases for new "env default -k" flag Date: Wed, 30 Oct 2024 22:34:04 +0100 Message-ID: <20241030213404.2894247-4-ravi@prevas.dk> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241030213404.2894247-1-ravi@prevas.dk> References: <20241030213404.2894247-1-ravi@prevas.dk> X-ClientProxiedBy: MM0P280CA0107.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:9::10) To DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR10MB7100:EE_|AM0PR10MB3201:EE_ X-MS-Office365-Filtering-Correlation-Id: f2bb8c60-646f-4b4d-8470-08dcf92a94e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: D1jGE1iih/kbgxLxPX5mcqxwM2jSdej6bZM/Yloi/x5FdvZNtLtRpoSdrTMQ122LXPtaebXEKcwUdZRizALF3mVDLyk3mEntdEcd2Bvkyvbiomeb+4L7SKVa2xv2O/LQJCjg3hRPW4/vvzsdceybX+3kgNGcdFY1BNoQv7bzewB/HxIhvc0ykUf0tFXnIMr66Eb0usYFHllCfrOa1lp2n5eGfwcx0bNW91ibRXBNHsPerPlhJbbar5vU/Y4UQhQPIo/x00oJTx5FO3LPBORFJ4px94hRToa+BAvXQ8eQOCRGXjnibq8aMOItvw7Af6NCaxGCeRlv+59j3gvDU9k3O5nhjZ6JzVJkEAJeLxjuv3aFcbcLAGGctUKAF01YZzlCFwmKBJ8IB/hPGinQLgR9jjn/8Pjrn1P6k4ak72wI0yrSDvmxEkVOkojtGszkGFKvDE9d465T27O8kbg6PbWEjS5LopFUESNsPk3RFlyDctB1MMbANAsYDPlQ7f5lEIxTncfZUPkY+8+bNzhx/byF43aO2cFOvU59BopqM6l/AWdE0d0QR4G/ed4nG8HjWLlLezIDj4Li0RWISw0ncA/rp/GiaZgvYVpKInehps1IRj1HWlPHt7oXh4ZD6UxQrTrQezFTpMw+pMnLkxn/JJl8IPTGWzyuoxe0qYc3uK0AhMZLJwMX4qqrEDHZdNGqyqZRANM9OqYlSZVJWvMuTJDhZBwrl2CXwyhDFNpAOp0OLdlA3VxxTOSvENHZfxNwDNk0xfWa/5itG0lHWXnAP+ya+Bxg2TUZBKFVjgG8fybNei300rg12djPPJS4MWwNWW1oG4BBfATj4TdY6xsfbqA1C0K5nlyPgXNEvibhs4mcETZwPnhL54kl5wi595jbrqYmyq/4/W3MV4Cf+UZSQvGlhq+avttP6MWP0DT78XzirbITWA1kuXGTXQOnlDf4p1CbVOBZfJ+zGLOCsbJonfPfxu+Ot8aPxEyrLXwUPyl/pOtr7MCltdnV0Iarj4tz5jjhqozKPm9Cs+pgnmxoHxXJ+cSEPvfLj+GBRTs1zyHAus4sv9DtyezKBK/nROFGyccIgQStoGsY3Hd0LRLV6EjVc6l8vsDZaXtzrzqX1LLTyYZrBm+2wpnRTYFDubUPFramklLLz1nerFMN1ZV6sr3Gnul1TBRPXZR9GtRDV22UsgB3gBuw6zaBM0oeGnTEuHMzRmsxFlqTxm0D91TAYs8nPlDH2N876/APjTlTqwQ/CP/vh5X1OIwZ6Ko7VotzIzwtsLmhW9ARAx9MyoIYi2/bj74ORGbtZqpE8zhzYWbF8r+SApD9JdPRJD8nxAuEr2+Qh+CRXKJD+lTfkSthmTSFq5r96AM0uCmNVKK7zNM6rsw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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IDoRitJl5EcBH4nPwWmhkmqRmuEi+mjFl3uAevp+T98h/ff8gZnDLMXqWMkLlychLtzIPHVzqUVUHVhIM4HH6KylV7dyLfoE8INAsDZ+XLH/WdkEEpZiDYv2UEtMgA3NinWEXXinWOv/Xndrqh6rvCO9KTfJCh2XYQZp7mOsyO5EBFvf/A8vmGRkhLXgBAMt36SHjHwbdzsPLKirFJnNfxh/3uLkn1cZE1eTgL1cViPQ4DOl7acCalUtZsIPbAcPM4r7sq2yEKHPPSpU5LUbAATdOjQKW/1LbnVi3MZNs2c+9yuioq5/bb0vlD2UYi9LTdILLlwpJkbxQAMaF+w81bMksMIn/zILZd6z5R62myb7Oreao3O9O+iAtUQRiLC9UDym+Mr5cqBg7tOu5umI3bFLb6+c4kBatK/wgf8eEaVkqVDSG3ZdUTkW19S0k74cMZQ3eOj1eDn3bZfh0Rx4NXGSAhbLtbBMI1uhNmqpl9KXs4MD/bII4ho/xdmqJZt+uu8cm4zxH5jNHItgG8Tkri2j/qsygUR6qk8Ehqvb/na1jL3gHvgpJsqzG5A== X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: f2bb8c60-646f-4b4d-8470-08dcf92a94e9 X-MS-Exchange-CrossTenant-AuthSource: DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 21:34:06.2825 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 45tFZRrDJsmUYwfLmQdPgC5sbtfdh3tFLrC5n4UQID2eKUAFewLpkxb48yBklDWPWLUbORSkmcrghXItVsI+rCCNowl/rty/oZuBI5oBb4w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3201 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Check that the new -k flag works as expected. This also adds a test of the -a flag, which was previously missing, and as the comment says, perhaps for a good reason. At least now we have a test for it in combination with -k (and -f, because the ethaddr variables otherwise cause complaining). Signed-off-by: Rasmus Villemoes --- test/env/cmd_ut_env.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/env/cmd_ut_env.c b/test/env/cmd_ut_env.c index e1dd1a14cb0..9f16a978f2a 100644 --- a/test/env/cmd_ut_env.c +++ b/test/env/cmd_ut_env.c @@ -31,6 +31,46 @@ static int env_test_env_cmd(struct unit_test_state *uts) ut_asserteq(0, run_command("env exists non_default_var2", 0)); ut_assert_console_end(); + ut_assertok(run_command("setenv non_default_var1 3", 0)); + ut_assert_console_end(); + + ut_assertok(run_command("env default -k non_default_var1", 0)); + ut_assert_console_end(); + + ut_asserteq(0, run_command("env exists non_default_var1", 0)); + ut_assert_console_end(); + + ut_asserteq(0, run_command("env exists non_default_var2", 0)); + ut_assert_console_end(); + + ut_assertok(run_command("env default -k -a -f", 0)); + ut_assert_nextline("## Resetting to default environment"); + ut_assert_console_end(); + + ut_asserteq(0, run_command("env exists non_default_var1", 0)); + ut_assert_console_end(); + + ut_asserteq(0, run_command("env exists non_default_var2", 0)); + ut_assert_console_end(); + + /* + * While the following test of "env default -a" by itself + * works, it unfortunately causes an unrelated test case, + * env_test_fdt_import(), to fail, because the "from_fdt" + * variable would be removed. + */ +#if 0 + ut_assertok(run_command("env default -a", 0)); + ut_assert_nextline("## Resetting to default environment"); + ut_assert_console_end(); + + ut_asserteq(1, run_command("env exists non_default_var1", 0)); + ut_assert_console_end(); + + ut_asserteq(1, run_command("env exists non_default_var2", 0)); + ut_assert_console_end(); +#endif + return 0; } ENV_TEST(env_test_env_cmd, UTF_CONSOLE);