diff --git a/Regression/bz732863-IPv6-to-IPv4-fallback/PURPOSE b/Regression/bz732863-IPv6-to-IPv4-fallback/PURPOSE new file mode 100644 index 0000000..9b42413 --- /dev/null +++ b/Regression/bz732863-IPv6-to-IPv4-fallback/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/lftp/Regression/bz732863-IPv6-to-IPv4-fallback +Description: Test if lftp tries to connect over IPv4 when IPv6 not available +Author: Martin Frodl +Bug summary: lftp uses ipv6 addresses even when ipv6 is not available +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=732863 diff --git a/Regression/bz732863-IPv6-to-IPv4-fallback/main.fmf b/Regression/bz732863-IPv6-to-IPv4-fallback/main.fmf new file mode 100644 index 0000000..aa47c29 --- /dev/null +++ b/Regression/bz732863-IPv6-to-IPv4-fallback/main.fmf @@ -0,0 +1,33 @@ +summary: Test if lftp tries to connect over IPv4 when IPv6 not available +description: | + Bug summary: lftp uses ipv6 addresses even when ipv6 is not available + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=732863 +component: +- lftp +test: ./runtest.sh +framework: beakerlib +require: +- library(httpd/http) +recommend: +- lftp +- httpd +- iputils +duration: 15m +enabled: true +tag: +- NoRHEL4 +- NoRHEL5 +- TIP_fedora_fail +- TIPfail_infra +- TIPfail_samba +- TIPfail_systemd +- TIPpass +- TIPpass_Apps +- TIPpass_FIPS +- Tier3 +tier: '3' +relevancy: | + distro = rhel-4, rhel-5: False +extra-nitrate: TC#0472695 +extra-summary: /CoreOS/lftp/Regression/bz732863-IPv6-to-IPv4-fallback +extra-task: /CoreOS/lftp/Regression/bz732863-IPv6-to-IPv4-fallback diff --git a/Regression/bz732863-IPv6-to-IPv4-fallback/runtest.sh b/Regression/bz732863-IPv6-to-IPv4-fallback/runtest.sh new file mode 100755 index 0000000..9c651e5 --- /dev/null +++ b/Regression/bz732863-IPv6-to-IPv4-fallback/runtest.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/lftp/Regression/bz732863-IPv6-to-IPv4-fallback +# Description: Test if lftp tries to connect over IPv4 when IPv6 not available +# Author: Martin Frodl +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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=${PACKAGES:-"lftp"} +REQUIRES=${REQUIRES:-"httpd"} + +TESTDIR='bz732863' +IP4='3.14.15.92' +IP6='3:14:15:92:65:35:89:79' + +rlJournalStart + rlPhaseStartSetup + rlRun "rlImport httpd/http" 0 "Importing httpd library" || rlDie + rlAssertRpm --all + + rlRun "ip addr add ${IP4} dev lo" 0 "Adding IP ${IP4} to lo interface" + rlRun "ip route add ${IP4} dev lo" 0 "${IP4} will be routed via lo" + rlRun "ip route add ${IP6} dev lo" 0 "${IP6} will be routed via lo" + + HOSTS="/etc/hosts" + rlRun "rlFileBackup ${HOSTS}" + rlRun "echo '${IP4} italmas' >> ${HOSTS}" 0 "Adding IPv4 entry to hosts" + rlRun "echo '${IP6} italmas' >> ${HOSTS}" 0 "Adding IPv6 entry to hosts" + + rlRun "rlFileBackup --clean ${httpROOTDIR}" + rlRun "mkdir ${httpROOTDIR}/${TESTDIR}" 0 "Creating test directory" + rlServiceStop "httpd" + sleep 10 + rlRun "httpStart" 0 "Starting httpd" + rlPhaseEnd + + rlPhaseStartTest + # Make sure that 3.14.15.92 is reachable via loopback interface, whereas + # 3:14:15:92:65:35:89:79 is not + rlRun "ping -w 5 ${IP4}" 0 "Trying to contact local server over IPv4" + rlRun "ping6 -w 5 ${IP6}" 1,2 "Trying to contact local server over IPv6" + + URL="http://italmas/${TESTDIR}/" + rlRun -s "lftp -de exit ${URL}" 0 "Connecting to localhost with lftp" + rlAssertGrep 'Network is unreachable' ${rlRun_LOG} + rlAssertGrep "200 OK" ${rlRun_LOG} + rlIsRHEL 6 && rlAssertGrep "cd ok, cwd=/${TESTDIR}" ${rlRun_LOG} + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceStop "httpd" + rlRun "httpStop" 0 "Stopping httpd" + rlRun "rlFileRestore" 0 "Restoring original files" + rlRun "ip addr del ${IP4} dev lo" 0 \ + "Removing IP ${IP4} from lo interace" + rlRun "ip route del ${IP4}" 0 "Deleting routing entry for ${IP4}" + rlRun "ip route del ${IP6}" 0 "Deleting routing entry for ${IP6}" + rlRun "rlServiceRestore ${httpHTTPD}" 0 "Restoring httpd service" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd