Whamcloud - gitweb
LU-6186 tests: avoid errors in using >&- bash close syntax
[fs/lustre-release.git] / lustre / tests / llapi_fid_test.c
index 6d08f61..e8433a1 100644 (file)
@@ -92,7 +92,10 @@ static void cleanup(void)
        rc = snprintf(cmd, sizeof(cmd), "rm -rf -- '%s'", mainpath);
        ASSERTF(rc > 0 && rc < sizeof(cmd),
                "invalid delete command for path '%s'", mainpath);
-       system(cmd);
+       rc = system(cmd);
+       ASSERTF(rc != -1, "Cannot execute rm command");
+       ASSERTF(WEXITSTATUS(rc) == 0,
+               "rm command returned %d", WEXITSTATUS(rc));
 }
 
 /* Helper - call path2fid, fd2fid and fid2path against an existing
@@ -102,7 +105,7 @@ static void helper_fid2path(const char *filename, int fd)
        lustre_fid fid;
        lustre_fid fid2;
        lustre_fid fid3;
-       char fidstr[FID_LEN];
+       char fidstr[FID_LEN + 1];
        char path1[PATH_MAX];
        char path2[PATH_MAX];
        char path3[PATH_MAX];
@@ -238,7 +241,7 @@ static void test11(void)
        int rc;
        int fd;
        lustre_fid fid;
-       char fidstr[FID_LEN];
+       char fidstr[FID_LEN + 1];
        char path[PATH_MAX];
        long long recno;
        int linkno;
@@ -368,7 +371,7 @@ static void test30(void)
        char buf[PATH_MAX];
        char buf2[PATH_MAX];
        lustre_fid fid;
-       char fidstr[FID_LEN];
+       char fidstr[FID_LEN + 1];
        int rc;
        int i;
        int j;
@@ -695,7 +698,7 @@ static void process_args(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-       char fsname[8];
+       char fsname[8 + 1];
        int rc;
 
        process_args(argc, argv);