All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
To: ltp-list@lists.sourceforge.net
Cc: vasily.isaenko@oracle.com
Subject: [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes
Date: Mon,  5 Aug 2013 18:44:06 +0400	[thread overview]
Message-ID: <1375713846-24291-2-git-send-email-stanislav.kholmanskikh@oracle.com> (raw)
In-Reply-To: <1375713846-24291-1-git-send-email-stanislav.kholmanskikh@oracle.com>

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

  reply	other threads:[~2013-08-05 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 14:44 [LTP] (no subject) Stanislav Kholmanskikh
2013-08-05 14:44 ` Stanislav Kholmanskikh [this message]
2013-08-05 15:45   ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes chrubis
2013-08-07 11:42   ` chrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375713846-24291-2-git-send-email-stanislav.kholmanskikh@oracle.com \
    --to=stanislav.kholmanskikh@oracle.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vasily.isaenko@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.