aboutsummaryrefslogtreecommitdiff
path: root/tests/server/tftpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/server/tftpd.c')
-rw-r--r--tests/server/tftpd.c18
1 files changed, 15 insertions, 3 deletions
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 */