windows-tests-torture-20090405
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 5 Apr 2009 06:25:08 +0000 (06:25 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 5 Apr 2009 06:25:08 +0000 (06:25 +0000)
LICENSE MIT

replace the VOLSTAT online test with the PATH_AVAILABILITY
online test.  We do not care of the volume is offline on the file
server if the cache manager has current data to serve.

src/WINNT/tests/torture/Source/WinThreads.c

index 5ec893f..e0d7792 100644 (file)
@@ -583,6 +583,7 @@ int IsOnline(char *strPath)
             blob.in_size = 0;
             blob.out_size = sizeof(space);
             blob.out = space;
+#if 0
             if (!(code = ppioctl(strPath, VIOCGETVOLSTAT, &blob, 1)))
             {
                 bret = WINTORTURE_ASFDLL_ONLINE;
@@ -590,6 +591,22 @@ int IsOnline(char *strPath)
                 if (!status->Online || !status->InService || !status->Blessed || status->NeedsSalvage)
                     bret = WINTORTURE_ASFDLL_OFFLINE;
             }
+#else
+            errno = 0;
+            code = ppioctl(strPath, VIOC_PATH_AVAILABILITY, &blob, 1);
+            if (!code) {
+                switch (errno) {
+                case ENXIO:
+                case ENOSYS:
+                case EBUSY:
+                    bret = WINTORTURE_ASFDLL_OFFLINE;
+                    break;
+                default:
+                    bret = WINTORTURE_ASFDLL_ONLINE;
+                    break;
+                }
+            }
+#endif 
         }
         else
             bret = WINTORTURE_ASFPIOCTL_NOTFOUND;