Adding tests

/CoreOS/vim/Regression/bz1083924-Include-c-11-syntax-highlighting-in-vim
/CoreOS/vim/Regression/bz1204179-missing-bin-vi-breaks-visudo-sudoedit-crontab
/CoreOS/vim/Regression/bz1383902-CPU-spike-on-ssh
/CoreOS/vim/Regression/bz1490927-vim-dumps-core-when-system-reboots
/CoreOS/vim/Regression/bz1576470-Suggest-correct-packages-to-get-embedded
/CoreOS/vim/Regression/bz1602807-vim-X11-doesn-t-provide-the-gui
/CoreOS/vim/Regression/bz1676339-Vim-runs-out-of-memory-during-a-find-and-replace
/CoreOS/vim/Regression/bz1686822-Add-Provides-bundled-libvterm
/CoreOS/vim/Regression/bz1743070-manpage-of-vim-is-garbled-in-Japanese-locale
/CoreOS/vim/Regression/bz241308-use-augroup-for-rh-autocmds
/CoreOS/vim/Regression/bz429208-maxmemtot-memory-calculation
/CoreOS/vim/Regression/bz473977-vim-incorrectly-linked-to-libtermcap
/CoreOS/vim/Regression/bz505344-netrw-plugin-delete-command-broken
/CoreOS/vim/Regression/bz506442-Add-Vim-to-Applications-Accessories-menu
/CoreOS/vim/Regression/bz572157-vim-in-ex-mode-incorrectly-gives-an-eol-error
/CoreOS/vim/Regression/bz591578-netrw-vim-prints-additional-chars
/CoreOS/vim/Regression/bz634902-rpm-spec-template-is-out-of-date
/CoreOS/vim/Regression/bz652610-netrw-plugin-and-parent-directory
/CoreOS/vim/Regression/bz681108-vim-crashes-while-doing-completion
/CoreOS/vim/Regression/bz820331-Vim-syntax-file-for-sshdconfig-is-missing-newer
/CoreOS/vim/Regression/docs
/CoreOS/vim/Sanity/upstream-scripttests
This commit is contained in:
František Hrdina 2023-06-02 10:50:23 +02:00
commit f6ea11c9ee
54 changed files with 2183 additions and 19 deletions

View file

@ -0,0 +1,9 @@
tag:
- Tier2
tier: '2'
adjust:
- enabled: false
when: distro != rhel-6
continue: false
extra-nitrate: TC#0472653
id: ac00fc90-ed1a-4b0b-bbaa-b06daecd2608

View file

@ -0,0 +1,5 @@
tag:
- Tier1
tier: '1'
extra-nitrate: TC#0475856
id: 3ff1cf1d-e662-4cf7-9d51-ac05f123c38d

View file

@ -2,22 +2,18 @@ summary: Test for BZ#1083924 (Include c++11 syntax highlighting in vim)
description: |
Bug summary: Include c++11 syntax highlighting in vim
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1083924
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1083924
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1267826
tag:
- Tier1
tier: '1'
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
path: /Regression/bz1083924-Include-c-11-syntax-highlighting-in-vim
framework: beakerlib
recommend:
- vim-enhanced
duration: 5m
extra-nitrate: TC#0475856
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1083924
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1267826
extra-summary: /CoreOS/vim/Regression/bz1083924-Include-c-11-syntax-highlighting-in-vim
extra-task: /CoreOS/vim/Regression/bz1083924-Include-c-11-syntax-highlighting-in-vim
id: ecff0abc-636e-418e-bea4-3e5ab92abe2a

View file

@ -0,0 +1,26 @@
summary: Test for BZ#1204179 (missing /bin/vi breaks visudo, sudoedit, crontab)
description: |
Bug summary: missing /bin/vi breaks visudo, sudoedit, crontab -e, etc.
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1204179
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-common
- vim-minimal
- sudo
- cronie
duration: 5m
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1204179
adjust:
- enabled: false
when: distro < rhel-6
continue: false
extra-nitrate: TC#0479009
extra-summary: /CoreOS/vim/Regression/bz1204179-missing-bin-vi-breaks-visudo-sudoedit-crontab
extra-task: /CoreOS/vim/Regression/bz1204179-missing-bin-vi-breaks-visudo-sudoedit-crontab
id: b65f525d-5cc6-424a-b4ef-3f83652ca355

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/vim/Regression/bz1204179-missing-bin-vi-breaks-visudo-sudoedit-crontab
# Description: Test for BZ#1204179 (missing /bin/vi breaks visudo, sudoedit, crontab)
# Author: Filip Holec <fholec@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# 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/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim-common"
REQUIRES="vim-minimal"
OLDTERM=$(echo $TERM)
TERM="xterm"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlAssertRpm $REQUIRES
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
export EDITOR=vi;
rlPhaseEnd
rlPhaseStartTest
rlRun "crontab -e <<<':q' 2> output" 0 "Run the crontab"
rlRun "cat output"
rlAssertNotGrep "/bin/sh: /bin/vi: No such file or directory" output
rlAssertNotGrep "crontab: \"/bin/vi\" exited with status 127" output
rlRun "sudoedit /etc/hosts <<<':q' 2> output" 0 "Run sudoedit command"
rlAssertNotGrep "sudoedit: /bin/vi: command not found" output
rlRun "visudo <<<':q' 2> output" 0 "Run visudo command"
rlAssertNotGrep "visudo: no editor found (editor path = /bin/vi)" output
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
TERM=$OLDTERM
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,8 @@
#!/bin/bash
#Measure CPU load 100 times during 10 seconds
touch cpu.log
for _ in `seq 1 100`
do
echo `ps -C vim -o psr,%cpu | sed 1d | tr -s " " | awk -F " " '{sum += $2} END {print sum}' | cut -d "." -f 1` >>cpu.log
python -c "from time import sleep; sleep(0.1)"
done &

View file

@ -0,0 +1,29 @@
summary: Test for BZ#1383902 (CPU spikes to 100% and timeouts observed in strace)
description: |
Bug summary: CPU spikes to 100% and timeouts observed in strace when opening yaml extensions using vim
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1383902
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
require:
- library(distribution/epel)
recommend:
- vim
- psmisc
duration: 10m
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1383902
adjust:
- enabled: false
when: distro < rhel-6
continue: false
- enabled: false
when: arch == s390x
continue: false
extra-nitrate: TC#0546986
extra-summary: /CoreOS/vim/Regression/bz1383902-CPU-spike-on-ssh
extra-task: /CoreOS/vim/Regression/bz1383902-CPU-spike-on-ssh
id: 4f06f0d3-2ce5-47ab-b7e0-c1bed7934cf2

View file

