1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh.git synced 2024-09-03 20:26:26 +02:00

Enable tests with package_check

This commit is contained in:
Maniack Crudelis 2019-01-31 12:05:31 +01:00
parent bb3f5657a2
commit 3e2bed193b
4 changed files with 32 additions and 20 deletions

View file

@ -17,12 +17,9 @@
port_already_use=0
change_url=0
;;; Levels
# Level 1: Manually tested...
Level 1=1
# Level 2: Manually tested...
Level 2=1
# Level 3: Manually tested...
Level 3=1
Level 1=auto
Level 2=auto
Level 3=auto
# Level 4: Not relevant.
Level 4=na
Level 5=auto

View file

@ -33,8 +33,7 @@ app=$YNH_APP_INSTANCE_NAME
# DISCLAIMER
#=================================================
PACKAGE_CHECK_EXEC=${PACKAGE_CHECK_EXEC:-0}
if [ "$PACKAGE_CHECK_EXEC" != "0" ]; then
if IS_PACKAGE_CHECK; then
ynh_print_warn "This app can't be tested by package check. Please see the readme for more information. https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh"
fi
@ -101,7 +100,9 @@ mkdir -p "$user_dir"
ynh_script_progression --message="Install quotas system" --weight=3
# https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh
quotas_install
if ! IS_PACKAGE_CHECK; then
quotas_install
fi
#=================================================
# CONFIGURE FSTAB TO SUPPORT QUOTAS
@ -110,11 +111,14 @@ ynh_script_progression --message="Configure fstab to support quotas" --weight=3
# https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh
# Set fstab
quotas_find_mount_point "$user_dir"
quotas_set_fstab "$quotas_mount_point"
if ! IS_PACKAGE_CHECK
then
quotas_find_mount_point "$user_dir"
quotas_set_fstab "$quotas_mount_point"
# Activate quotas
quotas_activate "$quotas_mount_point"
# Activate quotas
quotas_activate "$quotas_mount_point"
fi
#=================================================
# CREATE THE USER WITH CHROOT_MANAGER
@ -139,7 +143,10 @@ then
fi
ynh_print_OFF
$final_path/chroot_manager.sh adduser --name $ssh_user $auth_opt "$auth_value" --directory "$user_dir" --quota $size
if ! IS_PACKAGE_CHECK
then
$final_path/chroot_manager.sh adduser --name $ssh_user $auth_opt "$auth_value" --directory "$user_dir" --quota $size
fi
ynh_print_ON
#=================================================

View file

@ -36,18 +36,23 @@ ynh_script_progression --message="Remove quotas options in fstab" --weight=3
user_dir="/home/yunohost.app/ssh_chroot_directories/$ssh_user"
# https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh
quotas_find_mount_point "$user_dir"
quotas_clean_fstab "$quotas_mount_point"
if ! IS_PACKAGE_CHECK
then
quotas_find_mount_point "$user_dir"
quotas_clean_fstab "$quotas_mount_point"
# Deactivate quotas
quotas_deactivate "$quotas_mount_point"
# Deactivate quotas
quotas_deactivate "$quotas_mount_point"
fi
#=================================================
# REMOVE THE USER WITH CHROOT_MANAGER
#=================================================
ynh_script_progression --message="Remove the user with Chroot_manager" --weight=3
$final_path/chroot_manager.sh deluser --name $ssh_user
if ! IS_PACKAGE_CHECK; then
$final_path/chroot_manager.sh deluser --name $ssh_user
fi
#=================================================
# STANDARD REMOVE

View file

@ -70,7 +70,10 @@ ssh_chroot_standard_binaries "$user_dir"
ssh_chroot_copy_binary rsync "$user_dir"
# Set permissions
ssh_chroot_set_permissions "$user_dir" $ssh_user
if ! IS_PACKAGE_CHECK
then
ssh_chroot_set_permissions "$user_dir" $ssh_user
fi
#=================================================
# UPDATE THE LINK TO CHROOT_MANAGER