From 6ae264c5e8d9fd514d67adc4cd2c42f21db44dfe Mon Sep 17 00:00:00 2001 From: Ondrej Mejzlik Date: Thu, 24 Nov 2022 17:31:21 +0100 Subject: [PATCH] add test to fedora --- .../main.fmf | 28 +++++ .../runtest.sh | 110 ++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 Regression/bz2123815-rsync-error-protocol-incompatibility-when-using/main.fmf create mode 100755 Regression/bz2123815-rsync-error-protocol-incompatibility-when-using/runtest.sh diff --git a/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using/main.fmf b/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using/main.fmf new file mode 100644 index 0000000..9ac2c6d --- /dev/null +++ b/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using/main.fmf @@ -0,0 +1,28 @@ +summary: Test for BZ#2123815 (rsync error protocol incompatibility when using) +description: | + Bug summary: rsync error: protocol incompatibility when using rsync-3.1.2-11.el7_9 + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2123815 +enabled: true +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2123815 +tag: + - NoRHEL4 + - NoRHEL5 + - NoRHEL6 + - Tier1 +tier: '1' +adjust: + - enabled: false + when: distro == rhel-4, rhel-5, rhel-6 + continue: false +component: + - rsync +test: ./runtest.sh +framework: beakerlib +recommend: + - rsync +duration: 5m +extra-nitrate: TC#0614398 +extra-summary: /CoreOS/rsync/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using +extra-task: /CoreOS/rsync/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using +id: 1e1e2f1e-3ebc-4df5-aed8-10f785d42ee4 diff --git a/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using/runtest.sh b/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using/runtest.sh new file mode 100755 index 0000000..22d4a60 --- /dev/null +++ b/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using/runtest.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/rsync/Regression/bz2123815-rsync-error-protocol-incompatibility-when-using +# Description: Test for BZ#2123815 (rsync error protocol incompatibility when using) +# Author: Ondrej Mejzlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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 + +PACKAGE=${PACKAGE:-rsync} + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE || rlDie "Package $PACKAGE not installed" + rlLog "Arch: $(arch), PC name: $(hostname), $(hostname -A) User: $(whoami)" + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" 0 "Going into tmp directory $TmpDir" + rlPhaseEnd + + rlGetTestState && { + rlPhaseStartTest 'Reproducer 1' + rlRun "mkdir foo bar" 0 "Prepare test dirs" + rlRun "rsync --filter='protect *' -av foo bar &> out" 0 "Run rsync" + cat out + rlAssertNotGrep 'ERROR' out + rlAssertNotGrep 'protocol incompatibility' out + rlAssertGrep 'received' out + ls -laR + rlRun "rm -rf foo bar" 0 "Remove test dirs" + rlRun "rm -f out" 0 "Remove error file" + rlPhaseEnd + + rlPhaseStartTest 'Reproducer 2' + rlRun "mkdir foo bar" 0 "Prepare test dirs" + rlRun "echo 'test' > ./foo/test" 0 "Create test file" + rlRun "rsync -a --delete-after '--filter=P foo/*' foo bar &> out" 0 "Run rsync" + cat out + rlAssertNotGrep 'ERROR' out + rlAssertNotGrep 'protocol incompatibility' out + ls -laR + rlRun "rm -rf foo bar" 0 "Remove test dirs" + rlRun "rm -f out" 0 "Remove error file" + rlPhaseEnd + + rlPhaseStartTest 'Reproducer 3' + rlRun "mkdir foo bar" 0 "Prepare test dirs" + rlRun "echo 'test' > ./foo/test" 0 "Create test file" + rlRun "rsync --old-args -a --delete-after '--filter=P foo/*' foo bar &> out" 0 "Run rsync" + cat out + rlAssertNotGrep 'ERROR' out + rlAssertNotGrep 'protocol incompatibility' out + ls -laR + rlRun "rm -rf foo bar" 0 "Remove test dirs" + rlRun "rm -f out" 0 "Remove error file" + rlPhaseEnd + + rlPhaseStartTest 'Reproducer 4' + rlRun "mkdir foo bar" 0 "Prepare test dirs" + rlRun "echo 'test' > ./foo/test" 0 "Create test file" + rlRun "rsync -a --relative -v --include-from=./foo --exclude=* / ./bar/test/ &> out" 0 "Run rsync" + cat out + rlAssertNotGrep 'ERROR' out + rlAssertNotGrep 'protocol incompatibility' out + rlAssertGrep 'received' out + ls -laR + rlRun "rm -rf foo bar" 0 "Remove test dirs" + rlRun "rm -f out" 0 "Remove error file" + rlPhaseEnd + + rlPhaseStartTest 'Reproducer 5' + rlRun "mkdir foo bar" 0 "Prepare test dirs" + rlRun "echo 'test' > ./foo/.snapshot" 0 "Create test file" + rlRun "rsync -rtvp -n --delete --exclude='.snapshot' --filter='protect *' foo bar &> out" 0 "Run rsync" + cat out + rlAssertNotGrep 'ERROR' out + rlAssertNotGrep 'protocol incompatibility' out + rlAssertGrep 'received' out + ls -laR + rlRun "rm -rf foo bar" 0 "Remove test dirs" + rlRun "rm -f out" 0 "Remove error file" + rlPhaseEnd + } + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd