ruby/run-basic-rails-application/runtest.sh
Jun Aruga 8079e56b35 run-basic-rails-application: Remove a logic installing upstream rails gem.
Remove a logic installing upstream rails gem which is executed if Rails RPM is
not installed. The logic is for CentOS Stream where Rails RPM may not be
installed.

However, as there is the tests/ruby repository for CentOS Stream,[1] we don't
have to manage CentOS Stream specific logic in Fedora tests/ruby repository.

[1] https://gitlab.com/redhat/centos-stream/tests/ruby
2025-01-28 18:07:05 +01:00

62 lines
2.2 KiB
Bash
Executable file

#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/rubygem-rails/run-basic-rails-application
# Description: Test creates new rails application and runs it
# Author: Iveta Senfeldova <isenfeld@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
PACKAGES=${PACKAGES:-ruby rubygems rubypick}
REQUIRES=${REQUIRES:-}
RUBY=${RUBY:-ruby}
rlJournalStart
rlPhaseStartSetup
rlAssertRpm --all
rlAssertBinaryOrigin $RUBY
rlAssertBinaryOrigin "gem"
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "rails new app | tee bundle.log" 0 "Creating new rails application"
rlRun "pushd app/"
rlAssertExists "app"
rlRun "ss -tulpn | grep 3000" 1 "Check if port 3000 isn't engaged"
rlRun "rails server &" 0 "Running rails server"
sleep 10
rlRun "wget http://0.0.0.0:3000" 0 "Wgetting running rails application"
rlRun "pkill ruby" 0 "Killing rails server"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd; popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd