summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/ftp01
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-21 15:27:43 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-21 16:38:34 +0100
commitfe0f24ea392b6930828a46139bb4251a82f013a0 (patch)
tree51a4682c685a2c6721d4c1b4550420c65cb82a53 /testsuites/libtests/ftp01
parentftpfs: Open control connection during path eval (diff)
downloadrtems-fe0f24ea392b6930828a46139bb4251a82f013a0.tar.bz2
ftpfs: Use SIZE command
Diffstat (limited to 'testsuites/libtests/ftp01')
-rw-r--r--testsuites/libtests/ftp01/ftp01.scn18
-rw-r--r--testsuites/libtests/ftp01/init.c11
2 files changed, 29 insertions, 0 deletions
diff --git a/testsuites/libtests/ftp01/ftp01.scn b/testsuites/libtests/ftp01/ftp01.scn
index aa00f7f52c..a3292961c8 100644
--- a/testsuites/libtests/ftp01/ftp01.scn
+++ b/testsuites/libtests/ftp01/ftp01.scn
@@ -48,4 +48,22 @@ RETR b.txt
226 Transfer complete.
QUIT
221 Goodbye.
+220 RTEMS FTP server (Version 1.1-JWJ) ready.
+USER anonymous
+230 User logged in.
+TYPE I
+200 Type set to I.
+SIZE a.txt
+213 1102
+QUIT
+221 Goodbye.
+220 RTEMS FTP server (Version 1.1-JWJ) ready.
+USER anonymous
+230 User logged in.
+TYPE I
+200 Type set to I.
+SIZE b.txt
+213 1102
+QUIT
+221 Goodbye.
*** END OF TEST FTP 1 ***
diff --git a/testsuites/libtests/ftp01/init.c b/testsuites/libtests/ftp01/init.c
index c60cc56ee1..354c0f045a 100644
--- a/testsuites/libtests/ftp01/init.c
+++ b/testsuites/libtests/ftp01/init.c
@@ -142,6 +142,15 @@ static void copy_file(const char *src_path, const char *dest_path)
rtems_test_assert(rv == 0);
}
+static void check_file_size(const char *path, size_t size)
+{
+ struct stat st;
+ int rv = lstat(path, &st);
+
+ rtems_test_assert(rv == 0);
+ rtems_test_assert(st.st_size == (off_t) size);
+}
+
static void check_file(const char *path)
{
int rv = 0;
@@ -183,6 +192,8 @@ static void test(void)
create_file(file_a);
copy_file(file_a, file_b);
check_file(file_b);
+ check_file_size(file_a, sizeof(content));
+ check_file_size(file_b, sizeof(content));
}
static rtems_task Init(rtems_task_argument argument)