From 269ee9af3b5405d964701bfbbd718953baca6f4d Mon Sep 17 00:00:00 2001 From: Ondrej Mejzlik Date: Wed, 17 Apr 2024 13:18:07 +0200 Subject: [PATCH] add test --- .../main.fmf | 27 ++++++++ .../runtest.sh | 63 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 Regression/RHEL-14228-Fix-regression-for-delay-updates/main.fmf create mode 100644 Regression/RHEL-14228-Fix-regression-for-delay-updates/runtest.sh diff --git a/Regression/RHEL-14228-Fix-regression-for-delay-updates/main.fmf b/Regression/RHEL-14228-Fix-regression-for-delay-updates/main.fmf new file mode 100644 index 0000000..dd55ac9 --- /dev/null +++ b/Regression/RHEL-14228-Fix-regression-for-delay-updates/main.fmf @@ -0,0 +1,27 @@ +summary: 'Test for: JIRA: RHEL-14228 (Fix regression for --delay-updates)' +description: Fix regression for --delay-updates https://github.com/RsyncProject/rsync/issues/192 +contact: Ondrej Mejzlik +test: ./runtest.sh +framework: beakerlib +duration: 5m +enabled: true +tag: + - NoRHEL6 + - NoRHEL7 + - Tier1 +tier: '1' +adjust: + - enabled: false + when: distro < rhel-8 + continue: false + - enabled: false + when: distro = rhel-alt-7 + continue: false +component: + - rsync +recommend: + - rsync +link: + - verifies: https://issues.redhat.com/browse/RHEL-14228 +extra-nitrate: TC#0617425 +id: aa326415-8b8c-4f44-ba14-ca78eb0ee7f8 diff --git a/Regression/RHEL-14228-Fix-regression-for-delay-updates/runtest.sh b/Regression/RHEL-14228-Fix-regression-for-delay-updates/runtest.sh new file mode 100644 index 0000000..0480cc5 --- /dev/null +++ b/Regression/RHEL-14228-Fix-regression-for-delay-updates/runtest.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/rsync/Regression/RHEL-14228-Fix-regression-for-delay-updates +# Description: Test for JIRA: RHEL-14228 (Fix regression for --delay-updates) +# Author: Ondrej Mejzlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2024 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 + rlRun "mkdir source dest" 0 "Create test dirs" + rlRun "echo 1 >source/test" 0 "Create test file" + rlRun "rsync -av --delay-updates source/ dest/" 0 "1st rsync" + + rlRun "mkdir dest/.~tmp~" 0 "Create test dir 2" + rlRun "echo 2 >dest/.~tmp~/test" 0 "Create test file" + rlRun "echo 3 >source/test" 0 "Create tes file 1" + rlRun "rsync -av --delay-updates --modify-window=-1 source/ dest/" 0 "2nd rsync" + + rlAssertNotExists "./dest/.~tmp~/test" + rlAssertExists "./dest/test" + rlAssertGrep "3" "./dest/test" + rlPhaseEnd + } + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd