test 1099: "TFTP get first a non-existing file then an existing" added disabled
authorDaniel Stenberg <daniel@haxx.se>
Fri, 24 Apr 2009 21:46:42 +0000 (21:46 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 24 Apr 2009 21:46:42 +0000 (21:46 +0000)
as things don't work right here!

tests/data/DISABLED
tests/data/Makefile.am
tests/data/test1099 [new file with mode: 0644]
tests/server/tftpd.c

index df4fd1a..16af583 100644 (file)
@@ -3,4 +3,4 @@
 # test cases are run by runtests.pl. Just add the plain test case numbers, one
 # per line.
 # Lines starting with '#' letters are treated as comments.
-1097
+1099
index d706887..ec27cff 100644 (file)
@@ -61,7 +61,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46           \
  test1080 test1081 test1082 test1083 test1084 test1085 test633 test634     \
  test635 test636 test637 test558 test559 test1086 test1087 test1088        \
  test1089 test1090 test1091 test1092 test1093 test1094 test1095 test1096   \
- test1097 test560 test561 test1098
+ test1097 test560 test561 test1098 test1099
 
 filecheck:
        @mkdir test-place; \
diff --git a/tests/data/test1099 b/tests/data/test1099
new file mode 100644 (file)
index 0000000..5c80ac5
--- /dev/null
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+FAILURE
+</keywords>
+</info>
+
+<reply>
+<data>
+data for 1099
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP get first a non-existing file then an existing
+ </name>
+ <command>
+tftp://%HOSTIP:%TFTPPORT/an/invalid-file tftp://%HOSTIP:%TFTPPORT//1099 --trace-ascii log/traceit
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<errorcode>
+69
+</errorcode>
+<protocol>
+opcode: 1
+filename: an/invalid-file
+mode: octet
+opcode: 1
+filename: /1099
+mode: octet
+</protocol>
+</verify>
+</testcase>
index f64f5da..fce3657 100644 (file)
@@ -193,7 +193,7 @@ rw_init(int x)              /* init for either read-ahead or write-behind */
    Free it and return next buffer filled with data.
  */
 static int readit(struct testcase *test, struct tftphdr **dpp,
-           int convert /* if true, convert to ascii */)
+                  int convert /* if true, convert to ascii */)
 {
   struct bf *b;
 
@@ -202,7 +202,7 @@ static int readit(struct testcase *test, struct tftphdr **dpp,
 
   b = &bfs[current];              /* look at new buffer */
   if (b->counter == BF_FREE)      /* if it's empty */
-    read_ahead(test, convert);      /* fill it */
+    read_ahead(test, convert);    /* fill it */
 
   *dpp = (struct tftphdr *)b->buf;        /* set caller's ptr */
   return b->counter;
@@ -530,7 +530,7 @@ int main(int argc, char **argv)
     n = (ssize_t)recvfrom(sock, buf, sizeof(buf), 0,
                           (struct sockaddr *)&from, &fromlen);
     if (n < 0) {
-      logmsg("recvfrom:\n");
+      logmsg("recvfrom");
       result = 3;
       break;
     }
@@ -541,13 +541,13 @@ int main(int argc, char **argv)
 
     peer = socket(AF_INET, SOCK_DGRAM, 0);
     if (peer < 0) {
-      logmsg("socket:\n");
+      logmsg("socket");
       result = 2;
       break;
     }
 
     if (connect(peer, (struct sockaddr *)&from, sizeof(from)) < 0) {
-      logmsg("connect: fail\n");
+      logmsg("connect: fail");
       result = 1;
       break;
     }
@@ -566,6 +566,8 @@ int main(int argc, char **argv)
 
     clear_advisor_read_lock(SERVERLOGS_LOCK);
 
+    logmsg("end of one transfer");
+
   } while(1);
 
   clear_advisor_read_lock(SERVERLOGS_LOCK);
@@ -734,6 +736,7 @@ static int validate_access(struct testcase *test,
     return EACCESS; /* failure */
   }
 
+  logmsg("file opened and all is good");
   return 0;
 }
 
@@ -797,7 +800,7 @@ static void sendtftp(struct testcase *test, struct formats *pf)
 #endif
     send_data:
     if (swrite(peer, sdp, size + 4) != size + 4) {
-      logmsg("write\n");
+      logmsg("write");
       return;
     }
     read_ahead(test, pf->f_convert);
@@ -810,7 +813,7 @@ static void sendtftp(struct testcase *test, struct formats *pf)
       alarm(0);
 #endif
       if (n < 0) {
-        logmsg("read: fail\n");
+        logmsg("read: fail");
         return;
       }
       sap->th_opcode = ntohs((u_short)sap->th_opcode);