Moar fiksizes

This commit is contained in:
Alexandre Aubin 2020-12-18 04:54:42 +01:00
parent 5f2b74dbfc
commit 942531c3ff
3 changed files with 14 additions and 16 deletions

View file

@ -44,7 +44,7 @@ CREATE_LXC_SNAPSHOT () {
}
LOAD_LXC_SNAPSHOT () {
snapname=$1
local snapname=$1
log_debug "Loading snapshot $snapname ..."
sudo lxc stop --timeout 15 $LXC_NAME 2>/dev/null
sudo lxc restore $LXC_NAME $snapname

View file

@ -69,6 +69,7 @@ _LOAD_SNAPSHOT_OR_INSTALL_APP () {
if ! LXC_SNAPSHOT_EXISTS $snapname
then
log_warning "Expected to find an existing snapshot $snapname but it doesn't exist yet .. will attempt to create it"
LOAD_LXC_SNAPSHOT snap0 \
&&_INSTALL_APP "path=$check_path" \
&& log_debug "(Creating a snapshot for $_install_type installation.)" \
@ -314,14 +315,14 @@ _TEST_MULTI_INSTANCE () {
LOAD_LXC_SNAPSHOT snap0
log_small_title "First installation: path=$DOMAIN$check_path" \
log_small_title "First installation: path=$SUBDOMAIN$check_path" \
&& _LOAD_SNAPSHOT_OR_INSTALL_APP "$check_path" \
&& log_small_title "Second installation: path=$SUBDOMAIN$check_path" \
&& _INSTALL_APP "path=$check_path" \
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $DOMAIN $check_path \
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path "" ${app_id}__2 \
&& log_small_title "Second installation: path=$DOMAIN$check_path" \
&& _INSTALL_APP "domain=$DOMAIN" "path=$check_path" \
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path \
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $DOMAIN $check_path "" ${app_id}__2 \
&& _REMOVE_APP \
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path "" ${app_id}__2
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $DOMAIN $check_path "" ${app_id}__2
return $?
}
@ -471,9 +472,8 @@ TEST_BACKUP_RESTORE () {
# Place the copy of the backup archive in the container.
sudo lxc file push -r ./ynh_backups/archives/* $LXC_NAME/home/yunohost.backup/archives/
RUN_INSIDE_LXC ls -l /home/yunohost.backup/archives/
log_small_title "Restore on a clean YunoHost system..."
log_small_title "Restore on a fresh YunoHost system..."
fi
# Restore the application from the previous backup

View file

@ -59,7 +59,7 @@ parse_check_process() {
local commit
for commit in $(cat $TEST_CONTEXT/check_process.upgrade_options | grep "^; commit=.*" | awk -F= '{print $2}')
do
cat $TEST_CONTEXT/check_process.upgrade_options | sed -n -e "/^;; $commit/,/^;;/ p" | grep -v "^;;" > $TEST_CONTEXT/upgrades/$commit
cat $TEST_CONTEXT/check_process.upgrade_options | sed -n -e "/^; commit=$commit/,/^;/ p" | grep -v "^;;" > $TEST_CONTEXT/upgrades/$commit
done
rm $TEST_CONTEXT/check_process.upgrade_options
@ -108,10 +108,10 @@ parse_check_process() {
# Upgrades with a specific commit
if [[ "$test_type" == "TEST_UPGRADE" ]] && [[ -n "$test_arg" ]]
then
local specific_upgrade_install_args="$(grep "^manifest_arg=" "$TEST_CONTEXT/upgrades/$commit" | cut -d'=' -f2-)"
local specific_upgrade_install_args="$(grep "^manifest_arg=" "$TEST_CONTEXT/upgrades/$test_arg" | cut -d'=' -f2-)"
[[ -n "$specific_upgrade_install_args" ]] && _install_args="$specific_upgrade_install_args"
local upgrade_name="$(grep "^name=" "$TEST_CONTEXT/upgrades/$commit" | cut -d'=' -f2)"
local upgrade_name="$(grep "^name=" "$TEST_CONTEXT/upgrades/$test_arg" | cut -d'=' -f2)"
extra="$(jq -n --arg upgrade_name "$upgrade_name" '{ $upgrade_name }')"
elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "actions" ]]
then
@ -139,13 +139,12 @@ parse_check_process() {
is_test_enabled setup_root && add_test "TEST_INSTALL" "root"
is_test_enabled setup_sub_dir && add_test "TEST_INSTALL" "subdir"
is_test_enabled setup_nourl && add_test "TEST_INSTALL" "nourl"
grep "^upgrade=1" "$TEST_CONTEXT/check_process.tests_infos" |
while IFS= read -r LINE;
do
commit="$(echo $LINE | grep -o "from_commit=.*" | awk -F= '{print $2}')"
[ -n "$commit" ] || continue
add_test "TEST_UPGRADE" "$commit"
done
done <<<$(grep "^upgrade=1" "$TEST_CONTEXT/check_process.tests_infos")
continue
else
@ -161,12 +160,11 @@ parse_check_process() {
is_test_enabled backup_restore && add_test "TEST_BACKUP_RESTORE"
# Upgrades
grep "^upgrade=1" "$TEST_CONTEXT/check_process.tests_infos" |
while IFS= read -r LINE;
do
commit="$(echo $LINE | grep -o "from_commit=.*" | awk -F= '{print $2}')"
add_test "TEST_UPGRADE" "$commit"
done
done <<<$(grep "^upgrade=1" "$TEST_CONTEXT/check_process.tests_infos")
# "Advanced" features