Browse Source

Fix staging tests where vsftpd is not installed

pull/625/head
Tim Kimber 5 years ago
parent
commit
99d1fcccf6
No known key found for this signature in database GPG Key ID: 3E1804964E76BD18
3 changed files with 23 additions and 15 deletions
  1. +11
    -7
      test/33-ftp.bats
  2. +11
    -7
      test/34-ftp-passive.bats
  3. +1
    -1
      test/test_helper.bash

+ 11
- 7
test/33-ftp.bats View File

@ -8,21 +8,25 @@ load '/getssl/test/test_helper.bash'
# This is run for every test
setup() {
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
cp $VSFTPD_CONF ${VSFTPD_CONF}.getssl
if [ -n "${VSFTPD_CONF}" ]; then
cp $VSFTPD_CONF ${VSFTPD_CONF}.getssl
# enable passive and disable active mode
# https://www.pixelstech.net/article/1364817664-FTP-active-mode-and-passive-mode
cat <<- _FTP >> $VSFTPD_CONF
# enable passive and disable active mode
# https://www.pixelstech.net/article/1364817664-FTP-active-mode-and-passive-mode
cat <<- _FTP >> $VSFTPD_CONF
pasv_enable=NO
_FTP
${CODE_DIR}/test/restart-ftpd
${CODE_DIR}/test/restart-ftpd
fi
}
teardown() {
cp ${VSFTPD_CONF}.getssl $VSFTPD_CONF
${CODE_DIR}/test/restart-ftpd
if [ -n "${VSFTPD_CONF}" ]; then
cp ${VSFTPD_CONF}.getssl $VSFTPD_CONF
${CODE_DIR}/test/restart-ftpd
fi
}


+ 11
- 7
test/34-ftp-passive.bats View File

@ -8,24 +8,28 @@ load '/getssl/test/test_helper.bash'
# This is run for every test
setup() {
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
cp $VSFTPD_CONF ${VSFTPD_CONF}.getssl
if [ -n "${VSFTPD_CONF}" ]; then
cp $VSFTPD_CONF ${VSFTPD_CONF}.getssl
# enable passive and disable active mode
# https://www.pixelstech.net/article/1364817664-FTP-active-mode-and-passive-mode
cat <<- _FTP >> $VSFTPD_CONF
# enable passive and disable active mode
# https://www.pixelstech.net/article/1364817664-FTP-active-mode-and-passive-mode
cat <<- _FTP >> $VSFTPD_CONF
pasv_enable=YES
pasv_max_port=10100
pasv_min_port=10090
connect_from_port_20=NO
_FTP
${CODE_DIR}/test/restart-ftpd
${CODE_DIR}/test/restart-ftpd
fi
}
teardown() {
cp ${VSFTPD_CONF}.getssl $VSFTPD_CONF
${CODE_DIR}/test/restart-ftpd
if [ -n "${VSFTPD_CONF}" ]; then
cp ${VSFTPD_CONF}.getssl $VSFTPD_CONF
${CODE_DIR}/test/restart-ftpd
fi
}


+ 1
- 1
test/test_helper.bash View File

@ -82,7 +82,7 @@ elif [[ "$GETSSL_OS" == "centos"[78] ]]; then
if [ -z "$(pgrep nginx)" ]; then
nginx >&3-
fi
if [ -z "$(pgrep vsftpd)" ]; then
if [ -z "$(pgrep vsftpd)" ] && [ "$(command -v vsftpd)" ]; then
vsftpd >&3-
fi
fi


Loading…
Cancel
Save