Skip to contentSkip to conversation

Clean up various repository leftovers

PATCH Applied Andrea Cervesato 4 participants 9 messages Oct 7 – Oct 12

lore
Share & tools
lore
#0 lore raw

cover Clean up various repository leftovers

This series cleans up several leftover files, declarations, and ignore rules that remained after earlier refactorings, API conversions, and test removals:

1. Remove unused common_sparse.h header from testcases/kernel/io/ltp-aiodio. The header has been dead code since aiodio_sparse and dio_sparse were refactored to the new LTP API.
2. Remove .needs_checkpoints = 1 from tests that do not use checkpoints. This avoids unnecessary initialization of checkpoint IPC resources.
3. Remove stale .gitignore entries across the tree for test binaries that have been removed or merged.

---
Andrea Cervesato (3):
ltp-aiodio: Remove unused common_sparse.h
tree: Remove needs_checkpoints leftovers
tree: Remove stale .gitignore entries

 lib/newlib_tests/.gitignore                        |   1 -
 testcases/commands/.gitignore                      |   1 -
 testcases/cve/cve-2015-3290.c                      |   1 -
 testcases/kernel/containers/sysvipc/shmnstest.c    |   1 -
 testcases/kernel/containers/utsname/utsname04.c    |   1 -
 testcases/kernel/io/ltp-aiodio/common_sparse.h     | 129 ---------------------
 .../kernel/syscalls/exit_group/exit_group01.c      |   1 -
 testcases/kernel/syscalls/getitimer/.gitignore     |   1 -
 .../syscalls/set_mempolicy/set_mempolicy01.c       |   1 -
 .../syscalls/set_mempolicy/set_mempolicy02.c       |   1 -
 .../syscalls/set_mempolicy/set_mempolicy03.c       |   1 -
 .../syscalls/set_mempolicy/set_mempolicy04.c       |   1 -
 testcases/kernel/syscalls/syslog/.gitignore        |   1 -
 testcases/kernel/uevents/uevent03.c                |   1 -
 testcases/network/.gitignore                       |   3 -
 15 files changed, 145 deletions(-)

---
base-commit: 78e6353fdff663b2fc2f77704ceec6c3ca786b96
change-id: 20261007-fix_leftovers-3bf2ce0f1a10

Best regards,

Signature · 5 lines
Andrea Cervesato <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

PATCH 1/3 ltp-aiodio: Remove unused common_sparse.h

From: Andrea Cervesato <[email protected]>

The common_sparse.h header has been unused since aiodio_sparse and dio_sparse were refactored to the new LTP API. Remove it.

---
 testcases/kernel/io/ltp-aiodio/common_sparse.h | 129 -------------------------
 1 file changed, 129 deletions(-)
testcases/kernel/io/ltp-aiodio/common_sparse.h deleted +0 -129
deleted file mode 100644
index 3819e00a6..000000000
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2011 Cyril Hrubis <[email protected]>
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LTP_AIODIO_COMMON_SPARSE
-#define LTP_AIODIO_COMMON_SPARSE
-
-#include "common_checkzero.h"
-
-/*
- * This code tries to create dirty free blocks on
- * the HDD so there is a chance that blocks to be allocated
- * for a file are filled with something else than zeroes.
- *
- * The usefulness of this is IMHO questionable.
- */
-static void dirty_freeblocks(int size)
-{
-	int fd;
-	void *p;
-	int pg;
-	char *filename = "dirty_freeblocks";
-
-	pg = getpagesize();
-	size = ((size + pg - 1) / pg) * pg;
-
-	fd = open(filename, O_CREAT|O_RDWR|O_EXCL, 0600);
-
-	if (fd < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "failed to open '%s'", filename);
-
-	SAFE_FTRUNCATE(cleanup, fd, size);
-
-	p = SAFE_MMAP(cleanup, NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED|MAP_FILE, fd, 0);
-
-	memset(p, 0xaa, size);
-	msync(p, size, MS_SYNC);
-	munmap(p, size);
-	close(fd);
-	unlink(filename);
-}
-
-/*
- * Scale value by kilo, mega, or giga.
- */
-long long scale_by_kmg(long long value, char scale)
-{
-	switch (scale) {
-	case 'g':
-	case 'G':
-		value *= 1024;
-	case 'm':
-	case 'M':
-		value *= 1024;
-	case 'k':
-	case 'K':
-		value *= 1024;
-		break;
-	case '\0':
-		break;
-	default:
-		usage();
-		break;
-	}
-	return value;
-}
-
-/*
- * Make sure we read only zeroes,
- * either there is a hole in the file,
- * or zeroes were actually written by parent.
- */
-static void read_sparse(char *filename, int filesize)
-{
-	int fd;
-	int  i, j, r;
-	char buf[4096];
-
-	fd = open(filename, O_RDONLY);
-	if (fd == -1) {
-		if (debug)
-			fprintf(stderr, "Child %i failed to open '%s'\n",
-			        getpid(), filename);
-		exit(10);
-	}
-
-	if (debug)
-		fprintf(stderr, "Child %i has opened '%s' for reading\n",
-		        getpid(), filename);
-
-	for (i = 0; i < 100000000; i++) {
-		off_t offset = 0;
-		char *badbuf;
-
-		if (debug)
-			fprintf(stderr, "Child %i loop %i\n", getpid(), i);
-
-		lseek(fd, SEEK_SET, 0);
-		for (j = 0; j < filesize+1; j += sizeof(buf)) {
-			r = read(fd, buf, sizeof(buf));
-			if (r > 0) {
-				if ((badbuf = check_zero(buf, r))) {
-					fprintf(stderr, "non-zero read at offset %u\n",
-						(unsigned int)(offset + badbuf - buf));
-					exit(10);
-				}
-			}
-			offset += r;
-		}
-	}
-
-	exit(0);
-}
-
-#endif /* LTP_AIODIO_COMMON_SPARSE */
Signature · 5 lines
2.51.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Re: [LTP] ltp-aiodio: Remove unused common_sparse.h

Hi Andrea,

Quoted 1 line · Andrea Cervesato

ltp-aiodio: Remove unused common_sparse.h

Verdict - Reviewed

---
Note:

The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw

PATCH 2/3 tree: Remove needs_checkpoints leftovers

In reply to Andrea Cervesato

From: Andrea Cervesato <[email protected]>

Several tests declare .needs_checkpoints = 1 in struct tst_test, but do not make use of any checkpoint synchronization. Remove this leftover flag from those tests.

---
 testcases/cve/cve-2015-3290.c                             | 1 -
 testcases/kernel/containers/sysvipc/shmnstest.c           | 1 -
 testcases/kernel/containers/utsname/utsname04.c           | 1 -
 testcases/kernel/syscalls/exit_group/exit_group01.c       | 1 -
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c | 1 -
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c | 1 -
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 1 -
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 1 -
 testcases/kernel/uevents/uevent03.c                       | 1 -
 9 files changed, 9 deletions(-)
