Whamcloud - gitweb
LU-797 tests: improve test_23b of ost-pools.sh
[fs/lustre-release.git] / lustre / tests / utime.c
index 8bc5259..0c84ef8 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,7 +24,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -66,9 +64,6 @@ int main(int argc, char *argv[])
        int rc;
         int c;
 
-       utb.actime = 200000;
-       utb.modtime = 100000;
-
         while ((c = getopt(argc, argv, "s:")) != -1) {
                 switch(c) {
                 case 's':
@@ -104,9 +99,9 @@ int main(int argc, char *argv[])
                }
 
                if (st.st_mtime < before_mknod || st.st_mtime > after_mknod) {
-                       fprintf(stderr,
-                               "%s: bad mknod times %lu <= %lu <= %lu false\n",
-                               prog, before_mknod, st.st_mtime, after_mknod);
+                       fprintf(stderr, "%s: bad mknod(%s) times %lu <= %lu <= "
+                                "%lu false\n", prog, filename, before_mknod,
+                                st.st_mtime, after_mknod);
                        return 4;
                }
 
@@ -126,9 +121,10 @@ int main(int argc, char *argv[])
 
                         if (st2.st_mtime < before_mknod || 
                             st2.st_mtime > after_mknod) {
-                                fprintf(stderr, "%s: bad mknod times %lu <= %lu"
-                                        " <= %lu false\n", prog, before_mknod,
-                                        st2.st_mtime, after_mknod);
+                                fprintf(stderr, "%s: bad mknod(%s) times %lu "
+                                        " <= %lu <= %lu false\n", prog,
+                                        filename, before_mknod, st2.st_mtime,
+                                        after_mknod);
                                 return 6;
                         }
 
@@ -139,7 +135,8 @@ int main(int argc, char *argv[])
                 }
        }
 
-       /* See above */
+       utb.actime = 200000;
+       utb.modtime = 100000;
        rc = utime(filename, &utb);
        if (rc) {
                fprintf(stderr, "%s: utime(%s) failed: rc %d: %s\n",
@@ -155,14 +152,14 @@ int main(int argc, char *argv[])
        }
 
        if (st.st_mtime != utb.modtime ) {
-               fprintf(stderr, "%s: bad utime mtime %lu should be  %lu\n",
-                       prog, st.st_mtime, utb.modtime);
+               fprintf(stderr, "%s: bad utime mtime(%s) %lu should be %lu\n",
+                       prog, filename, st.st_mtime, utb.modtime);
                return 9;
        }
 
        if (st.st_atime != utb.actime ) {
-               fprintf(stderr, "%s: bad utime atime %lu should be  %lu\n",
-                       prog, st.st_atime, utb.actime);
+               fprintf(stderr, "%s: bad utime atime(%s) %lu should be %lu\n",
+                       prog, filename, st.st_atime, utb.actime);
                return 10;
        }
 
@@ -181,14 +178,16 @@ int main(int argc, char *argv[])
        }
 
        if (st2.st_mtime != st.st_mtime) {
-               fprintf(stderr, "%s: not synced mtime between clients: %lu "
-                        "should be  %lu\n", prog, st2.st_mtime, st.st_mtime);
+               fprintf(stderr, "%s: not synced mtime(%s) between clients: "
+                        "%lu should be %lu\n", prog, secname,
+                        st2.st_mtime, st.st_mtime);
                return 13;
        }
 
        if (st2.st_ctime != st.st_ctime) {
-               fprintf(stderr, "%s: not synced ctime between clients: %lu "
-                        " should be  %lu\n", prog, st2.st_ctime, st.st_ctime);
+               fprintf(stderr, "%s: not synced ctime(%s) between clients: "
+                        "%lu should be %lu\n", prog, secname,
+                        st2.st_ctime, st.st_ctime);
                return 14;
        }