run-basic-rails-application: fix tests for Fedora
Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
This commit is contained in:
parent
d51d7fc445
commit
1511ce41c4
2 changed files with 9 additions and 8 deletions
|
|
@ -54,7 +54,7 @@ $(METADATA): Makefile
|
|||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 60m" >> $(METADATA)
|
||||
@echo "RunFor: rubygem-rails ruby" >> $(METADATA)
|
||||
@echo "Requires: rubygems rubygem-rails ruby-devel sqlite-devel libxml2-devel libxslt-devel gcc-c++ net-tools" >> $(METADATA)
|
||||
@echo "Requires: rubygems rubygem-rails ruby-devel sqlite-devel libxml2-devel libxslt-devel gcc-c++ net-tools procps-ng" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
# Include Beaker environment
|
||||
[ -e /usr/bin/rhts-environment.sh ] && . /usr/bin/rhts-environment.sh
|
||||
. /usr/lib/beakerlib/beakerlib.sh
|
||||
. /usr/share/beakerlib/beakerlib.sh
|
||||
|
||||
PACKAGES=${PACKAGES:-ruby rubygems}
|
||||
PACKAGES=${PACKAGES:-ruby rubygems rubypick}
|
||||
REQUIRES=${REQUIRES:-}
|
||||
RUBY=${RUBY:-ruby}
|
||||
RAILS=0
|
||||
|
|
@ -39,7 +39,7 @@ ARCH=$(uname -m)
|
|||
RAILSVER=""
|
||||
|
||||
# if in collection get gem dependencies locally not from rubygems.org
|
||||
[ ! -z "$COLLECTIONS" ] && bundle="--local"
|
||||
[ -n "$COLLECTIONS" ] && bundle="--local"
|
||||
|
||||
# version of Ruby on RHEL7 needs older version of rails
|
||||
if rlIsRHEL 7; then RAILSVER="-v 4.2.7"; NOKOVER="-v 1.6.8"; fi
|
||||
|
|
@ -51,7 +51,9 @@ rlJournalStart
|
|||
rlAssertBinaryOrigin "gem"
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
if ! gem list "^rails \(*\)$" -i
|
||||
|
||||
# install rails and nokogiri from gem if not found in installation
|
||||
if ! gem list "^rails *$" -i
|
||||
then
|
||||
# nokogiri gem installed with rails needs to use system libraries
|
||||
# on arm and ppcle otherwise it fails with bundled libraries
|
||||
|
|
@ -76,7 +78,7 @@ rlJournalStart
|
|||
rlRun "echo \"gem 'therubyracer'\" >> Gemfile" 0 "Adding therubyracer gem into Gemfile"
|
||||
fi
|
||||
|
||||
if [ -z "$COLLECTIONS" ]
|
||||
if [ -z "$COLLECTIONS" ] && rlIsRHEL '<=7'
|
||||
then
|
||||
rlRun "echo \"gem 'nokogiri', '1.6.8'\" >> Gemfile" 0 "Adding nokogiri gem into Gemfile"
|
||||
sed -i "s/gem 'spring'/#gem 'spring'/" Gemfile
|
||||
|
|
@ -88,8 +90,7 @@ rlJournalStart
|
|||
rlRun "rails server &" 0 "Running rails server"
|
||||
sleep 10
|
||||
rlRun "wget http://0.0.0.0:3000" 0 "Wgetting running rails application"
|
||||
PID=`pidof ruby`
|
||||
rlRun "kill -9 $PID" 0 "Killing rails server"
|
||||
rlRun "pkill puma" 0 "Killing rails server"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue