From 2c1414d2f44064fb5b30d34281378316c75768bc Mon Sep 17 00:00:00 2001 From: shangyibin Date: Sat, 8 Jan 2022 15:45:20 +0800 Subject: [PATCH] Fix test failed --- 2.36-login-lastlog-create.patch | 12 +++++++ ...-resolve-uname26-version-test-failed.patch | 34 +++++++++++++++++++ note-unshare-test.patch | 25 ++++++++++++++ util-linux.spec | 13 ++++++- 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 2.36-login-lastlog-create.patch create mode 100644 Add-check-to-resolve-uname26-version-test-failed.patch create mode 100644 note-unshare-test.patch diff --git a/2.36-login-lastlog-create.patch b/2.36-login-lastlog-create.patch new file mode 100644 index 0000000..e2523d3 --- /dev/null +++ b/2.36-login-lastlog-create.patch @@ -0,0 +1,12 @@ +diff -up util-linux-2.36/login-utils/login.c.kzak util-linux-2.36/login-utils/login.c +--- util-linux-2.36/login-utils/login.c.kzak 2020-07-23 14:13:26.777030764 +0200 ++++ util-linux-2.36/login-utils/login.c 2020-07-23 14:11:22.793686983 +0200 +@@ -585,7 +585,7 @@ static void log_lastlog(struct login_con + sa.sa_handler = SIG_IGN; + sigaction(SIGXFSZ, &sa, &oldsa_xfsz); + +- fd = open(_PATH_LASTLOG, O_RDWR, 0); ++ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0); + if (fd < 0) + goto done; + offset = cxt->pwd->pw_uid * sizeof(ll); diff --git a/Add-check-to-resolve-uname26-version-test-failed.patch b/Add-check-to-resolve-uname26-version-test-failed.patch new file mode 100644 index 0000000..193c6ed --- /dev/null +++ b/Add-check-to-resolve-uname26-version-test-failed.patch @@ -0,0 +1,34 @@ +From 72466ac801928c205604b99fe01f830809bda930 Mon Sep 17 00:00:00 2001 +From: Liquor +Date: Thu, 17 Dec 2020 15:04:56 +0800 +Subject: [PATCH] Add check to resolve uname26-version test failed + +The uname command is modified in packages uname-build-checks, +but the uname26-version test case needs to use the uname -r query +result.As a result,the test fails. +So we add a judgment to check whether uname-build-checks is installed. +--- + tests/ts/misc/setarch | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tests/ts/misc/setarch b/tests/ts/misc/setarch +index 7c99cca..25d02c1 100755 +--- a/tests/ts/misc/setarch ++++ b/tests/ts/misc/setarch +@@ -77,7 +77,12 @@ ts_finalize_subtest "$finmsg" + # conditional subtest + if [ "$uname26_seems_supported" = "yes" ]; then + ts_init_subtest uname26-version +- tmp=$($TS_CMD_SETARCH $ARCH --uname-2.6 uname -r) ++ rpm -qa | grep -q "uname-build-checks" ++ if [ $? -eq 0 ]; then ++ tmp=$($TS_CMD_SETARCH $ARCH --uname-2.6 uname.bin -r) ++ else ++ tmp=$($TS_CMD_SETARCH $ARCH --uname-2.6 uname -r) ++ fi + if echo "$tmp" | grep -q "^2\.6\."; then + echo "kernel version changed to 2.6" >> $TS_OUTPUT + else +-- +2.27.0 + diff --git a/note-unshare-test.patch b/note-unshare-test.patch new file mode 100644 index 0000000..09d4546 --- /dev/null +++ b/note-unshare-test.patch @@ -0,0 +1,25 @@ +From d0be50500582c86431d5ecb76cadc7c6ae913d94 Mon Sep 17 00:00:00 2001 +From: shangyibin +Date: Sat, 8 Jan 2022 14:43:15 +0800 +Subject: [PATCH] note unshare test + +--- + tests/commands.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/commands.sh b/tests/commands.sh +index 4b0e2f1..0d00864 100644 +--- a/tests/commands.sh ++++ b/tests/commands.sh +@@ -103,7 +103,7 @@ TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"${ts_commandsdir}swapoff"} + TS_CMD_SWAPON=${TS_CMD_SWAPON:-"${ts_commandsdir}swapon"} + TS_CMD_UL=${TS_CMD_UL-"${ts_commandsdir}ul"} + TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"${ts_commandsdir}umount"} +-TS_CMD_UNSHARE=${TS_CMD_UNSHARE:-"${ts_commandsdir}unshare"} ++#TS_CMD_UNSHARE=${TS_CMD_UNSHARE:-"${ts_commandsdir}unshare"} + TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"${ts_commandsdir}utmpdump"} + TS_CMD_UUIDD=${TS_CMD_UUIDD-"${ts_commandsdir}uuidd"} + TS_CMD_UUIDGEN=${TS_CMD_UUIDGEN-"${ts_commandsdir}uuidgen"} +-- +2.27.0 + diff --git a/util-linux.spec b/util-linux.spec index 2daec0d..73d874d 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -3,7 +3,7 @@ Name: util-linux Version: 2.37.2 -Release: 1 +Release: 2 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -18,6 +18,11 @@ Source7: util-linux-su-l.pamd Source8: util-linux-runuser.pamd Source9: util-linux-runuser-l.pamd +Patch0: 2.36-login-lastlog-create.patch + +Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch +Patch9001: note-unshare-test.patch + BuildRequires: audit-libs-devel >= 1.0.6 gettext-devel libselinux-devel ncurses-devel pam-devel zlib-devel popt-devel BuildRequires: libutempter-devel systemd-devel systemd libuser-devel libcap-ng-devel python3-devel gcc @@ -384,6 +389,12 @@ fi %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*} %changelog +* Sat Jan 08 2022 shangyibin - 2.37.2-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix test fail + * Mon Dec 27 2021 tianwei - 2.37.2-1 - Type:enhancement - ID:NA -- Gitee