Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZTS: Update project quota tests #8043

Merged
merged 1 commit into from
Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ log_must touch $PRJFILE
log_must mkdir $PRJDIR

log_must chattr -p $PRJID1 $PRJFILE
log_must eval "lsattr -p $PRJFILE | grep $PRJID1 | grep '\- '"
log_must eval "lsattr -p $PRJFILE | grep $PRJID1 | grep -v '\-P[- ]* '"
log_must chattr -p $PRJID1 $PRJDIR
log_must eval "lsattr -pd $PRJDIR | grep $PRJID1 | grep '\- '"
log_must eval "lsattr -pd $PRJDIR | grep $PRJID1 | grep -v '\-P[- ]* '"

log_must chattr +P $PRJDIR
log_must eval "lsattr -pd $PRJDIR | grep $PRJID1 | grep '\-P '"
log_must eval "lsattr -pd $PRJDIR | grep $PRJID1 | grep '\-P[- ]* '"

# "-1" is invalid project ID, should be denied
log_mustnot chattr -p -1 $PRJFILE
log_must eval "lsattr -p $PRJFILE | grep $PRJID1 | grep '\- '"
log_must eval "lsattr -p $PRJFILE | grep $PRJID1 | grep -v '\-P[- ]* '"

log_must mkdir $PRJDIR/dchild
log_must eval "lsattr -pd $PRJDIR/dchild | grep $PRJID1 | grep '\-P '"
log_must eval "lsattr -pd $PRJDIR/dchild | grep $PRJID1 | grep '\-P[- ]* '"
log_must touch $PRJDIR/fchild
log_must eval "lsattr -p $PRJDIR/fchild | grep $PRJID1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,30 @@ log_must chattr -p $PRJID1 $PRJDIR/a3
log_must eval "zfs project $PRJDIR/a3 | grep '$PRJID1 \-'"

log_must zfs project -p $PRJID2 $PRJDIR/a3
log_must eval "lsattr -p $PRJDIR/a3 | grep $PRJID2 | grep '\- '"
log_must eval "lsattr -p $PRJDIR/a3 | grep $PRJID2 | grep -v '\-P[- ]* '"

log_must chattr -p $PRJID1 $PRJDIR/a1
log_must eval "zfs project -d $PRJDIR/a1 | grep '$PRJID1 \-'"

log_must zfs project -p $PRJID2 $PRJDIR/a1
log_must eval "lsattr -pd $PRJDIR/a1 | grep $PRJID2 | grep '\- '"
log_must eval "lsattr -pd $PRJDIR/a1 | grep $PRJID2 | grep -v '\-P[- ]* '"

log_must chattr +P $PRJDIR/a2
log_must eval "zfs project -d $PRJDIR/a2 | grep '0 P'"

log_must zfs project -s $PRJDIR/a2
log_must eval "lsattr -pd $PRJDIR/a2 | grep 0 | grep '\-P '"
log_must eval "lsattr -pd $PRJDIR/a2 | grep 0 | grep '\-P[- ]* '"

log_must chattr +P -p $PRJID1 $PRJDIR/a1
log_must eval "zfs project -d $PRJDIR/a1 | grep '$PRJID1 P'"

log_must zfs project -s -p $PRJID2 $PRJDIR/a2
log_must eval "lsattr -pd $PRJDIR/a2 | grep $PRJID2 | grep '\-P '"
log_must eval "lsattr -pd $PRJDIR/a2 | grep $PRJID2 | grep '\-P[- ]* '"

log_must chattr -P $PRJDIR/a1
log_must eval "zfs project -d $PRJDIR/a1 | grep '$PRJID1 \-'"

log_must zfs project -C -k $PRJDIR/a2
log_must eval "lsattr -pd $PRJDIR/a2 | grep $PRJID2 | grep '\- '"
log_must eval "lsattr -pd $PRJDIR/a2 | grep $PRJID2 | grep -v '\-P[- ]* '"

log_pass "Check 'zfs project' is compatible with chattr/lsattr"