@ -0,0 +1,66 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz1383902-CPU-spike-on-ssh
# Description: Test for BZ#1383902 (CPU spikes to 100% and timeouts observed in strace)
# Author: Anna Khaitovich <akhaitov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 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:-"vim-enhanced"}
rlJournalStart
rlPhaseStartSetup
rlAssertRpm --all
rlImport "distribution/epel"
epelEnableMainRepo
rlRun "yum install -y tmux" 0 "Installing tmux"
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp cpu.sh $TmpDir"
rlRun "pushd $TmpDir"
rlRun "ssh-keygen -f test.txt -N ''" 0 "Generating random ssh key"
rlRun "echo '- $(cat test.txt.pub)' >test.yaml" 0 "Copying hyphen + ssh key to a yaml file"
rlRun "export TERM=xterm"
rlPhaseEnd
rlPhaseStartTest
rlRun "tmux -u -L poc_session new-session -d -x 80 -y 24"
sleep 3
#cpu.sh script does the CPU load mapping
rlRun "bash ./cpu.sh" 0 "Running cpu.sh"$
sleep 1
rlRun "tmux -u -L poc_session send-keys -t 0 'vim test.yaml' ENTER" 0 "Running reproducer"
sleep 10
#Calculate average CPU load with top 10 measurings made by cpu.sh
ProcCPU=$(cat cpu.log | sort -rn | head -n 10 | awk '{sum += $1; n++} END {if (n>0) print sum/n;}' | cut -d "." -f 1)
rlAssertGreaterOrEqual "Check if cpu load is under 90%" 90 $ProcCPU
rlPhaseEnd
rlPhaseStartCleanup
rlRun "killall vim" 0 "Shut down vim"
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,22 @@
summary: Check if vim segfaults when receives SIGTERM and SIGHUP in a short amount
of time
description: ''
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
duration: 15m
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1490927
adjust:
- enabled: false
when: distro < rhel-7
continue: false
extra-nitrate: TC#0574618
extra-summary: /CoreOS/vim/Regression/bz1490927-vim-dumps-core-when-system-reboots
extra-task: /CoreOS/vim/Regression/bz1490927-vim-dumps-core-when-system-reboots
id: bd378925-bbeb-474e-915b-ea117670fcfe

View file

@ -0,0 +1,41 @@
#!/usr/bin/bash
# Run with: systemd-run --slice test.slice ./test.sh
SSH_PARAMS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
CORE_DIR="${1:-/root/}"
if [ ! -d $CORE_DIR ]; then
echo >&2 "$CORE_DIR must exists"
exit 1
fi
logger "$CORE_DIR"
# Kill all vim processes
kill -9 $(pidof vim)
# Run vim in another ssh session with forced pseudo-tty allocation
ssh -tt $SSH_PARAMS localhost "cd $CORE_DIR && logger \"TTY: \$SSH_TTY\" && ulimit -c unlimited && vim -R /var/log/messages" &
ls -l /dev/pts/ | logger
sleep 10
# Check if there is only one Vim running and if it has cgroup file
# under /proc/$PID
if [ `pgrep vim | wc -l` -ne 1 ] || [ ! -f /proc/$(pgrep vim)/cgroup ]
then
echo >&2 "Vim is not opened or there are multiple instances."
exit 1
fi
# Older OS have several lines in cgroup file, we need to grep
# the line with systemd. Newer OS contains only one line, no need
# for pattern there.
if [ `cat /proc/$(pgrep vim)/cgroup | wc -l` -eq 1 ]
then
PATTERN=''
else
PATTERN='systemd'
fi
# Kill the slice vim is running under - update string pattern in awk
# based on OS
systemctl stop $(basename $(awk -F ":" '/'"$PATTERN"'/ { print $3 }' /proc/$(pgrep vim)/cgroup))

View file

@ -0,0 +1,87 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz1490927-vim-dumps-core-when-system-reboots
# Description: Check if vim segfaults when receives SIGTERM and SIGHUP in a short amount of time
# Author: Frantisek Sumsal <fsumsal@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 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="vim-enhanced"
REPRODUCER="$PWD/reproducer.sh"
SSH_PRIVKEY="/root/.ssh/id_ed25519"
SSH_PUBKEY="/root/.ssh/id_ed25519.pub"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
# Setup SSH
rlFileBackup --clean "~/.ssh/"
rlRun "rm -fv ~/.ssh/*"
rlRun "ssh-keygen -t ed25519 -f $SSH_PRIVKEY -N ''"
rlRun "cat $SSH_PUBKEY > ~/.ssh/authorized_keys"
rlPhaseEnd
for i in {0..9}; do
rlPhaseStartTest "Try #$i"
LOG_FILE="$(mktemp)"
SLICE="segfault$RANDOM.slice"
TEST_DIR="$(mktemp -d $PWD/testdirXXX)"
# Run the reproducer under its own slice to not kill our current one
rlRun "systemd-run -r --slice $SLICE /bin/bash $REPRODUCER $TEST_DIR 2>&1 | tee $LOG_FILE"
# Now check if the reproducer was started successfully
SERVICE="$(grep -Eo "(run-[0-9a-zA-Z]*.service)" $LOG_FILE)"
if [[ -z "$SERVICE" ]]; then
rlFail "Failed to start the reproducer via systemd-run"
else
rlRun "sleep 6"
rlRun "systemctl status $SERVICE --no-pager"
eval $(systemctl show -p ExecMainStatus $SERVICE)
if [[ $ExecMainStatus -ne 0 ]]; then
rlFail "Failed to execute the reproducer correctly"
else
# Check if the reproducer generated any coredumps
rlRun "ls -l $TEST_DIR/core*" 2
fi
rlRun "journalctl --no-pager _SYSTEMD_UNIT=$SERVICE"
rlRun "systemctl stop $SERVICE"
fi
# Cleanup
rlRun "systemctl stop $SLICE" 0-255
rlRun "rm -frv $TEST_DIR $LOG_FILE"
rlPhaseEnd
done
rlPhaseStartCleanup
rlFileRestore
rlRun "popd"
rlRun "rm -r $TEST_SCRIPT $TmpDir"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,32 @@
summary: Test for BZ#1576470 (Suggest correct packages to get embedded)
description: |
Bug summary: Suggest correct packages to get embedded interpreters working
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1576470
Description:
Test checks whether vim suggests all packages needed for clean install and functionality
of som of its feature (like python2/python3/perl embedded interpreters, ...).
Packages that don't require other dependencies/packages are ignored.
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
- vim-X11
duration: 5m
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1576470
adjust:
- enabled: false
when: distro < rhel-8
continue: false
- enabled: false
when: distro == rhel-alt-7
continue: false
extra-nitrate: TC#0575504
extra-summary: /CoreOS/vim/Regression/bz1576470-Suggest-correct-packages-to-get-embedded
extra-task: /CoreOS/vim/Regression/bz1576470-Suggest-correct-packages-to-get-embedded
id: 42122852-8571-42ef-b88c-066d3ee2bf8b

View file

