diff --git a/README.md b/README.md index d5ab4ee..984273f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Le script est capable d'effectuer les tests suivant: - Test de path mal formé (path/ au lieu de /path) - Test de port déjà utilisé -Par défaut, Package checker utilise un conteneur LXC pour créer un environnement de test propre sans résidus d'installations précédentes. Ce comportement peut être contourné avec le paramètre --no-lxc +Par défaut, Package check utilise un conteneur LXC pour créer un environnement de test propre sans résidus d'installations précédentes. Ce comportement peut être contourné avec le paramètre --no-lxc > ATTENTION: Si LXC n'est pas utilisé, le script devrait être utilisé uniquement dans un environnement de test dédié, jamais sur un serveur en production. Il va provoquer de nombreuses erreurs d'installation du package et pourrait donc laisser des résidus indésirables. Usage: @@ -35,7 +35,6 @@ Si ce fichier n'est pas présent, package_check sera utilisé en mode dégradé. --- ## Syntaxe du fichier `check_process` > A l'exception des espaces, la syntaxe du fichier doit être scrupuleusement respectée. -> L'ordre des lignes n'a toutefois pas d'importance. ``` ;; Nom du test @@ -108,16 +107,18 @@ Si un test est absent de la liste, il sera ignoré. Cela revient à le noter à - `final_path_already_use`: *Non implémenté pour le moment...* --- -Le script `package_check.sh` accepte 3 arguments en plus du package à tester. +Le script `package_check.sh` accepte 5 arguments en plus du package à tester. - `--bash-mode`: Rend le script autonome. Aucune intervention de l'utilisateur ne sera nécessaire. La valeur de auto_remove est ignorée. (Incompatible avec --build-lxc) - `--no-lxc`: N'utilise pas la virtualisation en conteneur LXC. Les tests seront effectué directement sur la machine hôte. - `--build-lxc`: Installe LXC et créer le conteneur debian Yunohost si nécessaire. (Incompatible avec --bash-mode) +- `--force-install-ok`: Force la réussite des installations, même si elles échouent. Permet d'effectuer les tests qui suivent même si l'installation a échouée. +- `--help`: Affiche l'aide du script --- ## LXC -Package checker utilise la virtualisation en conteneur pour assurer l'intégrité de l'environnement de test. +Package check utilise la virtualisation en conteneur pour assurer l'intégrité de l'environnement de test. L'usage de LXC apporte une meilleure stabilité au processus de test, un test de suppression échoué n'entraine pas l'échec des tests suivant, et permet de garder un environnement de test sans résidus de test précédents. En revanche, l'usage de LXC augmente la durée des tests, en raison des manipulations du conteneur et de la réinstallation systématique des dépendances de l'application. Il faut prévoir également un espace suffisant sur l'hôte, au minimum 4Go pour le conteneur, son snapshot et sa copie de sauvegarde. @@ -128,3 +129,133 @@ L'usage de LXC est facilité par 3 scripts, permettant de gérer la création, l L'accès ssh par défaut est `ssh -t pchecker_lxc` - `lxc_upgrade.sh`: Effectue la mise à jour du conteneur à l'aide d'apt-get et recréer le snapshot. - `lxc_remove.sh`: Supprime le conteneur LXC, son snapshot et sa sauvegarde. Désinstalle LXC et déconfigure le réseau associé. + +--- +--- + +Set of unit tests for check Yunohost packages. +The `package_check.sh` script perform a series of tests on a package for check its capability to install and remove in différents cases. +The tests results are print directly in the terminal and stored in the log file Test_results.log + +The script is able to perform following tests: +- Check the package with [package linter](https://github.com/YunoHost/package_linter) +- Installation in a subdir +- Installation at root of domain +- Installation without url access (For apps without web UI) +- Private installation. +- Public installation +- Upgrade on same package version +- Backup then restore +- Multi-instances installation +- Test with wrong user +- Test with wrong domain +- Test malformed path (path/ instead od /path) +- Test port already use + +As default, package_check script use an LXC container to manipulate the package in a non parasited environnement by previous installs. This behavior can be overriden with --no-lxc parameter. +> BE CAREFUL, If LXC is not used, this script should be used only in a dedicated test environnement, never on a prod server. It will causes many installations errors and risk to leave residues. + +Usage: +For an app in a dir: `./package_check.sh APP_ynh` +For an app on github: `./package_check.sh https://github.com/USER/APP_ynh` + +It's necessary to provide, at the root of package to be tested, a `check_process` file for inform the script of needed arguments and tests to perform. +If this file is not present, package_check will be used in downgraded mode. It try to retrieve domain, path and admin user arguments in the manifest for execute some tests, based on arguments found. + +--- +## Syntax `check_process` file +> Except space, this file syntax must be respected. + +``` +;; Test name + auto_remove=1 +# Comment ignore + ; Manifest + domain="$DOMAIN" (DOMAIN) + path="$PATH" (PATH) + admin="$USER" (USER) + language="en" + is_public="Yes" (PUBLIC|public=Yes|private=No) + password="$PASSWORD" (PASSWORD) + port="666" (PORT) + ; Checks + pkg_linter=1 + setup_sub_dir=1 + setup_root=1 + setup_nourl=0 + setup_private=1 + setup_public=1 + upgrade=1 + backup_restore=1 + multi_instance=1 + wrong_user=1 + wrong_path=1 + incorrect_path=1 + corrupt_source=0 + fail_download_source=0 + port_already_use=1 (XXXX) + final_path_already_use=0 +``` +### `;; Test name` +Name of tests series that will be perform. +It's possible to create multiples tests series, all with the same syntax. +All different tests series will be perform sequentialy. + +### `auto_remove` +If `auto_remove` is at 0, the script pause before each deleting of app. To lets you check manually if necessary. +Otherwise, the app is automaticaly removed and tests continue. + +### `; Manifest` +Set of manifest keys. +All manifest keys need to be filled to perform installation. +> The manifest keys filled here are simply an exemple. Check the app's manifest. +Some manifest keys are necessary for the script to performs some tests. This keys must be highlighted for the script is able to find them and modify their values. +`(DOMAIN)`, `(PATH)`, `(USER)`, `(PASSWORD)` and `(PORT)` must be placed at the end of corresponding key. This key will be changed by the script. +`(PUBLIC|public=Yes|private=No)` must, in addition to match the public key, indicate the values for public and private. + +### `; Checks` +Set of tests to perform. +Each test marked à 1 will be perform by the script. +If a test is not in the list, it will be ignored. It's similar to marked at 0. +- `pkg_linter`: Check the package with [package linter](https://github.com/YunoHost/package_linter) +- `setup_sub_dir`: Installation in the path /check. +- `setup_root`: Installation at the root of domain. +- `setup_nourl`: Installation without http access. This test should be perform only for apps that not have web interface. +- `setup_private`: Private installation. +- `setup_public`: Public installation. +- `upgrade`: Upgrade package on same version. Only test the upgrade script. +- `backup_restore`: Backup then restore. +- `multi_instance`: Installing the application 3 times to verify its ability to be multi-instance. The 2nd and 3rd respectively installs are adding a suffix then prefix path. +- `wrong_user`: Causes an errror with a wrong user name. +- `wrong_path`: Causes an error with a wrong domain. +- `incorrect_path`: Causes an arror with a malformed path, path/. +- `corrupt_source`: *Not implemented yet...* +- `fail_download_source`: *Not implemented yet...* +- `port_already_use`: Causes an error on the port by opening before. + The `port_already_use` test may eventually take in argument the port number. + The port number must be written into parentheses, it will serve to test port. +- `final_path_already_use`: *Not implemented yet...* + +--- +The `package_check.sh` script accept 5 arguments in addition of package to be checked. +- `--bash-mode`: The script will work without user intervention. + auto_remove value is ignored (Not compatible with --build-lxc) +- `--no-lxc`: Not use virtualization with LXC container. All tests will perform directly on the hosts machine. +- `--build-lxc`: Install LXC and create the Debian Yunohost container if necessary. (Not compatible with --bash-mode) +- `--force-install-ok`: Force success of installation, even if they fail. Allow to perform following tests even if installation fail. +- `--help`: Display help. + +--- +## LXC + +Package check use virtualization in container for ensure integrity of test environnement. +Using LXC provides better stability to test process, a failed remove test doesn't failed the following tests and provides a test environnement without residues of previous tests. However, using LXC increases the durations of tests, because of the manipulations of container and installed app dépendancies. + +There must also be enough space on the host, at least 4GB for the container, its snapshot and backup. + +Using LXC is simplified by 3 scripts, allowing to manage the creation, updating and deleting. +- `lxc_build.sh`: lxc_build install LXC and its dependencies, then create a Debian container. + It add network support, install Yunohost and configure it. And then configure ssh. + The default ssh access is `ssh -t pchecker_lxc` +- `lxc_upgrade.sh`: Perform a upgrade of the container with apt-get and recreate the snapshot. +- `lxc_remove.sh`: Delete the LXC container, its snapshot and backup. Uninstall LXC and deconfigures the associated network. diff --git a/package_check.sh b/package_check.sh index 7cb30d3..c7a29a3 100755 --- a/package_check.sh +++ b/package_check.sh @@ -3,7 +3,9 @@ # Arguments du script # --bash-mode Mode bash, le script est autonome. Il ignore la valeur de $auto_remove # --no-lxc N'utilise pas la virtualisation en conteneur lxc. La virtualisation est utilisée par défaut si disponible. -# --build-lxc Installe lxc et créer la machine si nécessaire. Incompatible avec -b en raison de la connexion ssh à valider lors du build. +# --build-lxc Installe lxc et créer la machine si nécessaire. Incompatible avec --bash-mode en raison de la connexion ssh à valider lors du build. +# --force-install-ok Force la réussite des installations, même si elles échouent. Permet d'effectuer les tests qui suivent même si l'installation a échouée. +# --help Affiche l'aide du script echo "" @@ -59,10 +61,11 @@ else # Si le fichier de version n'existe pas, il est créé. fi echo "$version_plinter" > "$script_dir/plinter_version" +notice=0 if [ "$#" -eq 0 ] then echo "Le script prend en argument le package à tester." - exit 1 + notice=1 fi ## Récupère les arguments @@ -72,9 +75,26 @@ bash_mode=$(echo "$*" | grep -c -e "--bash-mode") # bash_mode vaut 1 si l'argume no_lxc=$(echo "$*" | grep -c -e "--no-lxc") # no_lxc vaut 1 si l'argument est présent. # --build-lxc build_lxc=$(echo "$*" | grep -c -e "--build-lxc") # build_lxc vaut 1 si l'argument est présent. -arg_app=$(echo "$*" | sed 's/--bash-mode\|--no-lxc\|--build-lxc//g' | sed 's/^ *\| *$//g') # Supprime les arguments déjà lu pour ne garder que l'app. Et supprime les espaces au début et à la fin +# --force-install-ok +force_install_ok=$(echo "$*" | grep -c -e "--force-install-ok") # force-install-ok vaut 1 si l'argument est présent. +# --help +if [ "$notice" -eq 0 ]; then + notice=$(echo "$*" | grep -c -e "--help") # notice vaut 1 si l'argument est présent. Il affichera alors l'aide. +fi +arg_app=$(echo "$*" | sed 's/--bash-mode\|--no-lxc\|--build-lxc\|--force-install-ok//g' | sed 's/^ *\| *$//g') # Supprime les arguments déjà lu pour ne garder que l'app. Et supprime les espaces au début et à la fin # echo "arg_app=$arg_app." +if [ "$notice" -eq 1 ]; then + echo -e "\nUsage:" + echo "package_check.sh [--bash-mode] [--no-lxc] [--build-lxc] [--force-install-ok] [--help] \"check package\"" + echo -e "\n\t--bash-mode\t\tDo not ask for continue check. Ignore auto_remove." + echo -e "\t--no-lxc\t\tDo not use a LXC container. You should use this option only on a test environnement." + echo -e "\t--build-lxc\t\tInstall LXC and build the container if necessary." + echo -e "\t--force-install-ok\tForce following test even if all install are failed." + echo -e "\t--help\t\t\tDisplay this notice." + exit 0 +fi + USER_TEST=package_checker PASSWORD_TEST=checker_pwd PATH_TEST=/check @@ -411,6 +431,7 @@ INIT_VAR() { note=0 tnote=0 all_test=0 + use_curl=0 MANIFEST_DOMAIN="null" MANIFEST_PATH="null" diff --git a/sub_scripts/lxc_launcher.sh b/sub_scripts/lxc_launcher.sh index c3e5b46..1ccd26d 100755 --- a/sub_scripts/lxc_launcher.sh +++ b/sub_scripts/lxc_launcher.sh @@ -43,8 +43,7 @@ LXC_START () { sudo cat "/var/lib/lxc/$LXC_NAME/rootfs/home/pchecker/debug_output.log" >> "$OUTPUTD" # Récupère le contenu du OUTPUTD distant pour le réinjecter dans le local return "$?" else # Sinon exécute la commande directement. - command=$(echo "$1" | sed "s@\"@@g") # Remplace les guillemets doubles par des simples - $command > /dev/null 2>> "$OUTPUTD" + eval "$1" > /dev/null 2>> "$OUTPUTD" fi } diff --git a/sub_scripts/testing_process.sh b/sub_scripts/testing_process.sh index 31b18d6..f0dd199 100644 --- a/sub_scripts/testing_process.sh +++ b/sub_scripts/testing_process.sh @@ -53,7 +53,10 @@ CHECK_URL () { ECHO_FORMAT "Code HTTP: $HTTP_CODE\n" "white" if [ "${HTTP_CODE:0:1}" == "0" ] || [ "${HTTP_CODE:0:1}" == "4" ] || [ "${HTTP_CODE:0:1}" == "5" ] then # Si le code d'erreur http est du type 0xx 4xx ou 5xx, c'est un code d'erreur. - curl_error=1 + if [ "${HTTP_CODE}" != "401" ] + then # Le code d'erreur 401 fait exception, si il y a 401 c'est en général l'application qui le renvoi. Donc l'install est bonne. + curl_error=1 + fi fi URL_TITLE=$(grep "" "$script_dir/url_output" | cut -d '>' -f 2 | cut -d '<' -f1) ECHO_FORMAT "Titre de la page: $URL_TITLE\n" "white" @@ -70,6 +73,7 @@ CHECK_URL () { sudo sed -i '/#package_check/d' /etc/hosts # Supprime la ligne dans le hosts else ECHO_FORMAT "Test de connexion annulé.\n" "white" + curl_error=0 fi } @@ -284,7 +288,7 @@ CHECK_UPGRADE () { # Test d'upgrade ECHO_FORMAT "\n\n>> Upgrade... [Test $cur_test/$all_test]\n" "white" "bold" clog cur_test=$((cur_test+1)) - if [ "$GLOBAL_CHECK_SETUP" -ne 1 ]; then + if [ "$GLOBAL_CHECK_SETUP" -ne 1 ] && [ "$force_install_ok" -ne 1 ]; then echo "L'installation a échouée, impossible d'effectuer ce test..." return; fi @@ -295,12 +299,12 @@ CHECK_UPGRADE () { if [ -n "$MANIFEST_PUBLIC" ] && [ -n "$MANIFEST_PUBLIC_public" ]; then # Si possible, install en public pour le test d'accès url MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s/$MANIFEST_PUBLIC=[a-Z]*\&/$MANIFEST_PUBLIC=$MANIFEST_PUBLIC_public\&/") fi - if [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Utilise ce mode d'installation - MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") - CHECK_PATH="$PATH_TEST" - elif [ "$GLOBAL_CHECK_ROOT" -eq 1 ]; then # Sinon utilise une install root, si elle a fonctionné + if [ "$GLOBAL_CHECK_ROOT" -eq 1 ]; then # Utilise une install root, si elle a fonctionné MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=/\&@") CHECK_PATH="/" + elif [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ] || [ "$force_install_ok" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Ou si l'argument force_install_ok est présent. Utilise ce mode d'installation + MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") + CHECK_PATH="$PATH_TEST" else echo "Aucun mode d'installation n'a fonctionné, impossible d'effectuer ce test..." return; @@ -338,7 +342,7 @@ CHECK_BACKUP_RESTORE () { # Test de backup ECHO_FORMAT "\n\n>> Backup/Restore... [Test $cur_test/$all_test]\n" "white" "bold" clog cur_test=$((cur_test+1)) - if [ "$GLOBAL_CHECK_SETUP" -ne 1 ]; then + if [ "$GLOBAL_CHECK_SETUP" -ne 1 ] && [ "$force_install_ok" -ne 1 ]; then echo "L'installation a échouée, impossible d'effectuer ce test..." fi MANIFEST_ARGS_MOD=$MANIFEST_ARGS # Copie des arguments @@ -348,12 +352,12 @@ CHECK_BACKUP_RESTORE () { if [ -n "$MANIFEST_PUBLIC" ] && [ -n "$MANIFEST_PUBLIC_public" ]; then # Si possible, install en public pour le test d'accès url MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s/$MANIFEST_PUBLIC=[a-Z]*\&/$MANIFEST_PUBLIC=$MANIFEST_PUBLIC_public\&/") fi - if [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Utilise ce mode d'installation - MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") - CHECK_PATH="$PATH_TEST" - elif [ "$GLOBAL_CHECK_ROOT" -eq 1 ]; then # Sinon utilise une install root, si elle a fonctionné + if [ "$GLOBAL_CHECK_ROOT" -eq 1 ]; then # Utilise une install root, si elle a fonctionné MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=/\&@") CHECK_PATH="/" + elif [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ] || [ "$force_install_ok" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Ou si l'argument force_install_ok est présent. Utilise ce mode d'installation + MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") + CHECK_PATH="$PATH_TEST" else echo "Aucun mode d'installation n'a fonctionné, impossible d'effectuer ce test..." return; @@ -416,7 +420,7 @@ CHECK_PUBLIC_PRIVATE () { ECHO_FORMAT "\n\n>> Installation publique... [Test $cur_test/$all_test]\n" "white" "bold" clog fi cur_test=$((cur_test+1)) - if [ "$GLOBAL_CHECK_SETUP" -ne 1 ]; then + if [ "$GLOBAL_CHECK_SETUP" -ne 1 ] && [ "$force_install_ok" -ne 1 ]; then echo "L'installation a échouée, impossible d'effectuer ce test..." return fi @@ -443,12 +447,12 @@ CHECK_PUBLIC_PRIVATE () { if [ "$1" == "public" ]; then MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s/$MANIFEST_PUBLIC=[a-Z]*\&/$MANIFEST_PUBLIC=$MANIFEST_PUBLIC_public\&/") fi - if [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Utilise ce mode d'installation - MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") - CHECK_PATH="$PATH_TEST" - elif [ "$GLOBAL_CHECK_ROOT" -eq 1 ]; then # Sinon utilise une install root, si elle a fonctionné + if [ "$GLOBAL_CHECK_ROOT" -eq 1 ]; then # Utilise une install root, si elle a fonctionné MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=/\&@") CHECK_PATH="/" + elif [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ] || [ "$force_install_ok" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Ou si l'argument force_install_ok est présent. Utilise ce mode d'installation + MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") + CHECK_PATH="$PATH_TEST" else echo "Aucun mode d'installation n'a fonctionné, impossible d'effectuer ce test..." return; @@ -498,7 +502,7 @@ CHECK_MULTI_INSTANCE () { # Test d'installation en multi-instance ECHO_FORMAT "\n\n>> Installation multi-instance... [Test $cur_test/$all_test]\n" "white" "bold" clog cur_test=$((cur_test+1)) - if [ "$GLOBAL_CHECK_SETUP" -ne 1 ]; then + if [ "$GLOBAL_CHECK_SETUP" -ne 1 ] && [ "$force_install_ok" -ne 1 ]; then echo "L'installation a échouée, impossible d'effectuer ce test..." return fi @@ -509,7 +513,7 @@ CHECK_MULTI_INSTANCE () { if [ -n "$MANIFEST_PUBLIC" ] && [ -n "$MANIFEST_PUBLIC_public" ]; then # Si possible, install en public pour le test d'accès url MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s/$MANIFEST_PUBLIC=[a-Z]*\&/$MANIFEST_PUBLIC=$MANIFEST_PUBLIC_public\&/") fi - if [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Utilise ce mode d'installation + if [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ] || [ "$force_install_ok" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Ou si l'argument force_install_ok est présent. Utilise ce mode d'installation MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") else echo "L'installation en sous-dossier n'a pas fonctionné, impossible d'effectuer ce test..." @@ -594,7 +598,7 @@ CHECK_COMMON_ERROR () { fi fi cur_test=$((cur_test+1)) - if [ "$GLOBAL_CHECK_SETUP" -ne 1 ]; then + if [ "$GLOBAL_CHECK_SETUP" -ne 1 ] && [ "$force_install_ok" -ne 1 ]; then echo "L'installation a échouée, impossible d'effectuer ce test..." return fi @@ -613,13 +617,13 @@ CHECK_COMMON_ERROR () { if [ "$1" == "incorrect_path" ]; then # Force un path mal formé: Ce sera path/ au lieu de /path WRONG_PATH=${PATH_TEST#/}/ # Transforme le path de /path à path/ MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$WRONG_PATH\&@") + CHECK_PATH="$PATH_TEST" else - if [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Utilise ce mode d'installation - MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") - CHECK_PATH="$PATH_TEST" - elif [ "$GLOBAL_CHECK_ROOT" -eq 1 ]; then # Sinon utilise une install root, si elle a fonctionné + if [ "$GLOBAL_CHECK_ROOT" -eq 1 ]; then # Utilise une install root, si elle a fonctionné MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=/\&@") CHECK_PATH="/" + elif [ "$GLOBAL_CHECK_SUB_DIR" -eq 1 ] || [ "$force_install_ok" -eq 1 ]; then # Si l'install en sub_dir à fonctionné. Ou si l'argument force_install_ok est présent. Utilise ce mode d'installation + MANIFEST_ARGS_MOD=$(echo $MANIFEST_ARGS_MOD | sed "s@$MANIFEST_PATH=[a-Z/$]*\&@$MANIFEST_PATH=$PATH_TEST\&@") else echo "Aucun mode d'installation n'a fonctionné, impossible d'effectuer ce test..." return; @@ -722,7 +726,7 @@ CHECK_CORRUPT () { # Test d'erreur sur source corrompue ECHO_FORMAT "\n\n>> Source corrompue après téléchargement... [Test $cur_test/$all_test]\n" "white" "bold" clog cur_test=$((cur_test+1)) - if [ "$GLOBAL_CHECK_SETUP" -ne 1 ]; then + if [ "$GLOBAL_CHECK_SETUP" -ne 1 ] && [ "$force_install_ok" -ne 1 ]; then echo "L'installation a échouée, impossible d'effectuer ce test..." fi echo -n "Non implémenté" @@ -732,7 +736,7 @@ CHECK_DL () { # Test d'erreur de téléchargement de la source ECHO_FORMAT "\n\n>> Erreur de téléchargement de la source... [Test $cur_test/$all_test]\n" "white" "bold" clog cur_test=$((cur_test+1)) - if [ "$GLOBAL_CHECK_SETUP" -ne 1 ]; then + if [ "$GLOBAL_CHECK_SETUP" -ne 1 ] && [ "$force_install_ok" -ne 1 ]; then echo "L'installation a échouée, impossible d'effectuer ce test..." fi echo -n "Non implémenté" @@ -742,7 +746,7 @@ CHECK_FINALPATH () { # Test sur final path déjà utilisé. ECHO_FORMAT "\n\n>> Final path déjà utilisé... [Test $cur_test/$all_test]\n" "white" "bold" clog cur_test=$((cur_test+1)) - if [ "$GLOBAL_CHECK_SETUP" -ne 1 ]; then + if [ "$GLOBAL_CHECK_SETUP" -ne 1 ] && [ "$force_install_ok" -ne 1 ]; then echo "L'installation a échouée, impossible d'effectuer ce test..." fi echo -n "Non implémenté"