eidastest changes

This commit is contained in:
Maria Haider 2021-05-27 16:19:33 +02:00
parent 7397686e81
commit 04b9824b7f
Signed by: mariah
GPG key ID: 7414A760CA747E57
4 changed files with 31 additions and 27 deletions

View file

@ -1,18 +1,18 @@
---
eidastest_compose:
version: "3"
version: "3.7"
services:
chrome:
image: selenium/standalone-chrome:3.141.59-20200719
container_name: standalone-chrome
firefox:
image: selenium/standalone-firefox:3.141.59-20210422
container_name: standalone-firefox
volumes:
- /dev/shm:/dev/shm
- ./supervise_chrome_processes.sh:/scripts/supervise_chrome_processes.sh
- ./supervise_firefox_processes.sh:/scripts/supervise_firefox_processes.sh
ports:
- "4444:4444"
- "4445:4444"
environment:
- DBUS_SESSION_BUS_ADDRESS=/dev/null
- START_XVFB=false
- DBUS_SESSION_BUS_ADDRESS=/dev/null
- NODE_MAX_SESSION=4
- NODE_MAX_INSTANCES=4
logging:
@ -20,7 +20,7 @@ eidastest_compose:
restart: on-failure
eidastest-testid:
image: docker.sunet.se/eidastest-testid:2.0.6
image: docker.sunet.se/eidastest-testid:2.0.7
container_name: eidastest-testid
ports:
- "443:8099"
@ -30,14 +30,14 @@ eidastest_compose:
- "/etc/ssl:/etc/ssl"
- /dev/shm:/dev/shm
depends_on:
- chrome
- firefox
restart: on-failure
scheduler1:
image: mcuadros/ofelia:latest
container_name: supvervising_standalone-chrome
container_name: supvervising_standalone-firefox
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./config.ini:/etc/ofelia/config.ini
depends_on:
- chrome
- firefox

View file

@ -450,8 +450,8 @@ class eidastest($version="1.0.0", $hostname="locahost") {
group => 'root',
mode => '0755',
}
file { "${home}/eidastest/supervise_chrome_processes.sh":
content => template('eid/eidastest/supervise_chrome_processes.sh.erb'),
file { "${home}/eidastest/supervise_firefox_processes.sh":
content => template('eid/eidastest/supervise_firefox_processes.sh.erb'),
owner => 'root',
group => 'root',
mode => '0755',

View file

@ -1,14 +0,0 @@
#!/bin/sh
# Script used for kill of hanging chrome processes
echo ""
if [ $(ps -ef | grep chrome/chrome -c) -gt 15 ]
then
echo "Number of chrome processes are more than 15(" $(ps -ef | grep chrome/chrome -c) "), killing all chrome processes!"
$(pkill chrome)
echo "Number of chrome processes after kill: " $(ps -ef | grep chrome/chrome -c)
else
echo "Number of chrome processes are less than 15(" $(ps -ef | grep chrome/chrome -c) "), no action taken"
fi
echo ""

View file

@ -0,0 +1,18 @@
#!/bin/sh
# Script used for kill of hanging firefox processes
echo ""
if [ $(ps -ef | grep firefox -c) -gt 15 ]
then
echo "Number of firefox processes are more than 15(" $(ps -ef | grep firefox -c) "), killing all processes!"
sleep 2
$(pkill firefox)
sleep 2
$(pkill geckodriver)
sleep 2
echo "Number of firefox processes are now: " $(ps -ef | grep firefox -c)
else
echo "Number of firefox processes are less than 15(" $(ps -ef | grep firefox -c) "), no action taken"
fi
echo ""