@ -0,0 +1,82 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz1576470-Suggest-correct-packages-to-get-embedded
# Description: Test for BZ#1576470 (Suggest correct packages to get embedded)
# Author: Patrik Mosko <pmosko@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 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
VIM="vim-enhanced"
GVIM="vim-X11"
declare -A suggestions_deps
suggestions="python2 python3 perl ruby"
# arrays of sibling suggestions - vim should suggest every package from array (not only few of them)
suggestions_deps=(["python2"]="python2 python2-libs" \
["python3"]="python3 python3-libs" \
["perl"]="perl-devel" \
["ruby"]="ruby ruby-libs")
rlJournalStart
rlPhaseStartSetup
rlAssertRpm "$VIM"
rlAssertRpm "$GVIM"
#rhel-8 only - rhel7's rpm doesn't know option --suggests
rlRun "VIM_suggestions=\`rpm -q --suggests $VIM\`" 0 "retrieve list of vim's suggested packages"
rlRun "GVIM_suggestions=\`rpm -q --suggests $GVIM\`" 0 "retrieve list of gvim's suggested packages"
VIM_suggestions=`echo $VIM_suggestions | tr '\n' ' '`
GVIM_suggestions=`echo $GVIM_suggestions | tr '\n' ' '`
rlPhaseEnd
for edi in VIM GVIM; do
rlPhaseStartTest
xVIM_suggestions=${edi}_suggestions
for vim_sugg in ${!xVIM_suggestions}; do
rlLogDebug "Looking for $vim_sugg sibling suggestions/dependencies."
for test_sugg in $suggestions; do
if [[ $vim_sugg =~ $test_sugg.* ]]; then
deps_num=0
rlLogDebug "suggestions_deps[$test_sugg] = ${suggestions_deps[$test_sugg]}"
for dep in ${suggestions_deps[$test_sugg]}; do
[[ $VIM_suggestions =~ (^| )$dep($| ) ]] && (( deps_num++ ))
done
rlLogDebug "Found $deps_num/`echo \"${suggestions_deps[$test_sugg]}\" | wc -w` expected suggestions for package $test_sugg"
if [[ $deps_num == `echo "${suggestions_deps[$test_sugg]}" | wc -w` ]]; then
rlPass "$vim_sugg is suggested along with other dependencies/denepdants: ${suggestions_deps[$test_sugg]}"
else
rlFail "Some packages dependent to/for $vim_sugg are not being suggested!"
fi
fi
done
done
rlPhaseEnd
done
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,28 @@
summary: Test for BZ#1602807 (vim-X11 doesn't provide the gui)
description: |
Bug summary: vim-X11 doesn't provide the gui
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1602807
Decsription:
Try to open gvim (with GUI) through xvfb-run in virtual X environment.
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
- vim-X11
- xorg-x11-server-Xvfb
duration: 5m
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1602807
adjust:
- enabled: false
when: distro < rhel-7
continue: false
extra-nitrate: TC#0576064
extra-summary: /CoreOS/vim/Regression/bz1602807-vim-X11-doesn-t-provide-the-gui
extra-task: /CoreOS/vim/Regression/bz1602807-vim-X11-doesn-t-provide-the-gui
id: 9cfdb7e1-c9f1-46b8-9432-a846fb7bb500

View file

@ -0,0 +1,49 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz1602807-vim-X11-doesn-t-provide-the-gui
# Description: Test for BZ#1602807 (vim-X11 doesn't provide the gui)
# Author: Patrik Mosko <pmosko@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 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="vim-X11 xorg-x11-server-Xvfb"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm --all
if rpm -q --quiet vim-enhanced; then
rlPass "Vim package is installed ($(rpm -q vim-enhanced))"
elif rpm -q --quiet vim-minimal; then
rlPass "Vim package is installed ($(rpm -q vim-minimal))"
else
rlFail "Vim package is not installed!"
fi
rlPhaseEnd
rlPhaseStartTest "Open gvim"
rlWatchdog "rlRun 'xvfb-run -w 10 timeout 3 gvim'" 60
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -22,6 +22,8 @@ adjust:
when: distro < rhel-7
continue: false
extra-nitrate: TC#0599530
extra-summary: /CoreOS/vim/Regression/bz1676339-Vim-runs-out-of-memory-during-a-find-and-replace
extra-task: /CoreOS/vim/Regression/bz1676339-Vim-runs-out-of-memory-during-a-find-and-replace
id: d8580839-772b-413a-af0f-4a9c74e01291
extra-summary:
/CoreOS/vim/Regression/bz1676339-Vim-runs-out-of-memory-during-a-find-and-replace
extra-task:
/CoreOS/vim/Regression/bz1676339-Vim-runs-out-of-memory-during-a-find-and-replace
id: f135f478-9041-4a67-9afb-79cc28df7bcb

View file

@ -0,0 +1,23 @@
summary: Test for BZ#1686822 (Add Provides bundled(libvterm))
description: |
Bug summary: Add Provides: bundled(libvterm)
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1686822
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim
duration: 5m
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1686822
adjust:
- enabled: false
when: distro < rhel-6
continue: false
extra-nitrate: TC#0611963
extra-summary: /CoreOS/vim/Regression/bz1686822-Add-Provides-bundled-libvterm
extra-task: /CoreOS/vim/Regression/bz1686822-Add-Provides-bundled-libvterm
id: 00302e64-c558-46c9-bf2f-a80d833681d7

View file

@ -0,0 +1,47 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz1686822-Add-Provides-bundled-libvterm
# Description: Test for BZ#1686822 (Add Provides bundled(libvterm))
# Author: Zdenek Dohnal <zdohnal@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 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="vim"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm vim-enhanced
rlPhaseEnd
rlPhaseStartTest
if rlIsRHEL '<9'
then
rlLogWarning "The bundled(libvterm) provide isn't present in RHEL < 9"
else
rlRun "rpm -q --provides vim-enhanced | grep 'bundled(libvterm)'"
fi
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,31 @@
summary: Test for BZ#1743070 (manpage of vim is garbled in Japanese locale)
description: |
Bug summary: manpage of vim is garbled in Japanese locale
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1743070
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
- glibc-langpack-ja
duration: 5m
enabled: true
tag:
- Tier1
tier: '1'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1743070
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1745476
adjust:
- enabled: false
when: distro < rhel-8.3
continue: false
- enabled: false
when: distro < rhel-8
continue: false
extra-nitrate: TC#0606300
extra-summary: /CoreOS/vim/Regression/bz1743070-manpage-of-vim-is-garbled-in-Japanese-locale
extra-task: /CoreOS/vim/Regression/bz1743070-manpage-of-vim-is-garbled-in-Japanese-locale
id: 80355ae5-a835-4dc0-b60b-a7a745eb1f78

View file

@ -0,0 +1,44 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz1743070-manpage-of-vim-is-garbled-in-Japanese-locale
# Description: Test for BZ#1743070 (manpage of vim is garbled in Japanese locale)
# Author: Zdenek Dohnal <zdohnal@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 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="vim-enhanced"
rlJournalStart
rlPhaseStartTest
rlAssertRpm $PACKAGE
(rlIsRHEL '>7' || rlIsCentOS '>7') && rlAssertRpm "glibc-langpack-ja"
rlAssertExists "/usr/share/man/ja/man1/vim.1.gz"
rlRun "LC_MESSAGES=ja_JP.utf8 man -P cat vim | grep 'プログラマのテキストエディタ'"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,38 @@
summary: Test for bz241308 (please use augroup for /etc/vimrc autocmds)
description: |
Bug summary: please use augroup for /etc/vimrc autocmds
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=241308
Description:
Configuration file /etc/vimrc should contain all rh-provided
autocmds in an augroup so that they are easily deactivated.
This test checks for augroup presence in /etc/vimrc and makes sure
deactivating all rh-provided autocmds works with :au! redhat
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim
- vim-minimal
duration: 5m
enabled: true
tag:
- Tier3
tier: '3'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=241308
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=578785
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1640919
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=841904
adjust:
- enabled: false
when: distro < rhel-5
continue: false
extra-nitrate: TC#0008788
extra-summary: /CoreOS/vim/Regression/bz241308-use-augroup-for-rh-autocmds
extra-task: /CoreOS/vim/Regression/bz241308-use-augroup-for-rh-autocmds
id: 3e36222b-bef7-4938-afc7-341e66d42e8e

View file

