From patchwork Wed Oct 9 14:02:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1994887 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=yxDqTB9e; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=A/c+cdMp; 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=yxDqTB9e; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=A/c+cdMp; 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 4XNvk25msRz1xsq for ; Thu, 10 Oct 2024 01:03:22 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6CEF43C3281 for ; Wed, 9 Oct 2024 16:03:20 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5]) (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 2E4163C3153 for ; Wed, 9 Oct 2024 16:03:03 +0200 (CEST) Authentication-Results: in-5.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-5.smtp.seeweb.it (Postfix) with ESMTPS id 6C6ED610235 for ; Wed, 9 Oct 2024 16:03:01 +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 720F621ABE; Wed, 9 Oct 2024 14:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1728482580; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WMOjgmm3XTEf7JZUsRdWVKl53c18u/DE9wyeoR9o1Y4=; b=yxDqTB9eF0lRQeksd2xOopL8wT9jbbWU/jzg/FY6BzEsTbbK6O3LuQeusrBO6BsaTAQlip jYq2hn0RmJ5vmITAoYX8X5uf90BDp35ExmdduOpFtr9LFozhWZlBkkT+mJs1RfdSbr36Ls 5MGzFp5WtR2j32hSo8IK9PySrPc9cmw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1728482580; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WMOjgmm3XTEf7JZUsRdWVKl53c18u/DE9wyeoR9o1Y4=; b=A/c+cdMpJ8iUR0lvzdXIh6FzX1rUqHDC0zrbLCIL0e1FworaKR9eIZX3u3OGocXy8YfU4V pLSqV2kg7XU7wABQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=yxDqTB9e; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="A/c+cdMp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1728482580; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WMOjgmm3XTEf7JZUsRdWVKl53c18u/DE9wyeoR9o1Y4=; b=yxDqTB9eF0lRQeksd2xOopL8wT9jbbWU/jzg/FY6BzEsTbbK6O3LuQeusrBO6BsaTAQlip jYq2hn0RmJ5vmITAoYX8X5uf90BDp35ExmdduOpFtr9LFozhWZlBkkT+mJs1RfdSbr36Ls 5MGzFp5WtR2j32hSo8IK9PySrPc9cmw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1728482580; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WMOjgmm3XTEf7JZUsRdWVKl53c18u/DE9wyeoR9o1Y4=; b=A/c+cdMpJ8iUR0lvzdXIh6FzX1rUqHDC0zrbLCIL0e1FworaKR9eIZX3u3OGocXy8YfU4V pLSqV2kg7XU7wABQ== 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 6C8C413A58; Wed, 9 Oct 2024 14:02:57 +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 kMP1GhGNBmcIPAAAD6G6ig (envelope-from ); Wed, 09 Oct 2024 14:02:57 +0000 From: Andrea Cervesato Date: Wed, 09 Oct 2024 16:02:40 +0200 MIME-Version: 1.0 Message-Id: <20241009-ioctl_ficlone01_fix-v5-1-943238be9923@suse.com> References: <20241009-ioctl_ficlone01_fix-v5-0-943238be9923@suse.com> In-Reply-To: <20241009-ioctl_ficlone01_fix-v5-0-943238be9923@suse.com> To: ltp@lists.linux.it X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728482574; l=9538; i=andrea.cervesato@suse.com; s=20240812; h=from:subject:message-id; bh=bA0VXv1Qd0FofAopoQmALhpEMKAYClmkuUSIdwB2N+o=; b=gIyfEp2wIr8m2LnQjjd477IO6wVBtdg4L8by6by1XRk2AmY8CHAqVHEywavPSab5ZLbFO+sqh tkFmhYlQo+yDfiYnmub9IyRhrw+WFLBw/yTpGh+aonsW9GpNCCYkQWr X-Developer-Key: i=andrea.cervesato@suse.com; a=ed25519; pk=RG/nLJ5snb1tLKGwSORQXBJ5XA4juT0WF2Pc/lq9meo= X-Rspamd-Queue-Id: 720F621ABE 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)[]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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)[]; RCPT_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; URIBL_BLOCKED(0.00)[suse.com:mid,suse.com:email,suse.de:dkim,suse.cz:email]; 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: 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,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-5.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-5.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v5 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. Reviewed-by: Cyril Hrubis Signed-off-by: Andrea Cervesato --- include/tst_private.h | 6 +- include/tst_test.h | 4 ++ lib/tst_cmd.c | 131 +++++++++++++++++++----------------------- lib/tst_test.c | 13 ++++- testcases/lib/tst_run_shell.c | 5 ++ 5 files changed, 80 insertions(+), 79 deletions(-) diff --git a/include/tst_private.h b/include/tst_private.h index 6f4f39b15..4c6479f4b 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 if brk_nosupp 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 if brk_nosupp is defined. */ -void tst_check_cmd(const char *cmd); +int tst_check_cmd(const char *cmd, const int brk_nosupp); #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..82d60497a 100644 --- a/lib/tst_cmd.c +++ b/lib/tst_cmd.c @@ -34,16 +34,6 @@ #define OPEN_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) #define OPEN_FLAGS (O_WRONLY | O_APPEND | O_CREAT) -enum cmd_op { - OP_GE, /* >= */ - OP_GT, /* > */ - OP_LE, /* <= */ - OP_LT, /* < */ - OP_EQ, /* == */ - OP_NE, /* != */ -}; - - int tst_cmd_fds_(void (cleanup_fn)(void), const char *const argv[], int stdout_fd, @@ -210,7 +200,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,23 +218,44 @@ 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) +int tst_check_cmd(const char *cmd, const int brk_nosupp) { struct version_parser *p; char *cmd_token, *op_token, *version_token, *next, *str; char path[PATH_MAX]; char parser_cmd[100]; int ver_parser, ver_get; - int op_flag = 0; strcpy(parser_cmd, cmd); @@ -257,22 +268,7 @@ void tst_check_cmd(const char *cmd) tst_brkm(TCONF, NULL, "Couldn't find '%s' in $PATH", cmd_token); if (!op_token) - return; - - if (!strcmp(op_token, ">=")) - op_flag = OP_GE; - else if (!strcmp(op_token, ">")) - op_flag = OP_GT; - else if (!strcmp(op_token, "<=")) - op_flag = OP_LE; - else if (!strcmp(op_token, "<")) - op_flag = OP_LT; - else if (!strcmp(op_token, "==")) - op_flag = OP_EQ; - else if (!strcmp(op_token, "!=")) - op_flag = OP_NE; - else - tst_brkm(TCONF, NULL, "Invalid op(%s)", op_token); + return 0; if (!version_token || str) { tst_brkm(TCONF, NULL, @@ -300,48 +296,37 @@ void tst_check_cmd(const char *cmd) if (ver_get < 0) tst_brkm(TBROK, NULL, "Failed to get %s version", p->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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - break; + if (!strcmp(op_token, ">=")) { + if (ver_parser < ver_get) + goto error; + } else if (!strcmp(op_token, ">")) { + if (ver_parser <= ver_get) + goto error; + } else if (!strcmp(op_token, "<=")) { + if (ver_parser > ver_get) + goto error; + } else if (!strcmp(op_token, "<")) { + if (ver_parser >= ver_get) + goto error; + } else if (!strcmp(op_token, "==")) { + if (ver_parser != ver_get) + goto error; + } else if (!strcmp(op_token, "!=")) { + if (ver_parser == ver_get) + goto error; + } else { + tst_brkm(TCONF, NULL, "Invalid op(%s)", op_token); } + + return 0; +error: + if (brk_nosupp) { + tst_brkm(TCONF, NULL, "%s requires %s %d, but got %d", + cmd, op_token, ver_get, ver_parser); + } else { + tst_resm(TCONF, "%s requires %s %d, but got %d", + cmd, op_token, ver_get, ver_parser); + } + + return 1; } diff --git a/lib/tst_test.c b/lib/tst_test.c index d226157e0..9015f28e3 100644 --- a/lib/tst_test.c +++ b/lib/tst_test.c @@ -1310,7 +1310,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, 1); } if (tst_test->needs_drivers) { @@ -1415,8 +1415,12 @@ static void do_setup(int argc, char *argv[]) tdev.fs_type = default_fs_type(); - if (!tst_test->all_filesystems && count_fs_descs() <= 1) + if (!tst_test->all_filesystems && count_fs_descs() <= 1) { + if (tst_test->filesystems->mkfs_ver) + tst_check_cmd(tst_test->filesystems->mkfs_ver, 1); + prepare_device(tst_test->filesystems); + } } if (tst_test->needs_overlay && !tst_test->mount_device) @@ -1805,6 +1809,9 @@ static int run_tcase_on_fs(struct tst_fs *fs, const char *fs_type) tst_res(TINFO, "=== Testing on %s ===", fs_type); tdev.fs_type = fs_type; + if (fs->mkfs_ver && tst_check_cmd(fs->mkfs_ver, 0)) + return TCONF; + prepare_device(fs); ret = fork_testrun(); @@ -1832,7 +1839,7 @@ static int run_tcases_per_fs(void) if (!fs) continue; - run_tcase_on_fs(fs, filesystems[i]); + ret = run_tcase_on_fs(fs, filesystems[i]); if (ret == TCONF) continue; diff --git a/testcases/lib/tst_run_shell.c b/testcases/lib/tst_run_shell.c index 8ed0f21b6..ee029b666 100644 --- a/testcases/lib/tst_run_shell.c +++ b/testcases/lib/tst_run_shell.c @@ -153,6 +153,7 @@ 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, }; @@ -160,6 +161,7 @@ enum fs_ids { static ujson_obj_attr fs_attrs[] = { UJSON_OBJ_ATTR_IDX(MKFS_OPTS, "mkfs_opts", UJSON_ARR), UJSON_OBJ_ATTR_IDX(MKFS_SIZE_OPT, "mkfs_size_opt", UJSON_STR), + UJSON_OBJ_ATTR_IDX(MKFS_VER, "mkfs_ver", 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 Wed Oct 9 14:02:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1994889 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=tCw3QyB4; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=h0CbLUMg; 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=Ou4w619w; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=abfKxyL4; 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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XNvkX1kPJz1xtp for ; Thu, 10 Oct 2024 01:03:48 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D53EE3C3236 for ; Wed, 9 Oct 2024 16:03:43 +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 [IPv6:2001:4b78:1:20::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 9F4493C3100 for ; Wed, 9 Oct 2024 16:03:06 +0200 (CEST) Authentication-Results: in-4.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=2a07:de40:b251:101:10:150:64:1; 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 [IPv6:2a07:de40:b251:101:10:150:64:1]) (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 F21F510122B5 for ; Wed, 9 Oct 2024 16:03:05 +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 6E9EB21ABE; Wed, 9 Oct 2024 14:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1728482584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4rqQ08MeNm0U3dfHuq2plInYcF7/AdVjM7luMK3C4tU=; b=tCw3QyB4758Yv8ujqDcHfEy/nbx99BMcfz1NstFZSgLlYzrXr4v2eIFG1QuTjLiYaTc9J9 qCp92Nbg8BM7fy26Bdul2ixPRYsEZ++2JQacxPfalb4S+wIwsqgDSdCr4s4HSN69ajlbtG 1NVUFJie8rtS4hWpFF8AIX8BGA+cJxE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1728482584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4rqQ08MeNm0U3dfHuq2plInYcF7/AdVjM7luMK3C4tU=; b=h0CbLUMgvrTPQrt7YqcAs8mYbq54PmBr45PEwubo+fcO/NejTQ52/yGwX9XoANOcgGd7pk nNyVesWYZ58B9MAg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Ou4w619w; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=abfKxyL4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1728482583; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4rqQ08MeNm0U3dfHuq2plInYcF7/AdVjM7luMK3C4tU=; b=Ou4w619wRf53Tb5Q8wUQbGuROMSlKreCbP5aybCLTb0gR+7uyiqSr+qGQ2yI2OVW9AX4PY rveyX8jeW4T3dvOFXnyPWeIS6pS6yWfFTVolG9Jnk6UUHKyKXPkmlkRqAmSDXQk1Sfdr8g bdNteXqcPx8tacPoTg45Z7WI20pJ8HY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1728482583; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4rqQ08MeNm0U3dfHuq2plInYcF7/AdVjM7luMK3C4tU=; b=abfKxyL4POkMtzq86iG/nxwkl/fysD4JkStJNXBacbp0LLdaQ4NLJ7HiClk6kVDNUnNIAK e0HdoUjNvIO5sFAg== 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 30FAD13A58; Wed, 9 Oct 2024 14:03:01 +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 IANzIxWNBmcIPAAAD6G6ig (envelope-from ); Wed, 09 Oct 2024 14:03:01 +0000 From: Andrea Cervesato Date: Wed, 09 Oct 2024 16:02:41 +0200 MIME-Version: 1.0 Message-Id: <20241009-ioctl_ficlone01_fix-v5-2-943238be9923@suse.com> References: <20241009-ioctl_ficlone01_fix-v5-0-943238be9923@suse.com> In-Reply-To: <20241009-ioctl_ficlone01_fix-v5-0-943238be9923@suse.com> To: ltp@lists.linux.it X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728482574; l=4278; i=andrea.cervesato@suse.com; s=20240812; h=from:subject:message-id; bh=Rj9aUj/UYdrtnL40m2rhm/S27dPPc3jH8UjZjvxGspU=; b=kfaCTMPjneZGYKztb0XsBDKPk8M1KcbhxkMeIVysX9m60hlRFKfG/ly14K1L+Gr+DHcPGWBYb vEnoLfjoO3NCNfFDiYI6ypgX00PqEZXzwvzT0UvzOBRvARXsT+XuN38 X-Developer-Key: i=andrea.cervesato@suse.com; a=ed25519; pk=RG/nLJ5snb1tLKGwSORQXBJ5XA4juT0WF2Pc/lq9meo= X-Rspamd-Queue-Id: 6E9EB21ABE 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)[]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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)[]; RCPT_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[tst_arch.name:url,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim]; URIBL_BLOCKED(0.00)[suse.com:mid,suse.com:email,suse.de:dkim,suse.cz:email]; 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: 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,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 v5 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. Reviewed-by: Cyril Hrubis Signed-off-by: Andrea Cervesato --- include/tst_test.h | 5 +++++ lib/tst_test.c | 27 +++++++++++++++++++++------ testcases/lib/tst_run_shell.c | 5 +++++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/include/tst_test.h b/include/tst_test.h index 38d24f48c..8d1819f74 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: A 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 9015f28e3..8d205a42f 100644 --- a/lib/tst_test.c +++ b/lib/tst_test.c @@ -950,20 +950,29 @@ static void do_exit(int ret) exit(ret); } -void check_kver(void) +int check_kver(const char *min_kver, const int brk_nosupp) { + 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 (brk_nosupp) + tst_brk(TCONF, msg, min_kver); + else + tst_res(TCONF, msg, min_kver); + + return 1; } + + return 0; } static int results_equal(struct results *a, struct results *b) @@ -1288,7 +1297,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, 1); 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); @@ -1419,6 +1428,9 @@ static void do_setup(int argc, char *argv[]) if (tst_test->filesystems->mkfs_ver) tst_check_cmd(tst_test->filesystems->mkfs_ver, 1); + if (tst_test->filesystems->min_kver) + check_kver(tst_test->filesystems->min_kver, 1); + prepare_device(tst_test->filesystems); } } @@ -1812,6 +1824,9 @@ static int run_tcase_on_fs(struct tst_fs *fs, const char *fs_type) if (fs->mkfs_ver && tst_check_cmd(fs->mkfs_ver, 0)) return TCONF; + if (fs->min_kver && check_kver(fs->min_kver, 0)) + return TCONF; + prepare_device(fs); ret = fork_testrun(); diff --git a/testcases/lib/tst_run_shell.c b/testcases/lib/tst_run_shell.c index ee029b666..95cac0d60 100644 --- a/testcases/lib/tst_run_shell.c +++ b/testcases/lib/tst_run_shell.c @@ -151,6 +151,7 @@ static const char *const *parse_strarr(ujson_reader *reader, ujson_val *val) } enum fs_ids { + FS_MIN_KVER, MKFS_OPTS, MKFS_SIZE_OPT, MKFS_VER, @@ -159,6 +160,7 @@ enum fs_ids { }; static ujson_obj_attr fs_attrs[] = { + UJSON_OBJ_ATTR_IDX(FS_MIN_KVER, "min_kver", UJSON_STR), UJSON_OBJ_ATTR_IDX(MKFS_OPTS, "mkfs_opts", UJSON_ARR), UJSON_OBJ_ATTR_IDX(MKFS_SIZE_OPT, "mkfs_size_opt", UJSON_STR), UJSON_OBJ_ATTR_IDX(MKFS_VER, "mkfs_ver", UJSON_STR), @@ -235,6 +237,9 @@ static struct tst_fs *parse_filesystems(ujson_reader *reader, ujson_val *val) case TYPE: ret[i].type = strdup(val->val_str); break; + case FS_MIN_KVER: + ret[i].min_kver = strdup(val->val_str); + break; } } From patchwork Wed Oct 9 14:02:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1994891 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=1u525Oq0; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=psRz/zoB; 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=1u525Oq0; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=psRz/zoB; 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 4XNvkq5h4gz1xsq for ; Thu, 10 Oct 2024 01:04:03 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7E2FF3C30CF for ; Wed, 9 Oct 2024 16:04:01 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) (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 241A93C31F4 for ; Wed, 9 Oct 2024 16:03:07 +0200 (CEST) Authentication-Results: in-3.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=2a07:de40:b251:101:10:150:64:2; 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 [IPv6:2a07:de40:b251:101:10:150:64:2]) (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-3.smtp.seeweb.it (Postfix) with ESMTPS id 9E7411B60EE4 for ; Wed, 9 Oct 2024 16:03:06 +0200 (CEST) Received: from imap1.dmz-prg2.suse.org (unknown [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 798011F37E; Wed, 9 Oct 2024 14:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1728482585; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MCDmWWebi3g5riEviSKnLuJ1sQ6bQhXVAFPA/DWTSI0=; b=1u525Oq0QTfvbvweAOp6ORFEyB2z1lHlvm/DRDioMbKnjYN0nDn0iq0kq3mAJgbb8CEMhP fM1+rUQ7bOyjHun838Vjc7HauublFpbBdNs4Lnzld3QeZbGvW3lHFHEiPq66dFfc8Q0GPb P1RfnQKJJSBB2ejiRxDLQUwZbkADlmk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1728482585; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MCDmWWebi3g5riEviSKnLuJ1sQ6bQhXVAFPA/DWTSI0=; b=psRz/zoB+aYbiuYtvLDwjxDyKCc9eCxV9Qn7FRdPUSWfTnQf++eHibDTixdKIXIknBWB8Q Kd8JRCU0sH/49/CA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1728482585; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MCDmWWebi3g5riEviSKnLuJ1sQ6bQhXVAFPA/DWTSI0=; b=1u525Oq0QTfvbvweAOp6ORFEyB2z1lHlvm/DRDioMbKnjYN0nDn0iq0kq3mAJgbb8CEMhP fM1+rUQ7bOyjHun838Vjc7HauublFpbBdNs4Lnzld3QeZbGvW3lHFHEiPq66dFfc8Q0GPb P1RfnQKJJSBB2ejiRxDLQUwZbkADlmk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1728482585; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MCDmWWebi3g5riEviSKnLuJ1sQ6bQhXVAFPA/DWTSI0=; b=psRz/zoB+aYbiuYtvLDwjxDyKCc9eCxV9Qn7FRdPUSWfTnQf++eHibDTixdKIXIknBWB8Q Kd8JRCU0sH/49/CA== 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 D392413AAF; Wed, 9 Oct 2024 14:03:03 +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 sOzOJReNBmcIPAAAD6G6ig (envelope-from ); Wed, 09 Oct 2024 14:03:03 +0000 From: Andrea Cervesato Date: Wed, 09 Oct 2024 16:02:42 +0200 MIME-Version: 1.0 Message-Id: <20241009-ioctl_ficlone01_fix-v5-3-943238be9923@suse.com> References: <20241009-ioctl_ficlone01_fix-v5-0-943238be9923@suse.com> In-Reply-To: <20241009-ioctl_ficlone01_fix-v5-0-943238be9923@suse.com> To: ltp@lists.linux.it X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728482574; l=3339; i=andrea.cervesato@suse.com; s=20240812; h=from:subject:message-id; bh=rz/C4527EvRU6IJoAHfeVfx0dIS/IqQQqaTPxr8UlyE=; b=AQjl6/ad0HSzmA/HZ/tpAomsWbJc9tMYqxCaRcvaYDREzoRkgsUzro598ui6PZjQeyLD/idiU mHCI7FS7JGOCJnbqwltCLw3kpMCmrKHWh4sqH4KBIGvyEat2zQKeybz X-Developer-Key: i=andrea.cervesato@suse.com; a=ed25519; pk=RG/nLJ5snb1tLKGwSORQXBJ5XA4juT0WF2Pc/lq9meo= X-Spam-Level: X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo, suse.com:email, suse.com:mid] X-Spam-Score: -4.30 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-3.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-3.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v5 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. Reviewed-by: Cyril Hrubis Signed-off-by: Andrea Cervesato --- testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c | 4 +++- testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c | 4 +++- testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c | 4 +++- testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c index f5407f789..2574bb6a2 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c @@ -112,10 +112,12 @@ static struct tst_test test = { .mount_device = 1, .mntpoint = MNTPOINT, .filesystems = (struct tst_fs []) { - {.type = "bcachefs"}, {.type = "btrfs"}, + {.type = "bcachefs"}, { .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..f12c4e7fd 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c @@ -110,10 +110,12 @@ static struct tst_test test = { .mount_device = 1, .mntpoint = MNTPOINT, .filesystems = (struct tst_fs []) { - {.type = "bcachefs"}, {.type = "btrfs"}, + {.type = "bcachefs"}, { .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..8fd1d299a 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c @@ -145,10 +145,12 @@ static struct tst_test test = { .mount_device = 1, .mntpoint = MNTPOINT, .filesystems = (struct tst_fs []) { - {.type = "bcachefs"}, {.type = "btrfs"}, + {.type = "bcachefs"}, { .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..eb941c3fc 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c @@ -82,10 +82,12 @@ static struct tst_test test = { .mount_device = 1, .mntpoint = MNTPOINT, .filesystems = (struct tst_fs []) { - {.type = "bcachefs"}, {.type = "btrfs"}, + {.type = "bcachefs"}, { .type = "xfs", + .min_kver = "4.16", + .mkfs_ver = "mkfs.xfs >= 1.5.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {}