mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Use check_process' path value
This commit is contained in:
parent
57e7ad899b
commit
3b0fcbbfe2
5 changed files with 6 additions and 141 deletions
|
@ -726,6 +726,10 @@ then # Si le fichier check_process est trouvé
|
|||
fi
|
||||
if echo "$LIGNE" | grep -q "(PATH)"; then # Path dans le manifest
|
||||
MANIFEST_PATH=$(echo "$LIGNE" | cut -d '=' -f1) # Récupère la clé du manifest correspondant au path
|
||||
parse_path=$(echo "$LIGNE" | cut -d '"' -f2) # Lit le path du check_process
|
||||
if [ -n "$parse_path" ]; then # Si le path n'est pas null, utilise ce path au lieu de la valeur par défaut.
|
||||
PATH_TEST=$(echo "$LIGNE" | cut -d '"' -f2)
|
||||
fi
|
||||
LIGNE=$(echo "$LIGNE" | cut -d '(' -f1) # Retire l'indicateur de clé de manifest à la fin de la ligne
|
||||
fi
|
||||
if echo "$LIGNE" | grep -q "(USER)"; then # User dans le manifest
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Boucle de test pour partir à la chasse au bug #654 (https://dev.yunohost.org/issues/654)
|
||||
|
||||
# Donner en argument le package à tester
|
||||
# Un ctrl+C est nécessaire pour stopper la boucle!
|
||||
# Sur un second terminal, tail -f package_check/patch_#654.log pour récupérer les erreurs
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "Le script prend en argument le package à tester."
|
||||
exit 1
|
||||
fi
|
||||
if [ "$#" -gt 1 ]; then
|
||||
echo "Le script prend un seul argument."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Récupère le dossier du script
|
||||
if [ "${0:0:1}" == "/" ]; then script_dir="$(dirname "$0")"; else script_dir="$(echo $PWD/$(dirname "$0" | cut -d '.' -f2) | sed 's@/$@@')"; fi
|
||||
|
||||
sudo rm "$script_dir/../pcheck.lock" # Retire le lock
|
||||
touch "$script_dir/../patch_#654.log"
|
||||
|
||||
while (true) # Boucle infinie...
|
||||
do
|
||||
"$script_dir/../package_check.sh" --bash-mode "$1"
|
||||
# "$script_dir/../package_check.sh" --bash-mode --no_lxc "$1"
|
||||
done
|
|
@ -1,73 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Boucle de test pour partir à la chasse au bug #654 (https://dev.yunohost.org/issues/654)
|
||||
|
||||
# Un ctrl+C est nécessaire pour stopper la boucle!
|
||||
|
||||
# !!!!!! Attention, ce script doit tourner dans une VM exclusivement !!!!!!
|
||||
|
||||
APP="my_webapp_ynh"
|
||||
APPID=multi_webapp
|
||||
MANIFEST_ARGS_MOD="domain=crudelis-test4.fr&path=/site&admin=mcrudelis&sql=No&is_public=Yes"
|
||||
|
||||
# Récupère le dossier du script
|
||||
if [ "${0:0:1}" == "/" ]; then script_dir="$(dirname "$0")"; else script_dir="$(echo $PWD/$(dirname "$0" | cut -d '.' -f2) | sed 's@/$@@')"; fi
|
||||
|
||||
patchlog="$script_dir/temppatchlog654"
|
||||
patch654="$script_dir/patch_#654_pcheckless.log"
|
||||
COMPLETE_LOG="/var/log/yunohost/yunohost-cli.log"
|
||||
|
||||
touch "$patch654"
|
||||
lprogress=$(sudo wc -l "$COMPLETE_LOG" | cut -d ' ' -f 1) # Compte le nombre de ligne du log complet
|
||||
|
||||
PATCH_654 () {
|
||||
sudo tail -n +$lprogress "$COMPLETE_LOG" > "$patchlog" # Copie le fichier de log à partir de la dernière ligne du log préexistant
|
||||
lprogress=$(sudo wc -l "$COMPLETE_LOG" | cut -d ' ' -f 1) # Compte le nombre de ligne du log complet
|
||||
lprogress=$(( $lprogress + 1 )) # Ignore la première ligne, reprise de l'ancien log.
|
||||
|
||||
bug=0
|
||||
|
||||
if grep -q "L'exécution du script .* ne s'est pas terminée" "$patchlog"; then
|
||||
bug=1
|
||||
elif grep -q "Script execution hasn’t terminated:" "$patchlog"; then
|
||||
bug=1
|
||||
elif grep -q "La ejecución del script no ha terminado:" "$patchlog"; then
|
||||
bug=1
|
||||
elif grep -q "Skriptausführung noch nicht beendet" "$patchlog"; then
|
||||
bug=1
|
||||
fi
|
||||
if [ "$bug" -eq 1 ]
|
||||
then
|
||||
echo -e "\e[91m\n!! Bug 654 détecté !!\n\e[0m"
|
||||
echo -e "$(date)\nBug 654\n" >> "$patch654" # Patch #654
|
||||
fi
|
||||
}
|
||||
|
||||
while (true) # Boucle infinie...
|
||||
do
|
||||
echo "Installation"
|
||||
sudo yunohost --debug app install "$APP" -a "$MANIFEST_ARGS_MOD" > /dev/null
|
||||
PATCH_654
|
||||
echo "Remove"
|
||||
sudo yunohost --debug app remove $APPID > /dev/null
|
||||
PATCH_654
|
||||
echo "Réinstallation"
|
||||
sudo yunohost --debug app install "$APP" -a "$MANIFEST_ARGS_MOD" > /dev/null
|
||||
PATCH_654
|
||||
echo "Upgrade"
|
||||
sudo yunohost --debug app upgrade $APPID -f "$APP" > /dev/null
|
||||
PATCH_654
|
||||
echo "Backup"
|
||||
sudo yunohost backup delete Backup_test
|
||||
sudo yunohost --debug backup create -n Backup_test --apps $APPID --hooks conf_ssowat data_home conf_ynh_firewall conf_cron > /dev/null
|
||||
PATCH_654
|
||||
echo "Remove"
|
||||
sudo yunohost --debug app remove $APPID > /dev/null
|
||||
PATCH_654
|
||||
echo "Restore"
|
||||
sudo yunohost --debug backup restore Backup_test --force --apps $APPID > /dev/null
|
||||
PATCH_654
|
||||
echo "Remove"
|
||||
sudo yunohost --debug app remove $APPID > /dev/null
|
||||
PATCH_654
|
||||
done
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Ce patch détecte l'erreur "L'exécution du script ne s'est pas terminée", Bug #654 (https://dev.yunohost.org/issues/654)
|
||||
# Il permet, en cas d'erreur, de relancer le test qui vient d'échouer.
|
||||
# En attendant de trouver la source de cette erreur, ce patch permet de soulager les tests de CI qui virent irrémédiablement au rouge en raison de la forte fréquence de ce bug.
|
||||
|
||||
patchlog="$script_dir/temppatchlog654"
|
||||
|
||||
export lprogress=0
|
||||
|
||||
PATCH_654 () {
|
||||
sudo tail -n +$lprogress "$COMPLETE_LOG" > "$patchlog" # Copie le fichier de log à partir de la dernière ligne du log préexistant
|
||||
lprogress=$(sudo wc -l "$COMPLETE_LOG" | cut -d ' ' -f 1) # Compte le nombre de ligne du log complet
|
||||
lprogress=$(( $lprogress + 1 )) # Ignore la première ligne, reprise de l'ancien log.
|
||||
|
||||
if grep -q "L'exécution du script .* ne s'est pas terminée" "$patchlog"; then
|
||||
return 1
|
||||
elif grep -q "Script execution hasn’t terminated:" "$patchlog"; then
|
||||
return 1
|
||||
elif grep -q "La ejecución del script no ha terminado:" "$patchlog"; then
|
||||
return 1
|
||||
elif grep -q "Skriptausführung noch nicht beendet" "$patchlog"; then
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
|
@ -928,23 +928,11 @@ TEST_LAUNCHER () {
|
|||
# $1 prend le nom de la fonction à démarrer.
|
||||
# $2 prend l'argument de la fonction, le cas échéant
|
||||
# Ce launcher permet de factoriser le code autour du lancement des fonctions de test
|
||||
# BUG654=1 # Patch #654
|
||||
# while [ "$BUG654" -eq "1" ]; do # Patch #654
|
||||
$1 $2 # Exécute le test demandé, avec son éventuel argument
|
||||
LXC_STOP # Arrête le conteneur LXC
|
||||
# PATCH_654 # Patch #654
|
||||
# BUG654=$? # Patch #654
|
||||
# if [ "$BUG654" -eq "1" ]; then # Patch #654
|
||||
# ECHO_FORMAT "\n!! Bug 654 détecté !!\n" "red" clog # Patch #654
|
||||
# echo -e "date\nBug 654 sur $1 $2\n\n" >> "$script_dir/patch_#654.log" # Patch #654
|
||||
# cur_test=$((cur_test-1))
|
||||
# tnote=$((tnote-1))
|
||||
# fi # Patch #654
|
||||
# done # Patch #654
|
||||
$1 $2 # Exécute le test demandé, avec son éventuel argument
|
||||
LXC_STOP # Arrête le conteneur LXC
|
||||
}
|
||||
|
||||
TESTING_PROCESS () {
|
||||
# source "$script_dir/sub_scripts/patch_#654.sh" # Patch #654
|
||||
# Lancement des tests
|
||||
cur_test=1
|
||||
ECHO_FORMAT "\nScénario de test: $PROCESS_NAME\n" "white" "underlined" clog
|
||||
|
|
Loading…
Add table
Reference in a new issue