@ -0,0 +1,75 @@
#!/bin/bash
# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz241308-use-augroup-for-rh-autocmds
# Description: Test for bz241308 (please use augroup for /etc/vimrc autocmds)
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 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/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim-minimal"
rlJournalStart
rlPhaseStartSetup Setup
rlAssertRpm "vim-minimal"
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlFileBackup /etc/vimrc
rlIsRHEL && GroupName="redhat" || GroupName="fedora"
rlLog $GroupName
rlPhaseEnd
rlPhaseStartTest Testing
rlAssertGrep "augroup $GroupName" "/etc/vimrc"
# Additional functionality test on RHEL6+ only
if ! rlIsRHEL 5; then
# For rhel9 the using of .spec template is disabled by default, so for test it needs to be enabled
if rlIsRHEL '>=9' || rlIsCentOS '>=9'; then
ENABLE_TEMPL_CMD="autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec"
ESCAPED_CMD=$(echo "$ENABLE_TEMPL_CMD" | sed 's@\*@\\*@')
rlRun "sed -i \"s@\\\" ${ESCAPED_CMD}@${ESCAPED_CMD}@\" /etc/vimrc" 0 "Enabling .spec template for test"
# augroup on, spec file should be populated with skeleton
rlRun "vim package.spec -cw -cq" 0 "Editing the spec file with $GroupName augroup on"
rlAssertGrep "changelog" "package.spec"
rlRun "cat package.spec"
fi
# augroup off, created spec file should be empty
rlRun "vim -c 'au!$GroupName' -c 'e empty.spec' -cw -cq" \
0 "Editing the spec file with $GroupName augroup off"
rlAssertNotGrep "changelog" "empty.spec"
rlRun "cat empty.spec"
fi
rlPhaseEnd
rlPhaseStartCleanup Cleanup
rlFileRestore
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,30 @@
summary: Test for bz429208 (VIM mem calculation wrong)
description: |
Bug summary: VIM mem calculation wrong
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=429208
Description:
Vim memory calculation was wrong on 32-bit archs when total memory
available exceeded 4GB. In such cases maxmemtot variable would be
incorrectly set to a very low value which caused vim to slow down
considerably on large files.
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
- binutils
duration: 5m
enabled: true
tag:
- Tier3
tier: '3'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=429208
extra-nitrate: TC#0008789
extra-summary: /CoreOS/vim/Regression/bz429208-maxmemtot-memory-calculation
extra-task: /CoreOS/vim/Regression/bz429208-maxmemtot-memory-calculation
id: 72dc969a-a2bd-4bd0-bff1-ad9276728b60

View file

