Add subtest for SIZE command in ftpd regression tests
authorjan <jan@openbsd.org>
Sun, 9 May 2021 14:05:42 +0000 (14:05 +0000)
committerjan <jan@openbsd.org>
Sun, 9 May 2021 14:05:42 +0000 (14:05 +0000)
regress/libexec/ftpd/Makefile

index 7c80000..baf6ea4 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.9 2021/05/09 13:16:33 jan Exp $
+#      $OpenBSD: Makefile,v 1.10 2021/05/09 14:05:42 jan Exp $
 
 .PHONY: setup-ftpd
 
@@ -9,6 +9,7 @@ REGRESS_TARGETS +=      run-ftpd-nlist
 REGRESS_TARGETS +=     run-ftpd-delete
 REGRESS_TARGETS +=     run-ftpd-mkdir
 REGRESS_TARGETS +=     run-ftpd-rename
+REGRESS_TARGETS +=     run-ftpd-size
 REGRESS_ROOT_TARGETS = ${REGRESS_TARGETS}
 REGRESS_CLEANUP =      cleanup-ftpd
 REGRESS_SETUP =                setup-ftpd
@@ -78,6 +79,10 @@ run-ftpd-rename:
        test ! -f ${FTPDIR}/ftpd.regress
        test   -f ${FTPDIR}/ftpd.regress.new
 
+run-ftpd-size:
+       test $$(echo "binary\nsize ftpd.regress" | ftp -a 127.0.0.1 | cut -f 2)\
+           -eq $$(stat -f %z ${FTPDIR}/ftpd.regress)
+
 cleanup-ftpd:
        ${SUDO} pkill tcpserver || true
        ${SUDO} pkill ftpd || true