diff --git a/Regression/bz1364524-get-nonexistent-file/PURPOSE b/Regression/bz1364524-get-nonexistent-file/PURPOSE new file mode 100644 index 0000000..c746381 --- /dev/null +++ b/Regression/bz1364524-get-nonexistent-file/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/lftp/Regression/bz1364524-get-nonexistent-file +Description: Download nonexistent file with lftp +Author: Martin Frodl +Bug summary: lftp command SIZE on non-existing file is executed in a loop instead of return. +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1364524 diff --git a/Regression/bz1364524-get-nonexistent-file/main.fmf b/Regression/bz1364524-get-nonexistent-file/main.fmf new file mode 100644 index 0000000..a9b928c --- /dev/null +++ b/Regression/bz1364524-get-nonexistent-file/main.fmf @@ -0,0 +1,28 @@ +summary: Download nonexistent file with lftp +description: | + Bug summary: lftp command SIZE on non-existing file is executed in a loop instead of return. + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1364524 +component: +- lftp +test: ./runtest.sh +framework: beakerlib +recommend: +- lftp +- vsftpd +duration: 5m +enabled: true +tag: +- NoRHEL4 +- NoRHEL5 +- TIP_fedora_fail +- TIPfail_infra +- TIPfail_samba +- TIPfail_systemd +- TIPpass +- TIPpass_Apps +- noexpectedness +relevancy: | + distro = rhel-4, rhel-5: False +extra-nitrate: TC#0535787 +extra-summary: /CoreOS/lftp/Regression/bz1364524-get-nonexistent-file +extra-task: /CoreOS/lftp/Regression/bz1364524-get-nonexistent-file diff --git a/Regression/bz1364524-get-nonexistent-file/runtest.sh b/Regression/bz1364524-get-nonexistent-file/runtest.sh new file mode 100755 index 0000000..3fded38 --- /dev/null +++ b/Regression/bz1364524-get-nonexistent-file/runtest.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/lftp/Regression/bz1364524-get-nonexistent-file +# Description: Download nonexistent file with lftp +# Author: Martin Frodl +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES="lftp" +CONF="/etc/vsftpd/vsftpd.conf" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm --all + + rlFileBackup --clean /var/ftp + rlRun "echo 'Quack!' > /var/ftp/duck" 0 "Creating test file on FTP server" + rlRun "rlFileBackup $CONF" 0 "Back up $CONF" + if ! rlIsRHEL '<=7'; then + rlRun "sed -i s/anonymous_enable=NO/anonymous_enable=YES/ $CONF" 0 "Allow anonymous login" + fi + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "rlServiceStart vsftpd" 0 "Starting vsftpd FTP server" + rlPhaseEnd + + rlPhaseStartTest "Download existing file from localhost FTP server" + rlRun "lftp ftp://localhost -e 'get -c duck; exit'" 0 "Downloading existing file" + rlAssertGrep 'Quack!' duck + rlPhaseEnd + + rlPhaseStartTest "Download nonexistent file from localhost FTP server" + rlRun "rlWatchdog \"lftp ftp://localhost -e 'get -c chick; exit'\" 8" 0 "Download nonexistent file" + rlAssertNotExists "chick" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlRun "rlFileRestore" 0 "Restore $CONF" + rlRun "rlServiceStop vsftpd" 0 "Stopping FTP server" + rlFileRestore + rlPhaseEnd +rlJournalPrintText +rlJournalEnd