@ -0,0 +1,56 @@
#!/bin/bash
# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz429208-maxmemtot-memory-calculation
# Description: Test for bz429208 (VIM mem calculation wrong)
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 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 rhts environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim-enhanced"
rlJournalStart
rlPhaseStartTest
rlAssertRpm "vim-enhanced"
# maxmemtot (from vim)
rlRun "VimMemory=\`vim -c 'set maxmemtot' -c q | strings |
grep maxmemtot | sed 's/.*=//'\`" 0 "Inspecting maxmemtot"
rlLog "maxmemtot: $VimMemory KiB (should be half of the total)"
rlRun "((DoubleVimMemory = VimMemory * 2 / 1024))" 0,1 \
"Converting maxmemtot to MB, multiplying by two"
rlLog "Double maxmemtot: $DoubleVimMemory MiB"
# total (from free)
rlRun "TotalMemory=\`free -m | grep Mem | awk '{ print \$2 }'\`" \
0 "Parsing total memory from 'free'"
rlLog "Total memory: $TotalMemory MiB"
# should be the same
rlAssertEquals "Double maxmemtot should equal total memory" \
$TotalMemory $DoubleVimMemory
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,16 @@
# Test
## Step
**Test**
Step 1.
This test has to be run on a machine with memory > 4GiB.
## Expect
**Test**
Step 1.
1.

View file

@ -0,0 +1,41 @@
summary: Test for bz473977 (vim incorrectly linked to libtermcap)
description: |
Bug summary: vim incorrectly linked to libtermcap instead of libncurses
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=473977
Description:
vim is apparently linked to libtermcap instead of libcurses or
libncurses (preferable). This causes many vim to have incorrect
capabilities under many values for TERM.
Description:
vim is apparently linked to libtermcap instead of libcurses or
libncurses (preferable). This causes many vim to have incorrect
capabilities under many values for TERM.
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim
- vim-X11
- file
- vim-enhanced
- vim-minimal
- glibc-common
duration: 5m
enabled: true
tag:
- Tier2
tier: '2'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=473977
adjust:
- enabled: false
when: distro < rhel-4
continue: false
extra-nitrate: TC#0008791
extra-summary: /CoreOS/vim/Regression/bz473977-vim-incorrectly-linked-to-libtermcap
extra-task: /CoreOS/vim/Regression/bz473977-vim-incorrectly-linked-to-libtermcap
id: 1c253fe0-b17a-4676-849d-4d05bbe61d6a

View file

@ -0,0 +1,101 @@
#!/bin/bash
# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz473977-vim-incorrectly-linked-to-libtermcap
# Description: Test for bz473977 (vim incorrectly linked to libtermcap)
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 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 rhts environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim-enhanced"
rlJournalStart
rlPhaseStartSetup Setup
rlAssertRpm "vim-minimal"
rlAssertRpm "vim-enhanced"
rlAssertRpm "vim-X11"
rlRun "set -o pipefail"
if rlIsRHEL '<7'
then
PREFIX=""
else
PREFIX="/usr"
fi
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest "Testing vim-minimal"
for binary in $PREFIX/bin/{ex,rvi,rview,vi,view}
do
# in RHEL9 /bin/vi and /bin/view are not dynamic executables
# they're wrappers
# 1918575 - Use wrappers for vi/vim instead of aliases
if rlIsRHEL '>=9' || rlIsCentOS '>=9' || rlIsFedora '>=32' \
&& [[ $binary = $PREFIX'/bin/vi' || $binary = $PREFIX'/bin/view' ]]
then
rlRun "ldd $binary |& tee output" 1 "Checking if $binary is not linked as expected"
rlRun "grep \"not a dynamic executable\" output" 0 "Checking if not a dynamic executable"
rlRun "file --mime $binary | grep 'text/plain'" 0 "The file should be a wrapper."
rlRun "binary='/usr/libexec/vi'" 0 "Assign the real executable"
elif [ $binary != $PREFIX'/bin/vi' ] && [ $binary != $PREFIX'/bin/view' ]
then
rlRun "file --mime $binary | grep 'symlink'" 0 "$binary must be a symlink"
fi
rlRun "ldd $binary | tee output" 0 "Checking $binary"
# make sure there are no libs in /usr/ in ldd output
rlAssertNotGrep "/usr/" "output"
done
rlPhaseEnd
rlPhaseStartTest "Testing vim-enhanced"
for binary in /usr/bin/{ex,rvim,vim,vimdiff} ; do
rlRun "ldd $binary | egrep 'termcap|ncurses' | tee output" \
0-1 "Checking $binary"
rlAssertNotGrep "libtermcap" "output"
# RHEL 6 got updated to 7.4 - ncurses dependency dropped
rlIsRHEL 5 &&rlAssertGrep "ncurses" "output"
done
rlPhaseEnd
rlPhaseStartTest "Testing vim-X11"
rlIsRHEL 4 && path="/usr/X11R6/bin" || path="/usr/bin"
for binary in $path/{evim,gex,gview,gvim,gvimdiff,vimx} ; do
rlRun "ldd $binary | egrep 'termcap|ncurses' | tee output" \
0-1 "Checking $binary"
rlAssertNotGrep "libtermcap" "output"
# RHEL 6 got updated to 7.4 - ncurses dependency dropped
rlIsRHEL 5 && rlAssertGrep "ncurses" "output"
done
rlPhaseEnd
rlPhaseStartCleanup Cleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,33 @@
summary: 'Test for bz505344 (netrw plugin: delete command broken)'
description: |
Bug summary: netrw plugin: delete command broken
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=505344
Description:
Since the fix for security issue CVE-2008-6235 the delete command
of netrw plugin does not successfully delete files or directories.
Description:
Since the fix for security issue CVE-2008-6235 the delete command
of netrw plugin does not successfully delete files or directories.
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim
- vim-enhanced
duration: 5m
enabled: true
tag:
- Tier2
tier: '2'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=505344
extra-nitrate: TC#0009527
extra-summary: /CoreOS/vim/Regression/bz505344-netrw-plugin-delete-command-broken
extra-task: /CoreOS/vim/Regression/bz505344-netrw-plugin-delete-command-broken
id: 1ebf22e6-7dda-494b-8818-e2dfca4753da

View file

@ -0,0 +1,67 @@
#!/bin/bash
# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz505344-netrw-plugin-delete-command-broken
# Description: Test for bz505344 (netrw plugin: delete command broken)
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 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 rhts environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim-enhanced"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
# create test file & dir
rlRun "touch testfile" 0 "Creating test file"
rlRun "mkdir testdir" 0 "Creating test directory"
rlAssertExists "testfile"
rlAssertExists "testdir"
# create vim scripts
rlRun "echo '/testfile
Dy
:q' > scriptfile" \
0 "Creating file delete script"
rlRun "echo '/testdir
Dy
:q' > scriptdir" \
0 "Creating directory delete script"
rlPhaseEnd
rlPhaseStartTest
rlRun "vim . -s scriptfile" 0 "Deleting file using netrw"
rlAssertNotExists "testfile"
rlRun "vim . -s scriptdir" 0 "Deleting directory using netrw"
rlAssertNotExists "testdir"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,24 @@
summary: Test for bz506442 (Add Vim to Applications > Accessories menu)
description: ''
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim
- vim-common
- vim-enhanced
- vim-minimal
- vim-X11
duration: 5m
enabled: true
tag:
- Tier3
tier: '3'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=506442
extra-nitrate: TC#0057108
extra-summary: /CoreOS/vim/Regression/bz506442-Add-Vim-to-Applications-Accessories-menu
extra-task: /CoreOS/vim/Regression/bz506442-Add-Vim-to-Applications-Accessories-menu
id: e257c698-e0e1-4611-8744-b2bd433b165f

View file

@ -0,0 +1,56 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz506442-Add-Vim-to-Applications-Accessories-menu
# Description: Test for bz506442 (Add Vim to Applications > Accessories menu)
# Author: David Kutalek <dkutalek@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2010 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 rhts environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm vim-common
rlAssertRpm vim-enhanced
rlAssertRpm vim-minimal
rlAssertRpm vim-X11
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
DESKTOP_FILE=`find /usr/share/applications -name '*vim.desktop'`
rlRun "[ -r "$DESKTOP_FILE" ]" 0 "gvim desktop file readable: $DESKTOP_FILE"
rlPhaseEnd
rlPhaseStartTest
rlRun "grep '^Categories=.*Utility;TextEditor;.*' $DESKTOP_FILE" 0
rlRun "grep '^Categories=.*Development;.*' $DESKTOP_FILE" 1
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,2 @@
" comment
q

View file

@ -0,0 +1,31 @@
summary: Test for bz572157 (vim in ex mode incorrectly gives an eol error)
description: |
Bug summary: SR #1991386 vim in ex mode incorrectly gives an end-of-line error in RHEL-5
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=572157
Description:
Escalated to Bugzilla from IssueTracker
Description:
Escalated to Bugzilla from IssueTracker
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim
- vim-minimal
duration: 5m
enabled: true
tag:
- Tier2
tier: '2'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=572157
extra-nitrate: TC#0057109
extra-summary: /CoreOS/vim/Regression/bz572157-vim-in-ex-mode-incorrectly-gives-an-eol-error
extra-task: /CoreOS/vim/Regression/bz572157-vim-in-ex-mode-incorrectly-gives-an-eol-error
id: ba8e8fec-4691-413e-b312-c0c9d99f5345

View file

@ -0,0 +1,45 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz572157-vim-in-ex-mode-incorrectly-gives-an-eol-error
# Description: Test for bz572157 (vim in ex mode incorrectly gives an eol error)
# Author: David Kutalek <dkutalek@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2010 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 rhts environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm vim-minimal
rlPhaseEnd
rlPhaseStartTest
rlRun "ex -u NONE ~/.bash_profile < ./exdoublequote"
rlRun "ex -u NONE ~/.bash_profile < ./expounddoublequote"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,26 @@
summary: Test for BZ#591578 (netrw prints 'e' in front of filenames)
description: |
Bug summary: netrw.vim print additional 'e' in front of filenames
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=591578
Check whether in zh_CN.gbk locale netrw plugin correctly displays filenames.
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
duration: 5m
enabled: true
tag:
- Tier3
tier: '3'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=591578
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1031691
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1234547
extra-nitrate: TC#0184612
extra-summary: /CoreOS/vim/Regression/bz591578-netrw-vim-prints-additional-chars
extra-task: /CoreOS/vim/Regression/bz591578-netrw-vim-prints-additional-chars
id: 1fbb19d5-7566-438f-8891-1e742c83e145

View file

@ -0,0 +1,54 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz591578-netrw-vim-prints-additional-chars
# Description: Test for BZ#591578 (netrw prints 'e' in front of filenames)
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2012 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/share/beakerlib/beakerlib.sh
PACKAGE="vim-enhanced"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
cmd="vim -c 'call netrw#LocalBrowseCheck(expand(\"%:p\")) | w output | q'"
rlRun "LC_CTYPE=zh_CN.gbk $cmd ." \
0 "Save directory listing"
rlAssertNotGrep "^e\.\." "output"
rlAssertGrep "^\.\." "output"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,33 @@
summary: Test for BZ#634902 (rpm spec template is out-of-date)
description: |
Bug summary: rpm spec template is out-of-date
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=634902
Make sure the rpm spec template uses %{buildroot} macro instead of
the obsoleted $RPM_BUILD_ROOT variable.
Make sure the rpm spec template uses %{buildroot} macro instead of
the obsoleted $RPM_BUILD_ROOT variable.
Test Case Relevancy:
distro = rhel-4, rhel-5: False
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-common
- vim-data
duration: 5m
enabled: true
tag:
- Tier3
tier: '3'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=634902
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1211214
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=825679
extra-nitrate: TC#0147908
extra-summary: /CoreOS/vim/Regression/bz634902-rpm-spec-template-is-out-of-date
extra-task: /CoreOS/vim/Regression/bz634902-rpm-spec-template-is-out-of-date
id: 83feb702-ab66-4715-ad3b-db05df92402f

View file

@ -0,0 +1,56 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz634902-rpm-spec-template-is-out-of-date
# Description: Test for BZ#634902 (rpm spec template is out-of-date)
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2012 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/share/beakerlib/beakerlib.sh || exit 1
if rlIsFedora; then
PACKAGE="vim-data"
else
PACKAGE="vim-common"
fi
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "SpecTemplate=$(rpm -ql $PACKAGE | grep template.spec)"
rlPhaseEnd
rlPhaseStartTest
rlRun "cat $SpecTemplate" 0 "Checking the spec template"
rlAssertNotGrep "\$RPM_BUILD_ROOT" $SpecTemplate
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,26 @@
summary: Test for BZ#652610 ("vim .." does not show files properly)
description: |
Bug summary: "vim .." does not show files properly
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=652610
Check whether 'vim ..' correctly displays contents of the parent
directory.
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
duration: 5m
enabled: true
tag:
- Tier3
tier: '3'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=652610
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=825307
extra-nitrate: TC#0147914
extra-summary: /CoreOS/vim/Regression/bz652610-netrw-plugin-and-parent-directory
extra-task: /CoreOS/vim/Regression/bz652610-netrw-plugin-and-parent-directory
id: fdb13bca-b85a-44b6-9703-dc973ef121bd

View file

@ -0,0 +1,59 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz652610-netrw-plugin-and-parent-directory
# Description: Test for BZ#652610 ("vim .." does not show files properly)
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2012 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/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim-common"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "export LANG=en_US.UTF-8" 0 "Setting the locale"
rlRun "touch file{01..10}" 0 "Creating test files"
rlRun "mkdir dir"
rlRun "pushd dir"
rlPhaseEnd
rlPhaseStartTest
for file in file{01..02}; do
rlRun "vim -c 'call netrw#LocalBrowseCheck(expand(\"%:p\")) | w out_$file | q' .." \
0 "Saving directory listing output"
rlAssertGrep "$file" "out_$file"
rlAssertNotGrep "Pattern not found" "out_$file"
done
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd; popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,11 @@
#!/usr/bin/expect -f
set timeout -1
spawn vim -N -u NONE -n -S crasher.vim file.txt
expect "foobar"
send -- "o"
send -- "foo"
send -- "\[24~"
send -- ""
send -- ":q!\r"
expect eof

View file

@ -0,0 +1,84 @@
" Test case by Ingo Karkat:
" http://vim.1045645.n5.nabble.com/Crash-with-completefunc-mapping-followed-by-text-td1210506.html
"
function! s:FindMatchesInCurrentWindow( matches, pattern, matchTemplate, options, isInCompletionBuffer )
let l:isBackward = has_key(a:options, 'backward_search')
let l:save_cursor = getpos('.')
let l:firstMatchPos = [0,0]
while ! complete_check()
let l:matchPos = searchpos( a:pattern, 'w' . (l:isBackward ? 'b' : '') )
if l:matchPos == [0,0] || l:matchPos == l:firstMatchPos
break
endif
if l:firstMatchPos == [0,0]
let l:firstMatchPos = l:matchPos
endif
let l:matchEndPos = searchpos( a:pattern, 'cen' )
if a:isInCompletionBuffer && (l:matchEndPos == l:save_cursor[1:2])
continue
endif
let l:matchObj = copy(a:matchTemplate)
let l:matchText = a:options.extractor(l:matchPos, l:matchEndPos, l:matchObj)
let l:matchObj.word = l:matchText
if ! empty(l:matchText) && index(a:matches, l:matchObj) == -1
call add( a:matches, l:matchObj )
endif
endwhile
call setpos('.', l:save_cursor)
endfunction
function! MotionComplete_ExtractText( startPos, endPos, matchObj )
let l:save_cursor = getpos('.')
let @@ = ''
call setpos('.', [0, a:startPos[0], a:startPos[1], 0])
execute 'silent! normal y' . s:motion
let l:text = @@
call setpos('.', l:save_cursor)
return l:text
endfunction
function! s:LocateStartCol()
let l:startCol = searchpos('\k\+\%(\k\@!.\)*\%#', 'bn', line('.'))[1]
if l:startCol == 0
let l:startCol = col('.')
endif
return l:startCol
endfunction
function! s:MotionComplete( findstart, base )
if a:findstart
return s:LocateStartCol() - 1 " Return byte index, not column.
else
let l:options = {}
let l:options.extractor = function('MotionComplete_ExtractText')
let l:matches = []
call s:FindMatchesInCurrentWindow( l:matches, '\V\<' . escape(a:base, '\'), {}, l:options, 1 )
return l:matches
endif
endfunction
let s:motion = 'w'
inoremap <silent> <Plug>MotionComplete <C-o>:set completefunc=<SID>MotionComplete<CR><C-x><C-u>
" The original mapping that caused the crash.
" In combination with an expression to select the first match in the popup menu
" (this is useful in combination with :set completeopt=menu,longest), Vim
" crashes.
"imap <F12> <Plug>MotionComplete<C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>
" A simplified mapping that still causes the crash.
imap <F12> <Plug>MotionComplete+Some-More-Text
" The bare mapping works fine.
if exists('nobug')
imap <F12> <Plug>MotionComplete
endif

View file

@ -0,0 +1,29 @@
summary: Test for BZ#681108 (vim crashes while doing completion)
description: |
Bug summary: vim crashes while doing completion
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=681108
Vim completion crash reproducer based on the test case by Ingo Karkat:
http://vim.1045645.n5.nabble.com/Crash-with-completefunc-mapping-followed-by-text-td1210506.html
Vim completion crash reproducer based on the test case by Ingo Karkat:
http://vim.1045645.n5.nabble.com/Crash-with-completefunc-mapping-followed-by-text-td1210506.html
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
- expect
duration: 5m
enabled: true
tag:
- Tier3
tier: '3'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=681108
extra-nitrate: TC#0184619
extra-summary: /CoreOS/vim/Regression/bz681108-vim-crashes-while-doing-completion
extra-task: /CoreOS/vim/Regression/bz681108-vim-crashes-while-doing-completion
id: 53b4557a-6ca8-4601-aa26-3686b5461348

View file

@ -0,0 +1,55 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz681108-vim-crashes-while-doing-completion
# Description: Test for BZ#681108 (vim crashes while doing completion)
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2012 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/share/beakerlib/beakerlib.sh
PACKAGE="vim-enhanced"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp crasher.* $TmpDir" 0 "Copying the crasher"
rlRun "pushd $TmpDir"
rlRun "echo -e 'foobar\nfoobar' > file.txt" 0 "Creating test file"
rlRun "ulimit -c unlimited" 0 "Enable core generation"
rlRun "export TERM=xterm" 0 "Pretend we're running under xterm"
rlPhaseEnd
rlPhaseStartTest
rlRun "expect crasher.exp" 0 "Running the reproducer"
rlRun "ls -l core*" 2 "Checking for core"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,24 @@
summary: Test for BZ#820331 (Vim syntax file for sshdconfig is missing newer)
description: |
Bug summary: Vim syntax file for sshdconfig is missing newer keyword entries
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=820331
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-common
duration: 5m
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=820331
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1404257
adjust:
- enabled: false
when: distro == rhel-4, rhel-5, rhel-8
continue: false
extra-nitrate: TC#0466605
extra-summary: Support for new sshd keywords
extra-task: /CoreOS/vim/Regression/bz820331-Vim-syntax-file-for-sshdconfig-is-missing-newer
id: 26ef93f2-2d87-4f9f-adf7-475d72cbbe51

View file

@ -0,0 +1,67 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/bz820331-Vim-syntax-file-for-sshdconfig-is-missing-newer
# Description: Test for BZ#820331 (Vim syntax file for sshdconfig is missing newer)
# Author: Filip Holec <fholec@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# 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/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="vim-common"
NEW_KEYWORDS="AllowAgentForwarding
AuthorizedKeysCommand
AuthorizedKeysCommandRunAs
ChrootDirectory
GSSAPIKeyExchange
GSSAPIStrictAcceptorCheck
KerberosUseKuserok
MaxSessions
RequiredAuthentications1
RequiredAuthentications2
"
RHEL6_BLACKLIST=""
RHEL7_BLACKLIST=""
RHEL8_BLACKLIST="RequiredAuthentications1 RequiredAuthentications2 AuthorizedKeysCommandRunAs"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
FILE=$(rpm -ql vim-common | grep sshdconfig.vim$)
rlAssertExists "$FILE" || rlDie "vim-common doesn't include syntax file for sshd_config"
shopt -s compat31 #for \\b
rlPhaseEnd
rlPhaseStartTest
for _ver in 6 7 8; do
rlIsRHEL "$_ver" || continue
_blist="RHEL${_ver}_BLACKLIST"
for k in $NEW_KEYWORDS; do
[[ "${!_blist}" =~ \\b"$k"\\b ]] || rlAssertGrep "syn keyword .*$k" $FILE
done
done
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

29
Regression/docs/main.fmf Normal file
View file

@ -0,0 +1,29 @@
summary: Test for man pages bugs
description: |+
Bug summary: Conflicting manpages rvi.1.gz and vi.1.gz during update
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1599660
Purpose of this file is to collect different bugs for man pages as proposed in
https://wiki.test.redhat.com/BaseOs/BestPractices/TestsForManPages
* "name of the test where one phase is one man page bug might be like this: /CoreOS/<component>/Sanity || Regression/docs "
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-minimal
- vim-common
duration: 5m
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1599660
adjust:
- enabled: false
when: distro < rhel-6
continue: false
extra-nitrate: TC#0575733
extra-summary: /CoreOS/vim/Regression/docs
extra-task: /CoreOS/vim/Regression/docs
id: be3cbe71-027a-43a0-af60-2c91fee4ab5e

102
Regression/docs/runtest.sh Executable file
View file

@ -0,0 +1,102 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Regression/docs
# Description: Test for man pages bugs:
# BZ#1599660 (Conflicting manpages rvi.1.gz and vi.1.gz during)
#
# Author: Patrik Mosko <pmosko@redhat.com>
#
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 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="vim-common vim-minimal"
rlJournalStart
rlPhaseStartSetup
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlAssertRpm --all
rlPhaseEnd
############################################################
# BZ#1599660
############################################################
rlPhaseStartTest "Test conflicting vim-{common,minimal} man pages"
VIMmin_ver=(`rpm -q vim-minimal | rev | sed -r 's;^[^.]*.[^.]*.([^-]*-[^-]*)-.*$;\1;' | rev | tr '.-' ' '`)
VIMcom_ver=(`rpm -q vim-common | rev | sed -r 's;^[^.]*.[^.]*.([^-]*-[^-]*)-.*$;\1;' | rev | tr '.-' ' '`)
VIMcom_conf_ver=(`rpm -q --conflicts vim-minimal | grep vim-common | awk '{print $3}' | tr '.-' ' '`)
VIMmin_conf_ver=(`rpm -q --conflicts vim-common | grep vim-minimal | awk '{print $3}' | tr '.-' ' '`)
# check only man-page files, could be changed to all files
rpm -ql vim-minimal | grep /man/ > VimMinRpmFiles
rpm -ql vim-common | grep /man/ > VimComRpmFiles
rlAssertExists VimMinRpmFiles
rlAssertExists VimComRpmFiles
rlAssertNotGrep VimMinRpmFiles VimComRpmFiles -w -f
#check version of actual vim-minimal with the one[s] that vim-common is conflicting with
higher=0
for v in "${!VIMmin_conf_ver[@]}"; do
(( ${VIMmin_ver[$v]} >= ${VIMmin_conf_ver[$v]} )) && [[ $higher == 0 ]] || break
#at least one part of the version should be higher than the same part in the other vim's rpm's
(( ${VIMmin_ver[$v]} > ${VIMmin_conf_ver[$v]} )) && (( higher++ ))
done
if [ ${VIMmin_conf_ver[@]} -eq 0 ]; then
rlPass "vim-common doesn't conflicts with vim-minimal"
elif [ $higher -ge 0 ]; then
rlPass "Actual version of vim-minimal is not conflicting with vim-common"
else
rlFail "Actual version of vim-minimal may conflicts with vim-common"
fi
#check version of actual vim-common with the one[s] that vim-minimal is conflicting with
higher=0
for v in "${!VIMcom_conf_ver[@]}"; do
(( ${VIMcom_ver[$v]} >= ${VIMcom_conf_ver[$v]} )) && [[ $higher == 0 ]] || break
#at least one part of the version should be higher than the same part in the other vim's rpm's
(( ${VIMcom_ver[$v]} > ${VIMcom_conf_ver[$v]} )) && (( higher++ ))
done
if [ ${VIMcom_conf_ver[@]} -eq 0 ]; then
rlPass "vim-common doesn't conflicts with vim-minimal"
elif [ $higher -ge 0 ]; then
rlPass "Actual version of vim-common is not conflicting with vim-minimal"
else
rlFail "Actual version of vim-common may conflicts with vim-minimal"
fi
rlPhaseEnd
# BZ#???????
# As RECOMMENDED in Best QA Practices, each man page fix that needs test case
# should be inserted here as independent Test Phase
#rlPhaseStartTest
# rlRun ""
#rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -25,4 +25,4 @@ adjust:
extra-nitrate: TC#0611953
extra-summary: /CoreOS/vim/Sanity/bz2011389-Loading-etc-vimrc-virc
extra-task: /CoreOS/vim/Sanity/bz2011389-Loading-etc-vimrc-virc
id: a74a0489-d7d7-4936-9587-04b1eb26d185
id: a0bf3075-7fc9-4178-9f09-df54a22c190d

View file

@ -72,7 +72,7 @@ rlJournalStart
rlPhaseEnd
rlPhaseStartTest "VI->VIM via alias"
if rlIsRHEL '<=8' && [ "$USER" = "root" ]
if (rlIsRHEL '<=8' || rlIsCentOS '<=8') && [ "$USER" = "root" ]
then
rlLog "RHEL 8 and older detected - vi is used for root, covered by next test"
else
@ -110,7 +110,7 @@ rlJournalStart
rlLog "# Default configuration - system virc and defaults.vim loaded #"
rlRun "echo 'set nu' >> /etc/virc"
rlRun "vi -c 'set history?' -c 'set nu?' -c q &> log"
if rlIsRHEL '>9' || rlIsFedora
if rlIsRHEL '>9' || rlIsCentOS '>9' || rlIsFedora
then
rlAssertGrep "history=200" log
else
@ -127,6 +127,8 @@ rlJournalStart
# if history is 50, defaults.vim (which sets it to 200) wasn't loaded and /etc/virc was
# loaded
rlAssertGrep "history=50" log
rlRun "dnf -y install vim-enhanced vim-common" 0 "Install vim"
rlPhaseEnd
rlPhaseStartCleanup
@ -135,8 +137,6 @@ rlJournalStart
rlFileRestore
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
# Reinstalling removed packages, it was causing issues in following tests
rlRun "dnf -y install vim-enhanced vim-common"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,51 @@
summary: Upstream script tests
description: ''
contact: fhrdina@redhat.com
component:
- vim
test: ./runtest.sh
framework: beakerlib
recommend:
- vim-enhanced
- rpm-build
- gcc
- Xvfb
- python3
- python3-devel
- perl-devel
- perl
- perl-generators
- perl-ExtUtils-ParseXS
- perl-ExtUtils-Embed
- libsodium-devel
- ruby
- ruby-devel
- lua-devel
- gpm-devel
- perl-ExtUtils-Embed
- libacl-devel
- ncurses-devel
- python3-dnf-plugins-core
duration: 40m
enabled: true
tag:
- Tier1
tier: '1'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2004974
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2011389
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2011424
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2011429
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2011749
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2011412
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2002320
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2004976
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2015517
adjust:
- enabled: false
when: distro < rhel-6
continue: false
extra-nitrate: TC#0602359
extra-summary: /CoreOS/vim/Sanity/upstream-scripttests
extra-task: /CoreOS/vim/Sanity/upstream-scripttests
id: 21a20fd5-2bcf-439b-8e58-1094e10e7078

View file

@ -0,0 +1,152 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/vim/Sanity/upstream-scripttests
# Description: Runs upstream scripttests
# Authors: Zdenek Dohnal <zdohnal@redhat.com>
# Patrik Mosko <pmosko@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 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="vim-enhanced" # tested package
TESTER="vimtester" # USERname which we use for testing
TEST=scripttests # main target for `make`
SET_XVFB="NO" # Do we want to setup `Xvfb` before testing?
TERM_type="xterm" # terminfo type set before running tests
set -o pipefail # because test output is piped to `tee`
if rlIsRHEL 8
then
CONFOPT="--build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-features=huge --enable-python3interp=dynamic --enable-perlinterp=dynamic --disable-tclinterp --with-x=no --enable-gui=no --enable-multibyte --enable-cscope --with-tlib=ncurses --enable-fips-warning --enable-netbeans --enable-rubyinterp=dynamic --enable-luainterp=dynamic"
elif rlIsRHEL 9
then
CONFOPT="--build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-features=huge --enable-python3interp=dynamic --enable-perlinterp=dynamic --disable-tclinterp --with-x=no --enable-gui=no --enable-multibyte --enable-cscope --with-tlib=ncurses --enable-fips-warning --enable-netbeans --enable-rubyinterp=dynamic --enable-luainterp=dynamic --disable-canberra"
else
CONFOPT="--build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-features=huge --enable-python3interp=dynamic --enable-perlinterp=dynamic --disable-tclinterp --with-x=no --enable-gui=no --enable-multibyte --enable-cscope --with-tlib=ncurses --enable-fips-warning --enable-netbeans --enable-rubyinterp=dynamic --enable-luainterp=dynamic --enable-libsodium --disable-canberra"
fi
_Cleanup_Phase() {
rlPhaseStartCleanup
kill $XVFB_PID
rlFileRestore
rlRun "popd"
rlRun "userdel -frZ $TESTER" 0 "Removing user $TESTER"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
}
rlJournalStart
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rlPhaseStartSetup Setup
rlAssertRpm $PACKAGE
rlFileBackup /etc/vimrc
rlRun "rm -f /etc/vimrc" 0 "Remove system wide vimrc, breaks the test suite"
if rlIsFedora
then
rlRun "dnf -y install libsodium-devel"
fi
# prepare the user account
rlRun "useradd $TESTER" 0 "Creating user $TESTER"
# we cannot use /tmp here, because Test_write_backup_symlink() from test_writefile.vim fails because of that.
# It happens because the test expects there is a backup file created, but it isn't
# because the default Vim settings for skipping doing backup in certain directories is
# /tmp/*, so our scope where we run the test matches the wildcard, giving us the test
# failure.
rlRun "TmpDir=\"/var/tmp/vim-upstream-scripttests-$(echo $RANDOM)\"" 0 "Creating tmp directory name"
rlRun "mkdir $TmpDir" 0 "Create the temp dir"
rlRun "pushd $TmpDir"
# extract the test suite
rlRun "rlFetchSrcForInstalled $PACKAGE" 0 "Fetching the source rpm"
rlRun "rpm --define '_topdir $TmpDir' -i *src.rpm" 0 "Installing the source rpm"
rlRun "mkdir BUILD" 0 "Creating BUILD directory"
rlRun "rpmbuild --nodeps --define '_topdir $TmpDir' -bp $TmpDir/SPECS/*spec" \
0 "Preparing sources"
rlRun "cd BUILD/vim*"
rlRun "chown -R $TESTER.$TESTER $TmpDir" 0 "Setting permissions"
rlRun "export LANG=en_US.UTF-8" 0 "Setting \$LANG to US locale"
# need to get ruby CFLAGS, because configure script fails otherwise - Vim configure script
# drags in ruby LDFLAGS, but not its CFLAGS
rlRun "RUBY_CFLAGS='`ruby -r rbconfig -e "puts RbConfig::CONFIG['CFLAGS']"`'" 0 "Get ruby CFLAGS"
rlRun "export CFLAGS='$RUBY_CFLAGS'" 0 "Set ruby CFLAGS"
# show relevant info & ENV variables
rlLog "TEST: $TEST"
rlLog "CONFOPT: $CONFOPT"
rlLog "TERM (default): $TERM"
rlLog "TERM (testing): $TERM_type"
rlRun -l "vim --version"
rlPhaseEnd
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# untested properly - because it wasn't needed yet
[ "$SET_XVFB" = "YES" ] && {
rlPhaseStartSetup "Setup virtual framebuffer - Xvfb"
# alternative: 'xvfb-run -w 10 make TARGET'
# note: upstream CI test-run example: https://travis-ci.org/vim/vim/jobs/561452534
rlRun "Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &"
XVFB_PID=$!
sleep 10
rlRun "export DISPLAY=99.0"
rlRun "modinfo snd-dummy"
rlRun "modprobe snd-dummy"
rlRun "usermod -a -G audio $TESTER"
rlPhaseEnd
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rlPhaseStartTest Testing "Testing: make $TEST"
# important: beaker defaults to vt100, which is not enough for some tests!
rlRun "TERM=$TERM_type"
# following block of code is taken from upstream travis.yml
rlRun "su $TESTER -c './configure ${CONFOPT} CFLAGS=\"${CFLAGS} $RUBY_FLAGS\"'" 0 "Configure Vim"
rlRun "su $TESTER -c 'make'" 0 "Build the binary which we substitute"
rlRun "su $TESTER -c 'ln -sf /usr/bin/vim src/vim'" 0 "Create symlink to installed vim for testing"
rlRun "su $TESTER -c 'make ${TEST} |& tee output_main'" 0,2 "Run tests (skip builtin terminal errors)"
_res_=$?
# final checks
if grep -iq "No rule to make target.*${TEST}" output_main; then
rlLogError "This version of Vim doesn't include tests for target '$TEST'"
elif [ $_res_ -eq 0 ]; then
rlPass "Test run finished smoothly: no errors!"
rlIsRHEL '>7' && rlRun "grep 'ALL DONE' output_main"
else
rlFail "Something went wrong!"
fi
rlAssertNotGrep "TEST FAILURE" output_main
rlFileSubmit "output_main"
rlPhaseEnd
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_Cleanup_Phase
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rlJournalPrintText
rlJournalEnd

View file

@ -119,8 +119,7 @@ rlJournalStart
rlLog "$shell: Running /usr/bin/vim under sudo"
rlRun "sudo $shell -c \"/usr/bin/vim --version\"" $ERRNO "SUDO: vim is missing, the command will fail"
rlRun "dnf -y install $VIM_PACKAGE" 0 "Install vim"
rlRun "dnf -y install $VIM_PACKAGE" 0 "Install vim"
done
rlPhaseEnd