diff --git a/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks/main.fmf b/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks/main.fmf new file mode 100644 index 0000000..72f7246 --- /dev/null +++ b/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks/main.fmf @@ -0,0 +1,28 @@ +summary: Test for bz735840 (ftp - append, put, send commands cause memory leaks) +description: | + Bug summary: ftp - append, put, send commands cause memory leaks + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=735840 +component: +- ftp +test: ./runtest.sh +framework: beakerlib +recommend: +- ftp +- valgrind +- vsftpd +- expect +duration: 5m +enabled: true +tag: +- TIPfail_infra +- TIPfail_samba +- TIPfail_systemd +- TIPpass_Security +- Tier3 +- TierCandidatesFAIL +tier: '3' +relevancy: | + arch = ia64, s390, s390x: False +extra-nitrate: TC#0121904 +extra-summary: /CoreOS/ftp/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks +extra-task: /CoreOS/ftp/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks diff --git a/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks/runtest.sh b/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks/runtest.sh new file mode 100755 index 0000000..b22c226 --- /dev/null +++ b/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks/runtest.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/ftp/Regression/bz735840-ftp-append-put-send-commands-cause-memory-leaks +# Description: Test for bz735840 (ftp - append, put, send commands cause memory leaks) +# Author: Dalibor Pospisil +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/lib/beakerlib/beakerlib.sh + +PACKAGE="ftp" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + + getsebool ftp_home_dir 2>/dev/null && { + rlRun "prevbool_ftp_home_dir=$(getsebool ftp_home_dir |sed -e 's/.* --> \(\S\+\).*/\1/')" 0 "Get previous value of ftp_home_dir boolean" + rlRun "setsebool ftp_home_dir 1" 0 "Enable ftp to access home dir" + } + rlRun "useradd ftptest" 0 "Create testing user" + rlServiceStart vsftpd +expect <testlife.txt" + rlLog "Run expect valgrind ftp and upload a file twice" +expect <*" {send -- "put testlife.txt\r"} +expect "*ftp>*" {send -- "put testlife.txt\r"} +expect "*ftp>*" {send -- "bye\r"} +expect eof +EOF +res=$? + rlAssert0 "Check that expect passed ok" $res + rlAssertExists "./ftp.memchk" + rlAssertGrep "definitely lost: 0" ftp.memchk + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceRestore vsftpd + rlRun "userdel -r ftptest" 0 "Remove testing user" + getsebool ftp_home_dir 2>/dev/null && { + rlRun "setsebool ftp_home_dir $prevbool_ftp_home_dir" 0 "Return ftp_home_dir boolean back" + } + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd