Panu Matilainen 7f79c1
From 92b718bb0e98ecaea6d4229eab9ef3bc0220d9c2 Mon Sep 17 00:00:00 2001
Panu Matilainen 7f79c1
Message-Id: <92b718bb0e98ecaea6d4229eab9ef3bc0220d9c2.1507815046.git.pmatilai@redhat.com>
Panu Matilainen 7f79c1
From: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 7f79c1
Date: Thu, 12 Oct 2017 15:51:26 +0300
Panu Matilainen 7f79c1
Subject: [PATCH] Don't assume per-user groups in test-suite
Panu Matilainen 7f79c1
Panu Matilainen 7f79c1
The tests from commits f2d3be2a8741234faaa96f5fd05fdfdc75779a79 and
Panu Matilainen 7f79c1
c815822c8bdb138066ff58c624ae83e3a12ebfa9 assume per-user groups,
Panu Matilainen 7f79c1
but this is not a generally valid assumption and causes unnecessary
Panu Matilainen 7f79c1
bogus failures in the test-suite in some setups (eg mock)
Panu Matilainen 7f79c1
---
Panu Matilainen 7f79c1
 tests/data/SPECS/replacetest.spec | 3 ++-
Panu Matilainen 7f79c1
 tests/rpmreplace.at               | 2 ++
Panu Matilainen 7f79c1
 tests/rpmverify.at                | 1 +
Panu Matilainen 7f79c1
 3 files changed, 5 insertions(+), 1 deletion(-)
Panu Matilainen 7f79c1
Panu Matilainen 7f79c1
diff --git a/tests/data/SPECS/replacetest.spec b/tests/data/SPECS/replacetest.spec
Panu Matilainen 7f79c1
index c764adc27..54974567b 100644
Panu Matilainen 7f79c1
--- a/tests/data/SPECS/replacetest.spec
Panu Matilainen 7f79c1
+++ b/tests/data/SPECS/replacetest.spec
Panu Matilainen 7f79c1
@@ -1,6 +1,7 @@
Panu Matilainen 7f79c1
 %{!?filetype: %global filetype file}
Panu Matilainen 7f79c1
 %{?fixit: %global havepretrans 1}
Panu Matilainen 7f79c1
 %{!?user: %global user root}
Panu Matilainen 7f79c1
+%{!?grp: %global grp root}
Panu Matilainen 7f79c1
 
Panu Matilainen 7f79c1
 Name:		replacetest%{?sub:-%{sub}}
Panu Matilainen 7f79c1
 Version:	%{ver}
Panu Matilainen 7f79c1
@@ -44,5 +45,5 @@ rm -rf $RPM_BUILD_ROOT
Panu Matilainen 7f79c1
 %endif
Panu Matilainen 7f79c1
 
Panu Matilainen 7f79c1
 %files
Panu Matilainen 7f79c1
-%defattr(-,%{user},%{user},-)
Panu Matilainen 7f79c1
+%defattr(-,%{user},%{grp},-)
Panu Matilainen 7f79c1
 /opt/*
Panu Matilainen 7f79c1
diff --git a/tests/rpmreplace.at b/tests/rpmreplace.at
Panu Matilainen 7f79c1
index 11e6221d7..6f0444bb7 100644
Panu Matilainen 7f79c1
--- a/tests/rpmreplace.at
Panu Matilainen 7f79c1
+++ b/tests/rpmreplace.at
Panu Matilainen 7f79c1
@@ -403,6 +403,7 @@ runroot rpmbuild --quiet -bb \
Panu Matilainen 7f79c1
 	--define "filetype datadir" \
Panu Matilainen 7f79c1
 	--define "filedata README1" \
Panu Matilainen 7f79c1
 	--define "user $(id -u -n)" \
Panu Matilainen 7f79c1
+	--define "grp $(id -g -n)" \
Panu Matilainen 7f79c1
           /data/SPECS/replacetest.spec
Panu Matilainen 7f79c1
 
Panu Matilainen 7f79c1
 runroot rpmbuild --quiet -bb \
Panu Matilainen 7f79c1
@@ -410,6 +411,7 @@ runroot rpmbuild --quiet -bb \
Panu Matilainen 7f79c1
 	--define "filetype datadir" \
Panu Matilainen 7f79c1
 	--define "filedata README2" \
Panu Matilainen 7f79c1
 	--define "user $(id -u -n)" \
Panu Matilainen 7f79c1
+	--define "grp $(id -g -n)" \
Panu Matilainen 7f79c1
           /data/SPECS/replacetest.spec
Panu Matilainen 7f79c1
 
Panu Matilainen 7f79c1
 mkdir "${RPMTEST}"/opt/f00f
Panu Matilainen 7f79c1
diff --git a/tests/rpmverify.at b/tests/rpmverify.at
Panu Matilainen 7f79c1
index c5530de69..78f50fd33 100644
Panu Matilainen 7f79c1
--- a/tests/rpmverify.at
Panu Matilainen 7f79c1
+++ b/tests/rpmverify.at
Panu Matilainen 7f79c1
@@ -78,6 +78,7 @@ runroot rpmbuild --quiet -bb \
Panu Matilainen 7f79c1
         --define "filetype datadir" \
Panu Matilainen 7f79c1
         --define "filedata README1" \
Panu Matilainen 7f79c1
         --define "user $(id -u -n)" \
Panu Matilainen 7f79c1
+        --define "grp $(id -g -n)" \
Panu Matilainen 7f79c1
           /data/SPECS/replacetest.spec
Panu Matilainen 7f79c1
 
Panu Matilainen 7f79c1
 runroot rpm -U /build/RPMS/noarch/replacetest-1.0-1.noarch.rpm
Panu Matilainen 7f79c1
-- 
Panu Matilainen 7f79c1
2.13.6
Panu Matilainen 7f79c1