From 071ea4dbcd8a04e9c962db483c18934ff09c9272 Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Mar 26 2020 09:11:29 +0000 Subject: Add a new test checking the command substitution --- diff --git a/substitution/main.fmf b/substitution/main.fmf new file mode 100644 index 0000000..6b18baf --- /dev/null +++ b/substitution/main.fmf @@ -0,0 +1,4 @@ +summary: Verify correct $$ parsing in command substitution +description: | + Parsing commands break when using $$ in command substitution $(..). + Test for https://bugzilla.redhat.com/show_bug.cgi?id=1727952 diff --git a/substitution/runtest.sh b/substitution/runtest.sh new file mode 100755 index 0000000..b56c6d5 --- /dev/null +++ b/substitution/runtest.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Author: Karel Volný +# 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 + +PACKAGES=${PACKAGES:-bash} + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm --all + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "touch testfile" 0 "Creating the test file" + rlRun -s "A=\$(awk -v p=\$\$ '{print \$0}'