forked from woqidaideshi/openruyi-autotest
32 lines
975 B
Bash
Executable File
32 lines
975 B
Bash
Executable File
#!/bin/bash
|
|
# Functional test: python - 基本执行
|
|
# Beakerlib-based test with lifecycle management
|
|
# Shared suite setup/cleanup via ../lib.sh (install once, uninstall once)
|
|
|
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
|
. "$(dirname "$0")/../lib.sh"
|
|
|
|
rlJournalStart
|
|
rlPhaseStartSetup "环境准备"
|
|
pythonSetup
|
|
TmpDir=$(mktemp -d)
|
|
rlRun "cd $TmpDir" 0 "进入临时测试目录"
|
|
rlPhaseEnd
|
|
|
|
rlPhaseStartTest "基本执行"
|
|
rlRun "python3 -c \"print(1+2)\"" 0 "Python 基本运算"
|
|
rlRun "python3 -c \"import sys; print(sys.version)\"" 0 "Python sys模块"
|
|
rlPhaseEnd
|
|
|
|
|
|
rlPhaseStartCleanup "清理测试环境"
|
|
rlRun "cd /" 0 "离开测试目录"
|
|
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
|
rlRun "rm -rf $TmpDir" 0 "清理临时测试目录"
|
|
fi
|
|
# python 软件包由 lib.sh 的引用计数机制自动管理卸载
|
|
rlPhaseEnd
|
|
|
|
rlJournalPrintText
|
|
rlJournalEnd
|