From patchwork Tue Oct 1 13:52:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1991483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=AkBLgn6z; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=qOJX24jq; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=AkBLgn6z; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=qOJX24jq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (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 4XHzt355cQz1xsq for ; Tue, 1 Oct 2024 23:53:15 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 64C993C58FD for ; Tue, 1 Oct 2024 15:53:13 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) (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 picard.linux.it (Postfix) with ESMTPS id 9E6AB3C58E2 for ; Tue, 1 Oct 2024 15:52:17 +0200 (CEST) Authentication-Results: in-2.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=195.135.223.130; helo=smtp-out1.suse.de; envelope-from=andrea.cervesato@suse.de; receiver=lists.linux.it) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 04EC1601A02 for ; Tue, 1 Oct 2024 15:52:16 +0200 (CEST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 smtp-out1.suse.de (Postfix) with ESMTPS id 7B6C321B0E for ; Tue, 1 Oct 2024 13:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=029gJfA2ENCRSwlF0enL829tCA3gaMVNzJGlbBDOGa4=; b=AkBLgn6zhUMYqfmEcVAOFy3odmkbnwBCL2eDpywtu85EbQOgWR3ClNlizbqVpVhbLnS7kq OC74xNdXa7yS22VKuClDHIwFokI5/nKdQjYQ5xFuY3pes2jeKgH6kpkLnddT9e5f8ytuws cRtoY+mcQoCbaUIcQRHjOTUAsaq0Kd4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=029gJfA2ENCRSwlF0enL829tCA3gaMVNzJGlbBDOGa4=; b=qOJX24jqDQ9owai+a6NeGin1tyJH2VXRDIxZeEVd5MGxeiRRj/GJbydaJ84Shz2oDLUPLB fg/i9/BrdOrXdmBA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=AkBLgn6z; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=qOJX24jq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=029gJfA2ENCRSwlF0enL829tCA3gaMVNzJGlbBDOGa4=; b=AkBLgn6zhUMYqfmEcVAOFy3odmkbnwBCL2eDpywtu85EbQOgWR3ClNlizbqVpVhbLnS7kq OC74xNdXa7yS22VKuClDHIwFokI5/nKdQjYQ5xFuY3pes2jeKgH6kpkLnddT9e5f8ytuws cRtoY+mcQoCbaUIcQRHjOTUAsaq0Kd4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=029gJfA2ENCRSwlF0enL829tCA3gaMVNzJGlbBDOGa4=; b=qOJX24jqDQ9owai+a6NeGin1tyJH2VXRDIxZeEVd5MGxeiRRj/GJbydaJ84Shz2oDLUPLB fg/i9/BrdOrXdmBA== Received: from imap1.dmz-prg2.suse.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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 64E8A13A73 for ; Tue, 1 Oct 2024 13:52:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kPxaE4/++2bJFQAAD6G6ig (envelope-from ) for ; Tue, 01 Oct 2024 13:52:15 +0000 From: Andrea Cervesato Date: Tue, 01 Oct 2024 15:52:03 +0200 MIME-Version: 1.0 Message-Id: <20241001-ioctl_ficlone01_fix-v2-1-dd0b021dd31d@suse.com> References: <20241001-ioctl_ficlone01_fix-v2-0-dd0b021dd31d@suse.com> In-Reply-To: <20241001-ioctl_ficlone01_fix-v2-0-dd0b021dd31d@suse.com> To: ltp@lists.linux.it X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1727790735; l=8800; i=andrea.cervesato@suse.com; s=20240812; h=from:subject:message-id; bh=YoxIK26qGQ2N6+hbYjAOF8MGIAfz/Weg0Zi1B2kaRu0=; b=AvahPtwOzsQqXTenVorjkcrEnc64WeHtZLZEQVQF6KL32SqeOhPy9d03dNLYYhEDLsEMBQxPx kEO2b6eH0YaCPFxtVBMOWayPUXDaUEAMx5Uju7YHUt2n38JPjfZjK2l X-Developer-Key: i=andrea.cervesato@suse.com; a=ed25519; pk=RG/nLJ5snb1tLKGwSORQXBJ5XA4juT0WF2Pc/lq9meo= X-Rspamd-Queue-Id: 7B6C321B0E X-Spam-Level: X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:mid,suse.de:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -4.51 X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-2.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-2.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v2 1/3] Filter mkfs version in tst_fs X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Andrea Cervesato Introduce mkfs_ver attribute in the tst_fs declaration, in order to filter specific mkfs.* tools versions. Signed-off-by: Andrea Cervesato --- include/tst_private.h | 6 +- include/tst_test.h | 4 ++ lib/tst_cmd.c | 130 +++++++++++++++++++++++++++++++++--------- lib/tst_test.c | 5 +- testcases/lib/tst_run_shell.c | 5 ++ 5 files changed, 119 insertions(+), 31 deletions(-) diff --git a/include/tst_private.h b/include/tst_private.h index 6f4f39b15..a29f2d1c1 100644 --- a/include/tst_private.h +++ b/include/tst_private.h @@ -40,11 +40,11 @@ char tst_kconfig_get(const char *confname); /* * If cmd argument is a single command, this function just checks command - * whether exists. If not, case skips. + * whether exists. If not, case breaks unless skip_on_error is defined. * If cmd argument is a complex string ie 'mkfs.ext4 >= 1.43.0', this * function checks command version whether meets this requirement. - * If not, case skips. + * If not, case breaks unless skip_on_error is defined. */ -void tst_check_cmd(const char *cmd); +void tst_check_cmd(const char *cmd, const int skip_on_error); #endif diff --git a/include/tst_test.h b/include/tst_test.h index d0fa84a71..38d24f48c 100644 --- a/include/tst_test.h +++ b/include/tst_test.h @@ -262,6 +262,9 @@ struct tst_ulimit_val { * passed to mkfs after the device path and can be used to * limit the file system not to use the whole block device. * + * @mkfs_ver: mkfs tool version. The string format supports relational + * operators such as < > <= >= ==. + * * @mnt_flags: MS_* flags passed to mount(2) when the test library mounts a * device in the case of 'tst_test.mount_device'. * @@ -273,6 +276,7 @@ struct tst_fs { const char *const *mkfs_opts; const char *mkfs_size_opt; + const char *mkfs_ver; unsigned int mnt_flags; const void *mnt_data; diff --git a/lib/tst_cmd.c b/lib/tst_cmd.c index b3f8a95ab..35dd71253 100644 --- a/lib/tst_cmd.c +++ b/lib/tst_cmd.c @@ -210,7 +210,7 @@ static int mkfs_ext4_version_parser(void) return major * 10000 + minor * 100 + patch; } -static int mkfs_ext4_version_table_get(char *version) +static int mkfs_generic_version_table_get(char *version) { int major, minor, patch; int len; @@ -228,19 +228,42 @@ static int mkfs_ext4_version_table_get(char *version) return major * 10000 + minor * 100 + patch; } +static int mkfs_xfs_version_parser(void) +{ + FILE *f; + int rc, major, minor, patch; + + f = popen("mkfs.xfs -V 2>&1", "r"); + if (!f) { + tst_resm(TWARN, "Could not run mkfs.xfs -V 2>&1 cmd"); + return -1; + } + + rc = fscanf(f, "mkfs.xfs version %d.%d.%d", &major, &minor, &patch); + pclose(f); + if (rc != 3) { + tst_resm(TWARN, "Unable to parse mkfs.xfs version"); + return -1; + } + + return major * 10000 + minor * 100 + patch; +} + static struct version_parser { const char *cmd; int (*parser)(void); int (*table_get)(char *version); } version_parsers[] = { - {"mkfs.ext4", mkfs_ext4_version_parser, mkfs_ext4_version_table_get}, + {"mkfs.ext4", mkfs_ext4_version_parser, mkfs_generic_version_table_get}, + {"mkfs.xfs", mkfs_xfs_version_parser, mkfs_generic_version_table_get}, {}, }; -void tst_check_cmd(const char *cmd) +void tst_check_cmd(const char *cmd, const int skip_on_error) { struct version_parser *p; char *cmd_token, *op_token, *version_token, *next, *str; + char *check_msg; char path[PATH_MAX]; char parser_cmd[100]; int ver_parser, ver_get; @@ -302,45 +325,98 @@ void tst_check_cmd(const char *cmd) switch (op_flag) { case OP_GE: - if (ver_parser < ver_get) { - tst_brkm(TCONF, NULL, "%s required >= %d, but got %d, " - "the version is required in order run the test.", - cmd, ver_get, ver_parser); + if (ver_parser >= ver_get) + break; + + check_msg = "%s required >= %d, but got %d, " + "the version is required in order run the test."; + + if (skip_on_error) { + tst_resm(TCONF, check_msg, cmd, ver_get, + ver_parser); + } else { + tst_brkm(TCONF, NULL, check_msg, cmd, ver_get, + ver_parser); } break; case OP_GT: - if (ver_parser <= ver_get) { - tst_brkm(TCONF, NULL, "%s required > %d, but got %d, " - "the version is required in order run the test.", - cmd, ver_get, ver_parser); + if (ver_parser > ver_get) + break; + + check_msg = "%s required > %d, but got %d, " + "the version is required in order run the " + "test."; + + if (skip_on_error) { + tst_resm(TCONF, check_msg, cmd, ver_get, + ver_parser); + } else { + tst_brkm(TCONF, NULL, check_msg, cmd, ver_get, + ver_parser); } break; case OP_LE: - if (ver_parser > ver_get) { - tst_brkm(TCONF, NULL, "%s required <= %d, but got %d, " - "the version is required in order run the test.", - cmd, ver_get, ver_parser); + if (ver_parser <= ver_get) + break; + + check_msg = "%s required <= %d, but got %d, " + "the version is required in order run the " + "test."; + + if (skip_on_error) { + tst_resm(TCONF, check_msg, cmd, ver_get, + ver_parser); + } else { + tst_brkm(TCONF, NULL, check_msg, cmd, ver_get, + ver_parser); } break; case OP_LT: - if (ver_parser >= ver_get) { - tst_brkm(TCONF, NULL, "%s required < %d, but got %d, " - "the version is required in order run the test.", - cmd, ver_get, ver_parser); + if (ver_parser < ver_get) + break; + + check_msg = "%s required < %d, but got %d, " + "the version is required in order run the " + "test."; + + if (skip_on_error) { + tst_resm(TCONF, check_msg, cmd, ver_get, + ver_parser); + } else { + tst_brkm(TCONF, NULL, check_msg, cmd, ver_get, + ver_parser); } break; case OP_EQ: - if (ver_parser != ver_get) { - tst_brkm(TCONF, NULL, "%s required == %d, but got %d, " - "the version is required in order run the test.", - cmd, ver_get, ver_parser); + if (ver_parser == ver_get) + break; + + check_msg = "%s required == %d, but got %d, " + "the version is required in order run the " + "test."; + + if (skip_on_error) { + tst_resm(TCONF, check_msg, cmd, ver_get, + ver_parser); + } else { + tst_brkm(TCONF, NULL, check_msg, cmd, ver_get, + ver_parser); } break; case OP_NE: - if (ver_parser == ver_get) { - tst_brkm(TCONF, NULL, "%s required != %d, but got %d, " - "the version is required in order run the test.", - cmd, ver_get, ver_parser); + if (ver_parser != ver_get) + break; + + check_msg = "%s required != %d, but got %d, " + "the version is required in order run the " + "test."; + + if (skip_on_error) { + tst_resm(TCONF, check_msg, cmd, ver_get, + ver_parser); + } else { + tst_brkm(TCONF, NULL, check_msg, cmd, ver_get, + ver_parser); } break; } diff --git a/lib/tst_test.c b/lib/tst_test.c index 918bee2a1..7dfab4677 100644 --- a/lib/tst_test.c +++ b/lib/tst_test.c @@ -1154,6 +1154,9 @@ static void prepare_device(struct tst_fs *fs) const char *const extra[] = {fs->mkfs_size_opt, NULL}; + if (fs->mkfs_ver) + tst_check_cmd(fs->mkfs_ver, 1); + if (tst_test->format_device) SAFE_MKFS(tdev.dev, tdev.fs_type, fs->mkfs_opts, extra); @@ -1306,7 +1309,7 @@ static void do_setup(int argc, char *argv[]) int i; for (i = 0; (cmd = tst_test->needs_cmds[i]); ++i) - tst_check_cmd(cmd); + tst_check_cmd(cmd, 0); } if (tst_test->needs_drivers) { diff --git a/testcases/lib/tst_run_shell.c b/testcases/lib/tst_run_shell.c index 8ed0f21b6..fbfbe16a7 100644 --- a/testcases/lib/tst_run_shell.c +++ b/testcases/lib/tst_run_shell.c @@ -153,12 +153,14 @@ static const char *const *parse_strarr(ujson_reader *reader, ujson_val *val) enum fs_ids { MKFS_OPTS, MKFS_SIZE_OPT, + MKFS_VER, MNT_FLAGS, TYPE, }; static ujson_obj_attr fs_attrs[] = { UJSON_OBJ_ATTR_IDX(MKFS_OPTS, "mkfs_opts", UJSON_ARR), + UJSON_OBJ_ATTR_IDX(MKFS_VER, "mkfs_ver", UJSON_STR), UJSON_OBJ_ATTR_IDX(MKFS_SIZE_OPT, "mkfs_size_opt", UJSON_STR), UJSON_OBJ_ATTR_IDX(MNT_FLAGS, "mnt_flags", UJSON_ARR), UJSON_OBJ_ATTR_IDX(TYPE, "type", UJSON_STR), @@ -224,6 +226,9 @@ static struct tst_fs *parse_filesystems(ujson_reader *reader, ujson_val *val) case MKFS_SIZE_OPT: ret[i].mkfs_size_opt = strdup(val->val_str); break; + case MKFS_VER: + ret[i].mkfs_ver = strdup(val->val_str); + break; case MNT_FLAGS: ret[i].mnt_flags = parse_mnt_flags(reader, val); break; From patchwork Tue Oct 1 13:52:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1991481 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=GOsyZjZl; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=rNSiJxIY; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=GOsyZjZl; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=rNSiJxIY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XHzsP0rDwz1xsq for ; Tue, 1 Oct 2024 23:52:41 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4D29A3C597B for ; Tue, 1 Oct 2024 15:52:38 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 0C8823C58FD for ; Tue, 1 Oct 2024 15:52:16 +0200 (CEST) Authentication-Results: in-2.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=195.135.223.131; helo=smtp-out2.suse.de; envelope-from=andrea.cervesato@suse.de; receiver=lists.linux.it) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 654B5601FAC for ; Tue, 1 Oct 2024 15:52:16 +0200 (CEST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id 9D7EA1F871 for ; Tue, 1 Oct 2024 13:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ael/qui1oWyJ6VmkKG1qWENqzlUjM7kj0WjhhK1X9sE=; b=GOsyZjZlgp5nIz/WzlzRNXyHjXK6icC5udz2fyG513K9bxDKkffDu25tdR3QvvNFC21B/T 1ECuvi03vp7jeVntjPyk8YEr8JbcNIeklIrlhnhHPVMlcJmLtQUOe0nyRkiKTUARcqeRhN HK5Sa6qiJD92RYfoGOGop9KGi/liDqg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ael/qui1oWyJ6VmkKG1qWENqzlUjM7kj0WjhhK1X9sE=; b=rNSiJxIYhBsRH8OyHSlzGNTEvOEptduFmTP8lODFytlkr7QjHm0jOKeqoKdiu16j+bu+23 YCmetgVR3OWJ6OAQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=GOsyZjZl; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=rNSiJxIY DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ael/qui1oWyJ6VmkKG1qWENqzlUjM7kj0WjhhK1X9sE=; b=GOsyZjZlgp5nIz/WzlzRNXyHjXK6icC5udz2fyG513K9bxDKkffDu25tdR3QvvNFC21B/T 1ECuvi03vp7jeVntjPyk8YEr8JbcNIeklIrlhnhHPVMlcJmLtQUOe0nyRkiKTUARcqeRhN HK5Sa6qiJD92RYfoGOGop9KGi/liDqg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ael/qui1oWyJ6VmkKG1qWENqzlUjM7kj0WjhhK1X9sE=; b=rNSiJxIYhBsRH8OyHSlzGNTEvOEptduFmTP8lODFytlkr7QjHm0jOKeqoKdiu16j+bu+23 YCmetgVR3OWJ6OAQ== Received: from imap1.dmz-prg2.suse.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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 85A8113A8A for ; Tue, 1 Oct 2024 13:52:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id eBa8Ho/++2bJFQAAD6G6ig (envelope-from ) for ; Tue, 01 Oct 2024 13:52:15 +0000 From: Andrea Cervesato Date: Tue, 01 Oct 2024 15:52:04 +0200 MIME-Version: 1.0 Message-Id: <20241001-ioctl_ficlone01_fix-v2-2-dd0b021dd31d@suse.com> References: <20241001-ioctl_ficlone01_fix-v2-0-dd0b021dd31d@suse.com> In-Reply-To: <20241001-ioctl_ficlone01_fix-v2-0-dd0b021dd31d@suse.com> To: ltp@lists.linux.it X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1727790735; l=3794; i=andrea.cervesato@suse.com; s=20240812; h=from:subject:message-id; bh=JZZ8UUytlukiy53yEQrGuvt+zszSlFZlrDeDJiQGiec=; b=BRg6uUfzNppuL2/vnrvY2Lp93bbT6Ibnystwm/p2b9hdUhQXFsi3PGn+JTRf6BUE66iP+IHEL 1RFoWILopgHBXgK25565km0WQW//Jm+yC1FQhYGrlZfUHM/58eDxlKc X-Developer-Key: i=andrea.cervesato@suse.com; a=ed25519; pk=RG/nLJ5snb1tLKGwSORQXBJ5XA4juT0WF2Pc/lq9meo= X-Rspamd-Queue-Id: 9D7EA1F871 X-Spam-Score: -4.51 X-Rspamd-Action: no action X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim,suse.com:mid,suse.com:email]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-2.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-2.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v2 2/3] Add minimum kernel requirement for FS setup X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Andrea Cervesato In some cases, a filesystem that is going to be created and mounted by LTP can't be supported by certain kernel versions. This is the case of the CoW support: mkfs creates a CoW filesystem, while underlying kernel can't mount it. To cover this scenario, a new flag called .min_kver has been introduced in the tst_fs structure, giving the user a possibility to filter out certain kernels not supporting certain FS features. Signed-off-by: Andrea Cervesato --- include/tst_test.h | 5 +++++ lib/tst_test.c | 20 ++++++++++++++------ testcases/lib/tst_run_shell.c | 5 +++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/include/tst_test.h b/include/tst_test.h index 38d24f48c..ac3ee66af 100644 --- a/include/tst_test.h +++ b/include/tst_test.h @@ -270,6 +270,9 @@ struct tst_ulimit_val { * * @mnt_data: The data passed to mount(2) when the test library mounts a device * in the case of 'tst_test.mount_device'. + * + * @min_kver: minimum kernel version supporting the filesystem which has been + * created with mkfs. */ struct tst_fs { const char *type; @@ -280,6 +283,8 @@ struct tst_fs { unsigned int mnt_flags; const void *mnt_data; + + const char *min_kver; }; /** diff --git a/lib/tst_test.c b/lib/tst_test.c index 7dfab4677..49a46fc7b 100644 --- a/lib/tst_test.c +++ b/lib/tst_test.c @@ -946,19 +946,24 @@ static void do_exit(int ret) exit(ret); } -void check_kver(void) +void check_kver(const char *min_kver, const int skip) { + char *msg; int v1, v2, v3; - if (tst_parse_kver(tst_test->min_kver, &v1, &v2, &v3)) { + if (tst_parse_kver(min_kver, &v1, &v2, &v3)) { tst_res(TWARN, "Invalid kernel version %s, expected %%d.%%d.%%d", - tst_test->min_kver); + min_kver); } if (tst_kvercmp(v1, v2, v3) < 0) { - tst_brk(TCONF, "The test requires kernel %s or newer", - tst_test->min_kver); + msg = "The test requires kernel %s or newer"; + + if (skip) + tst_res(TCONF, msg, min_kver); + else + tst_brk(TCONF, msg, min_kver); } } @@ -1150,6 +1155,9 @@ static void prepare_device(struct tst_fs *fs) char buf[1024]; struct tst_fs dummy = {}; + if (fs->min_kver) + check_kver(fs->min_kver, 1); + fs = fs ?: &dummy; const char *const extra[] = {fs->mkfs_size_opt, NULL}; @@ -1287,7 +1295,7 @@ static void do_setup(int argc, char *argv[]) tst_brk(TCONF, "Test needs to be run as root"); if (tst_test->min_kver) - check_kver(); + check_kver(tst_test->min_kver, 0); if (tst_test->supported_archs && !tst_is_on_arch(tst_test->supported_archs)) tst_brk(TCONF, "This arch '%s' is not supported for test!", tst_arch.name); diff --git a/testcases/lib/tst_run_shell.c b/testcases/lib/tst_run_shell.c index fbfbe16a7..dc840782a 100644 --- a/testcases/lib/tst_run_shell.c +++ b/testcases/lib/tst_run_shell.c @@ -155,6 +155,7 @@ enum fs_ids { MKFS_SIZE_OPT, MKFS_VER, MNT_FLAGS, + FS_MIN_KVER, TYPE, }; @@ -163,6 +164,7 @@ static ujson_obj_attr fs_attrs[] = { UJSON_OBJ_ATTR_IDX(MKFS_VER, "mkfs_ver", UJSON_STR), UJSON_OBJ_ATTR_IDX(MKFS_SIZE_OPT, "mkfs_size_opt", UJSON_STR), UJSON_OBJ_ATTR_IDX(MNT_FLAGS, "mnt_flags", UJSON_ARR), + UJSON_OBJ_ATTR_IDX(FS_MIN_KVER, "min_kver", UJSON_STR), UJSON_OBJ_ATTR_IDX(TYPE, "type", UJSON_STR), }; @@ -229,6 +231,9 @@ static struct tst_fs *parse_filesystems(ujson_reader *reader, ujson_val *val) case MKFS_VER: ret[i].mkfs_ver = strdup(val->val_str); break; + case FS_MIN_KVER: + ret[i].min_kver = strdup(val->val_str); + break; case MNT_FLAGS: ret[i].mnt_flags = parse_mnt_flags(reader, val); break; From patchwork Tue Oct 1 13:52:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1991480 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TsHhBmJj; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=c466NlUs; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TsHhBmJj; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=c466NlUs; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XHzs33Jdwz1xsq for ; Tue, 1 Oct 2024 23:52:23 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 925213C5918 for ; Tue, 1 Oct 2024 15:52:20 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (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 picard.linux.it (Postfix) with ESMTPS id E51AA3C58E2 for ; Tue, 1 Oct 2024 15:52:16 +0200 (CEST) Authentication-Results: in-4.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=195.135.223.131; helo=smtp-out2.suse.de; envelope-from=andrea.cervesato@suse.de; receiver=lists.linux.it) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 61D2410089A0 for ; Tue, 1 Oct 2024 15:52:16 +0200 (CEST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id BC0F11F897 for ; Tue, 1 Oct 2024 13:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cvk8GbtWZgKPyTfBh0Z/2Rr/7SObxaS0XyYNheumvbw=; b=TsHhBmJjQtfUpRJ84LxWubXNFi7G2/XVV0OIfhDeKKwwXBlIrmUBCtPyUjNqeSbmxfXX2R h/cOA9xvc8rR5CpqucodtRiezKmCz7M+ko3kGHOrPPkDqcNDAantSXsJI4JptSS4+J9MO6 1wyGG11rHwk8MDfQqxpxRQwaBlH8LlM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cvk8GbtWZgKPyTfBh0Z/2Rr/7SObxaS0XyYNheumvbw=; b=c466NlUsUUsqzv7Im/nvCWg81PnVPHOif4IB6g3S7paJpwmQitKflaiRt6hyOLi6q+4wDk j1FKlSfT95PoJxDw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=TsHhBmJj; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=c466NlUs DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cvk8GbtWZgKPyTfBh0Z/2Rr/7SObxaS0XyYNheumvbw=; b=TsHhBmJjQtfUpRJ84LxWubXNFi7G2/XVV0OIfhDeKKwwXBlIrmUBCtPyUjNqeSbmxfXX2R h/cOA9xvc8rR5CpqucodtRiezKmCz7M+ko3kGHOrPPkDqcNDAantSXsJI4JptSS4+J9MO6 1wyGG11rHwk8MDfQqxpxRQwaBlH8LlM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727790735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cvk8GbtWZgKPyTfBh0Z/2Rr/7SObxaS0XyYNheumvbw=; b=c466NlUsUUsqzv7Im/nvCWg81PnVPHOif4IB6g3S7paJpwmQitKflaiRt6hyOLi6q+4wDk j1FKlSfT95PoJxDw== Received: from imap1.dmz-prg2.suse.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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A3E7A13A91 for ; Tue, 1 Oct 2024 13:52:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id iL44Jo/++2bJFQAAD6G6ig (envelope-from ) for ; Tue, 01 Oct 2024 13:52:15 +0000 From: Andrea Cervesato Date: Tue, 01 Oct 2024 15:52:05 +0200 MIME-Version: 1.0 Message-Id: <20241001-ioctl_ficlone01_fix-v2-3-dd0b021dd31d@suse.com> References: <20241001-ioctl_ficlone01_fix-v2-0-dd0b021dd31d@suse.com> In-Reply-To: <20241001-ioctl_ficlone01_fix-v2-0-dd0b021dd31d@suse.com> To: ltp@lists.linux.it X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1727790735; l=3555; i=andrea.cervesato@suse.com; s=20240812; h=from:subject:message-id; bh=RgTfxfiluy9UvaTBEKpMBsjgt0Rgcjt91fUYwmzmWtg=; b=3tyjG8MQt1cbKdfEvlLfi0ygUAYoqboR7MVdXIQaUVmVLyLE0P1lu/nbeYMerkI9+YhQy/rRi hUvD0MK9hzMBqXZZyP0wTr/SfpKezborUuydHALG6iPATNKPqT1lpCJ X-Developer-Key: i=andrea.cervesato@suse.com; a=ed25519; pk=RG/nLJ5snb1tLKGwSORQXBJ5XA4juT0WF2Pc/lq9meo= X-Rspamd-Queue-Id: BC0F11F897 X-Spam-Level: X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.com:email,suse.com:mid,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -4.51 X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-4.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-4.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v2 3/3] Setup minimal kernel for ioctl_clone(range) tests X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Andrea Cervesato Some linux kernels don't support copy-on-write feature for the filesystems we are going to use during ioctl_ficlone and ioctl_ficlonerange tests. For this reason, fix the minimal kernel version required in order to skip test when it's needed. In particular: - 4.16 removed experimental support for XFS reflink - 6.7 added support for bcachefs Signed-off-by: Andrea Cervesato --- testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c | 7 ++++++- testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c | 7 ++++++- testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c | 7 ++++++- testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c | 7 ++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c index f5407f789..2e2962872 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c @@ -112,10 +112,15 @@ static struct tst_test test = { .mount_device = 1, .mntpoint = MNTPOINT, .filesystems = (struct tst_fs []) { - {.type = "bcachefs"}, {.type = "btrfs"}, + { + .type = "bcachefs", + .min_kver = "6.7", + }, { .type = "xfs", + .min_kver = "4.16", + .mkfs_ver = "mkfs.xfs >= 1.5.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {} diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c index 3cc386c59..fa99d634e 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c @@ -110,10 +110,15 @@ static struct tst_test test = { .mount_device = 1, .mntpoint = MNTPOINT, .filesystems = (struct tst_fs []) { - {.type = "bcachefs"}, {.type = "btrfs"}, + { + .type = "bcachefs", + .min_kver = "6.7", + }, { .type = "xfs", + .min_kver = "4.16", + .mkfs_ver = "mkfs.xfs >= 1.5.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {} diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c index e352c513b..800bf871d 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c @@ -145,10 +145,15 @@ static struct tst_test test = { .mount_device = 1, .mntpoint = MNTPOINT, .filesystems = (struct tst_fs []) { - {.type = "bcachefs"}, {.type = "btrfs"}, + { + .type = "bcachefs", + .min_kver = "6.7", + }, { .type = "xfs", + .min_kver = "4.16", + .mkfs_ver = "mkfs.xfs >= 1.5.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {} diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c index ad36df162..6c76f83f7 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c @@ -82,10 +82,15 @@ static struct tst_test test = { .mount_device = 1, .mntpoint = MNTPOINT, .filesystems = (struct tst_fs []) { - {.type = "bcachefs"}, {.type = "btrfs"}, + { + .type = "bcachefs", + .min_kver = "6.7", + }, { .type = "xfs", + .min_kver = "4.16", + .mkfs_ver = "mkfs.xfs >= 1.5.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {}