|
19 | 19 | * 7) quotactl(2) succeeds to get disk quota limit greater than or equal to
|
20 | 20 | * ID with Q_GETNEXTQUOTA flag for project.
|
21 | 21 | * 8) quotactl(2) succeeds to turn off quota with Q_QUOTAOFF flag for project.
|
| 22 | + * |
| 23 | + * Minimum e2fsprogs version required is 1.43. |
22 | 24 | */
|
23 | 25 |
|
24 | 26 | #include <errno.h>
|
|
28 | 30 | #include <sys/stat.h>
|
29 | 31 | #include "config.h"
|
30 | 32 | #include "lapi/quotactl.h"
|
| 33 | +#include "tst_safe_stdio.h" |
31 | 34 | #include "tst_test.h"
|
32 | 35 |
|
33 | 36 | #ifndef QFMT_VFS_V1
|
@@ -102,9 +105,18 @@ static struct tcase {
|
102 | 105 |
|
103 | 106 | static void setup(void)
|
104 | 107 | {
|
| 108 | + FILE *f; |
105 | 109 | const char *const fs_opts[] = {"-I 256", "-O quota,project", NULL};
|
| 110 | + int rc, major, minor, patch; |
106 | 111 |
|
107 | 112 | test_id = geteuid();
|
| 113 | + f = SAFE_POPEN("mkfs.ext4 -V 2>&1", "r"); |
| 114 | + rc = fscanf(f, "mke2fs %d.%d.%d", &major, &minor, &patch); |
| 115 | + if (rc != 3) |
| 116 | + tst_res(TWARN, "Unable parse version number"); |
| 117 | + else if (major * 10000 + minor * 100 + patch < 14300) |
| 118 | + tst_brk(TCONF, "Test needs mkfs.ext4 >= 1.43 for quota,project option, test skipped"); |
| 119 | + pclose(f); |
108 | 120 | SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
|
109 | 121 | SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, "quota");
|
110 | 122 | mount_flag = 1;
|
|
0 commit comments