semantics: LXC_START -> LXC_EXEC

This commit is contained in:
Alexandre Aubin 2021-01-12 02:22:48 +01:00
parent 4a97060018
commit 1ce755346e
3 changed files with 8 additions and 8 deletions

View file

@ -66,7 +66,7 @@ LOAD_LXC_SNAPSHOT () {
#================================================= #=================================================
LXC_START () { LXC_EXEC () {
# Start the lxc container and execute the given command in it # Start the lxc container and execute the given command in it
local cmd=$1 local cmd=$1

View file

@ -13,7 +13,7 @@ _RUN_YUNOHOST_CMD() {
lxc file push -p -r "$package_path" $LXC_NAME/app_folder --quiet lxc file push -p -r "$package_path" $LXC_NAME/app_folder --quiet
# --output-as none is to disable the json-like output for some commands like backup create # --output-as none is to disable the json-like output for some commands like backup create
LXC_START "yunohost --output-as none --debug $1" \ LXC_EXEC "yunohost --output-as none --debug $1" \
| grep --line-buffered -v --extended-regexp '^[0-9]+\s+.{1,15}DEBUG' \ | grep --line-buffered -v --extended-regexp '^[0-9]+\s+.{1,15}DEBUG' \
| grep --line-buffered -v 'processing action' | grep --line-buffered -v 'processing action'
@ -39,7 +39,7 @@ _PREINSTALL () {
# Copy the pre-install script into the container. # Copy the pre-install script into the container.
lxc file push "$preinstall_script" "$LXC_NAME/preinstall.sh" lxc file push "$preinstall_script" "$LXC_NAME/preinstall.sh"
# Then execute the script to execute the pre-install commands. # Then execute the script to execute the pre-install commands.
LXC_START "bash /preinstall.sh" LXC_EXEC "bash /preinstall.sh"
fi fi
} }
@ -439,7 +439,7 @@ TEST_PORT_ALREADY_USED () {
lxc file push $TEST_CONTEXT/netcat.service $LXC_NAME/etc/systemd/system/netcat.service lxc file push $TEST_CONTEXT/netcat.service $LXC_NAME/etc/systemd/system/netcat.service
# Then start this service to block this port. # Then start this service to block this port.
LXC_START "systemctl enable netcat & systemctl start netcat" LXC_EXEC "systemctl enable netcat & systemctl start netcat"
_PREINSTALL _PREINSTALL

View file

@ -267,13 +267,13 @@ run_all_tests() {
LXC_RESET LXC_RESET
LXC_CREATE LXC_CREATE
# Be sure that the container is running # Be sure that the container is running
LXC_START "true" LXC_EXEC "true"
# Print the version of YunoHost from the LXC container # Print the version of YunoHost from the LXC container
log_small_title "YunoHost versions" log_small_title "YunoHost versions"
LXC_START "yunohost --version" LXC_EXEC "yunohost --version"
LXC_START "yunohost --version --output-as json" | jq -r .yunohost.version >> $TEST_CONTEXT/ynh_version LXC_EXEC "yunohost --version --output-as json" | jq -r .yunohost.version >> $TEST_CONTEXT/ynh_version
LXC_START "yunohost --version --output-as json" | jq -r .yunohost.repo >> $TEST_CONTEXT/ynh_branch LXC_EXEC "yunohost --version --output-as json" | jq -r .yunohost.repo >> $TEST_CONTEXT/ynh_branch
echo $ARCH > $TEST_CONTEXT/architecture echo $ARCH > $TEST_CONTEXT/architecture
echo $app_id > $TEST_CONTEXT/app_id echo $app_id > $TEST_CONTEXT/app_id