testcases/cve/cve-2015-3290.c +0 -1
index d44276860..021b5702d 100644
@@ -499,7 +499,6 @@ static void run(void)
 static struct tst_test test = {
 	.forks_child = 1,
 	.needs_root = 1,
-	.needs_checkpoints = 1,
 	.setup = setup,
 	.runtime = 180,
 	.test_all = run,
testcases/kernel/containers/sysvipc/shmnstest.c +0 -1
index aa576eb08..de27cb585 100644
@@ -66,7 +66,6 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.forks_child = 1,
 	.needs_root = 1,
-	.needs_checkpoints = 1,
 	.options = (struct tst_option[]) {
 		{ "m:", &str_op, "Test execution mode <clone|unshare|none>" },
 		{},
testcases/kernel/containers/utsname/utsname04.c +0 -1
index 2bcf61156..c328543a7 100644
@@ -53,7 +53,6 @@ static struct tst_test test = {
 	.test_all = run,
 	.needs_root = 1,
 	.forks_child = 1,
-	.needs_checkpoints = 1,
 	.options = (struct tst_option[]) {
 		{ "m:", &str_op, "Test execution mode <clone|unshare>" },
 		{},
testcases/kernel/syscalls/exit_group/exit_group01.c +0 -1
index 9005f4679..09bcccbea 100644
@@ -121,5 +121,4 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test_all = run,
 	.forks_child = 1,
-	.needs_checkpoints = 1,
 };
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +0 -1
index 07836cc69..9d93d21e6 100644
@@ -118,7 +118,6 @@ static struct tst_test test = {
 	.test = verify_set_mempolicy,
 	.tcnt = 2,
 	.forks_child = 1,
-	.needs_checkpoints = 1,
 	.timeout = 600,
 	.needs_kconfigs = (const char *const[]){
 		"CONFIG_NUMA=y",
testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c +0 -1
index d98f81545..73a9f09b4 100644
@@ -108,7 +108,6 @@ static struct tst_test test = {
 	.test = verify_set_mempolicy,
 	.tcnt = 2,
 	.forks_child = 1,
-	.needs_checkpoints = 1,
 	.needs_kconfigs = (const char *const[]){
 		"CONFIG_NUMA=y",
 		NULL
testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +0 -1
index 43e0439d4..dd9fc53b3 100644
@@ -102,7 +102,6 @@ static struct tst_test test = {
 	.all_filesystems = 1,
 	.mntpoint = MNTPOINT,
 	.forks_child = 1,
-	.needs_checkpoints = 1,
 	.needs_kconfigs = (const char *const[]){
 		"CONFIG_NUMA=y",
 		NULL
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +0 -1
index fa88385ce..55065f64a 100644
@@ -133,7 +133,6 @@ static struct tst_test test = {
 	.needs_root = 1,
 	.all_filesystems = 1,
 	.mntpoint = MNTPOINT,
-	.needs_checkpoints = 1,
 	.needs_kconfigs = (const char *const[]){
 		"CONFIG_NUMA=y",
 		NULL
testcases/kernel/uevents/uevent03.c +0 -1
index 8c8a464af..2993acb99 100644
@@ -237,7 +237,6 @@ static void verify_uevent(void)
 static struct tst_test test = {
 	.test_all = verify_uevent,
 	.forks_child = 1,
-	.needs_checkpoints = 1,
 	.needs_kconfigs = (const char *const[]) {
 		"CONFIG_INPUT_UINPUT",
 		NULL
Signature · 5 lines
2.51.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#6 lore raw

PATCH 3/3 tree: Remove stale .gitignore entries

In reply to Andrea Cervesato

From: Andrea Cervesato <[email protected]>

Remove .gitignore entries for test binaries that have been deleted or merged into other tests.

---
 lib/newlib_tests/.gitignore                    | 1 -
 testcases/commands/.gitignore                  | 1 -
 testcases/kernel/syscalls/getitimer/.gitignore | 1 -
 testcases/kernel/syscalls/syslog/.gitignore    | 1 -
 testcases/network/.gitignore                   | 3 ---
 5 files changed, 7 deletions(-)
lib/newlib_tests/.gitignore +0 -1
index b85163824..3a6e1643c 100644
@@ -43,7 +43,6 @@ tst_bool_expr
 test_macros01
 test_macros02
 test_macros03
-test_macros04
 test_macros05
 test_macros06
 tst_filesystems01
testcases/commands/.gitignore +0 -1
index ed5e13e29..2fb05e547 100644
@@ -1,5 +1,4 @@
 /ldd/datafiles/lddfile.out
 /ldd/datafiles/*.obj.so
-/eject/eject_check_tray
 /insmod/ltp_insmod01.ko
 /lsmod/ltp_lsmod01.ko
testcases/kernel/syscalls/getitimer/.gitignore +0 -1
index 6533d4b50..0a46a1021 100644
@@ -1,3 +1,2 @@
 /getitimer01
 /getitimer02
-/getitimer03
testcases/kernel/syscalls/syslog/.gitignore +0 -1
index ec2b9412e..09d2e1b50 100644
@@ -1,3 +1,2 @@
 /syslog11
 /syslog12
-/syslogtst
testcases/network/.gitignore +0 -3
index 3ebb6e33c..3011b4ba2 100644
@@ -32,9 +32,6 @@
 /stress/ns-tools/ns-mcast_join
 /stress/ns-tools/ns-mcast_receiver
 /stress/ns-tools/ns-udpsender
-/tcp_cmds/echo/createfile
-/tcp_cmds/echo/echoes
-/tcp_cmds/echo/echoes6
 /tcp_cmds/sendfile/testsf_c
 /tcp_cmds/sendfile/testsf_c6
 /tcp_cmds/sendfile/testsf_s
Signature · 5 lines
2.51.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp