* [LTP] (no subject)
@ 2013-08-05 14:44 Stanislav Kholmanskikh
2013-08-05 14:44 ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes Stanislav Kholmanskikh
0 siblings, 1 reply; 4+ messages in thread
From: Stanislav Kholmanskikh @ 2013-08-05 14:44 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Hi!
This is a little fix to run quota_remount_test01.sh with SELinux enabled.
Some distros (CentOS 6.x and, likely, RHEL 6) prevent from creation of quota
files in 'file_t' directories, some - don't care.
I tried this fix on CentOS 5.x/6.x and Oracle Linux, Debian 7. Seems, It's ok, and
should not break anything else.
And the test couldn't be invoked under 3.x kernels because of its kernel check.
Changed it to use tst_kvercmp.
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes
2013-08-05 14:44 [LTP] (no subject) Stanislav Kholmanskikh
@ 2013-08-05 14:44 ` Stanislav Kholmanskikh
2013-08-05 15:45 ` chrubis
2013-08-07 11:42 ` chrubis
0 siblings, 2 replies; 4+ messages in thread
From: Stanislav Kholmanskikh @ 2013-08-05 14:44 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
From: Stanislav kholmanskikh <stanislav.kholmanskikh@oracle.com>
* now it uses tst_kvercmp (to support kernels >= 3)
* some distros doesn't allow creation of quota files in
directories with SELinux file_t type. Now we explicitly
change file type of the test directory to tmp_t
Signed-off-by: Stanislav kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
.../fs/quota_remount/quota_remount_test01.sh | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/testcases/kernel/fs/quota_remount/quota_remount_test01.sh b/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
index 98b15d6..7790d16 100755
--- a/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
+++ b/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
@@ -47,14 +47,8 @@ then
fi
MNTDIR=$TMPDIR/mnt
-uname -r | {
- IFS='.-'
- read MAJOR MINOR RELEASE REST
- if [ "$MAJOR" -lt 2 -o "$MINOR" -lt 6 -o "$RELEASE" -lt 26 ]; then
- exit 1
- fi
- exit 0; }
-if [ $? -gt 0 ]; then
+tst_kvercmp 2 6 26
+if [ $? -eq 0 ]; then
tst_resm TCONF "Remounting with quotas enabled is not supported!"
tst_resm TCONF "You should have kernel 2.6.26 and above running....."
exit 0
@@ -83,6 +77,13 @@ mkdir $MNTDIR || die 2 "Could not create the mountpoint"
mount -t ext3 -o loop,usrquota,grpquota $IMAGE $MNTDIR || die 2 "Could not mount the filesystem"
tst_resm TINFO "Successfully mounted the File System"
+# some distros (CentOS 6.x, for example) doesn't permit creating
+# of quota files in a directory with SELinux file_t type
+if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
+ chcon -t tmp_t $MNTDIR || die 2 "Could not change SELinux file type"
+ tst_resm TINFO "Successfully changed SELinux file type"
+fi
+
quotacheck -cug $MNTDIR || die 2 "Could not create quota files"
tst_resm TINFO "Successfully Created Quota Files"
--
1.7.1
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes
2013-08-05 14:44 ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes Stanislav Kholmanskikh
@ 2013-08-05 15:45 ` chrubis
2013-08-07 11:42 ` chrubis
1 sibling, 0 replies; 4+ messages in thread
From: chrubis @ 2013-08-05 15:45 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list
Hi!
> * now it uses tst_kvercmp (to support kernels >= 3)
> * some distros doesn't allow creation of quota files in
> directories with SELinux file_t type. Now we explicitly
> change file type of the test directory to tmp_t
I can't check that the selinux specific bits works as they should, but
general idea of this patch is fine.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes
2013-08-05 14:44 ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes Stanislav Kholmanskikh
2013-08-05 15:45 ` chrubis
@ 2013-08-07 11:42 ` chrubis
1 sibling, 0 replies; 4+ messages in thread
From: chrubis @ 2013-08-07 11:42 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list
Hi!
> * now it uses tst_kvercmp (to support kernels >= 3)
> * some distros doesn't allow creation of quota files in
> directories with SELinux file_t type. Now we explicitly
> change file type of the test directory to tmp_t
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-07 11:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05 14:44 [LTP] (no subject) Stanislav Kholmanskikh
2013-08-05 14:44 ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes Stanislav Kholmanskikh
2013-08-05 15:45 ` chrubis
2013-08-07 11:42 ` chrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox