mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Moar fiksizes
This commit is contained in:
parent
5f2b74dbfc
commit
942531c3ff
3 changed files with 14 additions and 16 deletions
|
@ -44,7 +44,7 @@ CREATE_LXC_SNAPSHOT () {
|
||||||
}
|
}
|
||||||
|
|
||||||
LOAD_LXC_SNAPSHOT () {
|
LOAD_LXC_SNAPSHOT () {
|
||||||
snapname=$1
|
local snapname=$1
|
||||||
log_debug "Loading snapshot $snapname ..."
|
log_debug "Loading snapshot $snapname ..."
|
||||||
sudo lxc stop --timeout 15 $LXC_NAME 2>/dev/null
|
sudo lxc stop --timeout 15 $LXC_NAME 2>/dev/null
|
||||||
sudo lxc restore $LXC_NAME $snapname
|
sudo lxc restore $LXC_NAME $snapname
|
||||||
|
|
16
lib/tests.sh
16
lib/tests.sh
|
@ -69,6 +69,7 @@ _LOAD_SNAPSHOT_OR_INSTALL_APP () {
|
||||||
|
|
||||||
if ! LXC_SNAPSHOT_EXISTS $snapname
|
if ! LXC_SNAPSHOT_EXISTS $snapname
|
||||||
then
|
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 \
|
LOAD_LXC_SNAPSHOT snap0 \
|
||||||
&&_INSTALL_APP "path=$check_path" \
|
&&_INSTALL_APP "path=$check_path" \
|
||||||
&& log_debug "(Creating a snapshot for $_install_type installation.)" \
|
&& log_debug "(Creating a snapshot for $_install_type installation.)" \
|
||||||
|
@ -314,14 +315,14 @@ _TEST_MULTI_INSTANCE () {
|
||||||
|
|
||||||
LOAD_LXC_SNAPSHOT snap0
|
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" \
|
&& _LOAD_SNAPSHOT_OR_INSTALL_APP "$check_path" \
|
||||||
&& log_small_title "Second installation: path=$SUBDOMAIN$check_path" \
|
&& log_small_title "Second installation: path=$DOMAIN$check_path" \
|
||||||
&& _INSTALL_APP "path=$check_path" \
|
&& _INSTALL_APP "domain=$DOMAIN" "path=$check_path" \
|
||||||
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $DOMAIN $check_path \
|
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path \
|
||||||
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path "" ${app_id}__2 \
|
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $DOMAIN $check_path "" ${app_id}__2 \
|
||||||
&& _REMOVE_APP \
|
&& _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 $?
|
return $?
|
||||||
}
|
}
|
||||||
|
@ -471,9 +472,8 @@ TEST_BACKUP_RESTORE () {
|
||||||
|
|
||||||
# Place the copy of the backup archive in the container.
|
# Place the copy of the backup archive in the container.
|
||||||
sudo lxc file push -r ./ynh_backups/archives/* $LXC_NAME/home/yunohost.backup/archives/
|
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
|
fi
|
||||||
|
|
||||||
# Restore the application from the previous backup
|
# Restore the application from the previous backup
|
||||||
|
|
|
@ -59,7 +59,7 @@ parse_check_process() {
|
||||||
local commit
|
local commit
|
||||||
for commit in $(cat $TEST_CONTEXT/check_process.upgrade_options | grep "^; commit=.*" | awk -F= '{print $2}')
|
for commit in $(cat $TEST_CONTEXT/check_process.upgrade_options | grep "^; commit=.*" | awk -F= '{print $2}')
|
||||||
do
|
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
|
done
|
||||||
rm $TEST_CONTEXT/check_process.upgrade_options
|
rm $TEST_CONTEXT/check_process.upgrade_options
|
||||||
|
|
||||||
|
@ -108,10 +108,10 @@ parse_check_process() {
|
||||||
# Upgrades with a specific commit
|
# Upgrades with a specific commit
|
||||||
if [[ "$test_type" == "TEST_UPGRADE" ]] && [[ -n "$test_arg" ]]
|
if [[ "$test_type" == "TEST_UPGRADE" ]] && [[ -n "$test_arg" ]]
|
||||||
then
|
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"
|
[[ -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 }')"
|
extra="$(jq -n --arg upgrade_name "$upgrade_name" '{ $upgrade_name }')"
|
||||||
elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "actions" ]]
|
elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "actions" ]]
|
||||||
then
|
then
|
||||||
|
@ -139,13 +139,12 @@ parse_check_process() {
|
||||||
is_test_enabled setup_root && add_test "TEST_INSTALL" "root"
|
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_sub_dir && add_test "TEST_INSTALL" "subdir"
|
||||||
is_test_enabled setup_nourl && add_test "TEST_INSTALL" "nourl"
|
is_test_enabled setup_nourl && add_test "TEST_INSTALL" "nourl"
|
||||||
grep "^upgrade=1" "$TEST_CONTEXT/check_process.tests_infos" |
|
|
||||||
while IFS= read -r LINE;
|
while IFS= read -r LINE;
|
||||||
do
|
do
|
||||||
commit="$(echo $LINE | grep -o "from_commit=.*" | awk -F= '{print $2}')"
|
commit="$(echo $LINE | grep -o "from_commit=.*" | awk -F= '{print $2}')"
|
||||||
[ -n "$commit" ] || continue
|
[ -n "$commit" ] || continue
|
||||||
add_test "TEST_UPGRADE" "$commit"
|
add_test "TEST_UPGRADE" "$commit"
|
||||||
done
|
done <<<$(grep "^upgrade=1" "$TEST_CONTEXT/check_process.tests_infos")
|
||||||
|
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
@ -161,12 +160,11 @@ parse_check_process() {
|
||||||
is_test_enabled backup_restore && add_test "TEST_BACKUP_RESTORE"
|
is_test_enabled backup_restore && add_test "TEST_BACKUP_RESTORE"
|
||||||
|
|
||||||
# Upgrades
|
# Upgrades
|
||||||
grep "^upgrade=1" "$TEST_CONTEXT/check_process.tests_infos" |
|
|
||||||
while IFS= read -r LINE;
|
while IFS= read -r LINE;
|
||||||
do
|
do
|
||||||
commit="$(echo $LINE | grep -o "from_commit=.*" | awk -F= '{print $2}')"
|
commit="$(echo $LINE | grep -o "from_commit=.*" | awk -F= '{print $2}')"
|
||||||
add_test "TEST_UPGRADE" "$commit"
|
add_test "TEST_UPGRADE" "$commit"
|
||||||
done
|
done <<<$(grep "^upgrade=1" "$TEST_CONTEXT/check_process.tests_infos")
|
||||||
|
|
||||||
# "Advanced" features
|
# "Advanced" features
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue