This commit is contained in:
Ondrej Mejzlik 2024-04-17 13:18:07 +02:00
commit 269ee9af3b
2 changed files with 90 additions and 0 deletions

View file

@ -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 <omejzlik@redhat.com>
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

View file

@ -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 <omejzlik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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