From 65ed69662513b14143e8821c72ea41d7c69113d9 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 24 Oct 2007 22:48:23 +0000 Subject: Fixed the test TFTP server to support the >10000 test number notation Added test cases 2002 and 2003 (the latter disabled for now) --- tests/server/tftpd.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tests/server') diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 71cf88992..7dafd78a8 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -654,8 +654,9 @@ static int validate_access(struct testcase *test, const char *filename, int mode) { char *ptr; - long testno; + long testno, partno; int error; + char partbuf[80]="data"; logmsg("trying to get file: %s mode %x", filename, mode); @@ -686,12 +687,23 @@ static int validate_access(struct testcase *test, /* get the number */ testno = strtol(ptr, &ptr, 10); - logmsg("requested test number %d", testno); + if(testno > 10000) { + partno = testno % 10000; + testno /= 10000; + } + else + partno = 0; + + + logmsg("requested test number %ld part %ld", testno, partno); test->num = testno; file = test2file(testno); + if(0 != partno) + sprintf(partbuf, "data%ld", partno); + if(file) { FILE *stream=fopen(file, "rb"); if(!stream) { @@ -703,7 +715,7 @@ static int validate_access(struct testcase *test, } else { size_t count; - test->buffer = (char *)spitout(stream, "reply", "data", &count); + test->buffer = (char *)spitout(stream, "reply", partbuf, &count); fclose(stream); if(test->buffer) { test->rptr = test->buffer; /* set read pointer */ -- cgit v1.2.3