}
run_test 35 "Usage is still accessible across reboot"
-# test migrating old amdin quota files (in Linux quota file format v2) into new
-# quota global index (in IAM format)
-test_36() {
- [ $(facet_fstype $SINGLEMDS) != ldiskfs ] && \
- skip "skipping migration test" && return
-
- # get the mdt0 device name
- local mdt0_node=$(facet_active_host $SINGLEMDS)
- local mdt0_dev=$(mdsdevname ${SINGLEMDS//mds/})
-
- echo "Reformat..."
- formatall
-
- echo "Copy admin quota files into MDT0..."
- local mntpt=$(facet_mntpt $SINGLEMDS)
- local mdt0_fstype=$(facet_fstype $SINGLEMDS)
- local opt
- if ! do_node $mdt0_node test -b $mdt0_fstype; then
- opt="-o loop"
- fi
- echo "$mdt0_node, $mdt0_dev, $mntpt, $opt"
- do_node $mdt0_node mount -t $mdt0_fstype $opt $mdt0_dev $mntpt
- do_node $mdt0_node mkdir $mntpt/OBJECTS
- do_node $mdt0_node cp $LUSTRE/tests/admin_quotafile_v2.usr $mntpt/OBJECTS
- do_node $mdt0_node cp $LUSTRE/tests/admin_quotafile_v2.grp $mntpt/OBJECTS
- do_node $mdt0_node umount -d -f $mntpt
-
- echo "Setup all..."
- setupall
-
- echo "Verify global limits..."
- local id_cnt
- local limit
-
- local proc="qmt.*.md-0x0.glb-usr"
- id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 403 ] || error "Migrate inode user limit failed: $id_cnt"
- limit=$(getquota -u 1 global isoftlimit)
- [ $limit -eq 1024 ] || error "User inode softlimit: $limit"
- limit=$(getquota -u 1 global ihardlimit)
- [ $limit -eq 2048 ] || error "User inode hardlimit: $limit"
-
- proc="qmt.*.md-0x0.glb-grp"
- id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 403 ] || error "Migrate inode group limit failed: $id_cnt"
- limit=$(getquota -g 1 global isoftlimit)
- [ $limit -eq 1024 ] || error "Group inode softlimit: $limit"
- limit=$(getquota -g 1 global ihardlimit)
- [ $limit -eq 2048 ] || error "Group inode hardlimit: $limit"
-
- proc=" qmt.*.dt-0x0.glb-usr"
- id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 403 ] || error "Migrate block user limit failed: $id_cnt"
- limit=$(getquota -u 60001 global bsoftlimit)
- [ $limit -eq 10485760 ] || error "User block softlimit: $limit"
- limit=$(getquota -u 60001 global bhardlimit)
- [ $limit -eq 20971520 ] || error "User block hardlimit: $limit"
-
- proc="qmt.*.dt-0x0.glb-grp"
- id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 403 ] || error "Migrate block user limit failed: $id_cnt"
- limit=$(getquota -g 60001 global bsoftlimit)
- [ $limit -eq 10485760 ] || error "Group block softlimit: $limit"
- limit=$(getquota -g 60001 global bhardlimit)
- [ $limit -eq 20971520 ] || error "Group block hardlimit: $limit"
-
- echo "Cleanup..."
- formatall
- setupall
-}
-run_test 36 "Migrate old admin files into new global indexes"
-
# chown/chgrp to the file created with MDS_OPEN_DELAY_CREATE
# LU-5006
test_37() {