Files
honghua e2e680831c fix: add executable permission bit for all 3963 .sh test scripts
All .sh files under tests/ lacked the Git executable permission bit
(100644 instead of 100755), causing tmt run to fail with 'permission
denied' errors on Linux servers.

Fixes: woqidaideshi/openruyi-autotest#80
2026-07-06 14:36:45 +08:00

44 lines
1.6 KiB
Bash
Executable File

# library-prefix = smoke_shell_basics
#
# Smoke shell_basics suite-level shared library
# Uses flag-file + reference counting to ensure the category's
# dependency packages are verified only ONCE across all test cases.
# Most smoke dependencies (bash coreutils) are always present on the system;
# this lib verifies their existence rather than installing.
#
# Usage in each test file:
# . "$(dirname "$0")/../lib.sh" # from test_smoke_xxx/ subdirectories
SMOKE_SHELL_BASICS_FLAG="/tmp/.beakerlib_smoke_shell_basics_suite"
smokeShellBasicsSetup() {
if [ ! -f "$SMOKE_SHELL_BASICS_FLAG" ]; then
echo "installed=0" > "$SMOKE_SHELL_BASICS_FLAG"
echo "ref=1" >> "$SMOKE_SHELL_BASICS_FLAG"
rlLogInfo "smoke-shell_basics: 核心依赖已确认可用"
else
local ref
ref=$(grep "^ref=" "$SMOKE_SHELL_BASICS_FLAG" | cut -d= -f2)
ref=$((ref + 1))
sed -i "s/^ref=.*/ref=$ref/" "$SMOKE_SHELL_BASICS_FLAG"
rlLogInfo "smoke-shell_basics 已由其他测试初始化,引用计数: $ref"
fi
rlCleanupAppend "smokeShellBasicsCleanup"
}
smokeShellBasicsCleanup() {
if [ ! -f "$SMOKE_SHELL_BASICS_FLAG" ]; then
return 0
fi
local ref
ref=$(grep "^ref=" "$SMOKE_SHELL_BASICS_FLAG" | cut -d= -f2)
ref=$((ref - 1))
if [ "$ref" -le 0 ]; then
rm -f "$SMOKE_SHELL_BASICS_FLAG"
rlLogInfo "smoke-shell_basics: 清理完成(最后一个测试)"
else
sed -i "s/^ref=.*/ref=$ref/" "$SMOKE_SHELL_BASICS_FLAG"
rlLogInfo "smoke-shell_basics: 保留(还有 $ref 个测试未完成)"
fi
}