diff --git a/suite2cases/function_test/pkg_test/corosync/corosync-vqsim.json b/suite2cases/function_test/pkg_test/corosync/corosync-vqsim.json deleted file mode 100644 index da42eca6cd1..00000000000 --- a/suite2cases/function_test/pkg_test/corosync/corosync-vqsim.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/corosync/corosync-vqsim", - "machine num": 1, - "cases": [ - { - "name": "test_corosync-vqsim_corosync-vqsim_c", - "desc": "使用 -c 参数指定配置文件" - }, - { - "name": "test_corosync-vqsim_corosync-vqsim_o", - "desc": "使用 -o 参数指定输出文件" - }, - { - "name": "test_corosync-vqsim_corosync-vqsim_n", - "desc": "使用 -n 参数禁用节点添加时的同步" - }, - { - "name": "test_corosync-vqsim_corosync-vqsim_h", - "desc": "使用 -h 参数显示帮助文本" - }, - { - "name": "test_corosync-vqsim_corosync-vqsim_c_o", - "desc": "同时使用 -c 和 -o 参数指定配置文件和输出文件" - }, - { - "name": "test_corosync-vqsim_function_start", - "desc": "测试启动corosync-vqsim服务" - }, - { - "name": "test_corosync-vqsim_corosync-vqsim_c_n", - "desc": "测试同时使用-c和-n参数" - }, - { - "name": "test_corosync-vqsim_corosync-vqsim_o_n", - "desc": "测试同时使用-o和-n参数" - }, - { - "name": "test_corosync-vqsim_corosync-vqsim_c_o_n", - "desc": "测试同时使用-c、-o和-n参数" - }, - { - "name": "test_corosync-vqsim_corosync-vqsim_no_args", - "desc": "测试不使用任何参数(使用默认配置和输出到stdout)" - }, - { - "name": "test_corosync-vqsim_function_install", - "desc": "测试软件包安装" - }, - { - "name": "test_corosync-vqsim_function_uninstall", - "desc": "测试软件包卸载" - }, - { - "name": "test_corosync-vqsim_function_version", - "desc": "测试显示版本信息" - }, - { - "name": "test_corosync-vqsim_function_check_installed", - "desc": "测试检查软件包是否已安装" - }, - { - "name": "test_corosync-vqsim_function_default_run", - "desc": "测试使用默认配置启动模拟器" - }, - { - "name": "test_corosync-vqsim_function_simulate_cluster", - "desc": "测试模拟指定节点数的集群" - }, - { - "name": "test_corosync-vqsim_function_verify_output", - "desc": "测试验证输出文件内容格式" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/gcc/liblsan.json b/suite2cases/function_test/pkg_test/gcc/liblsan.json index 53b7c958033..814d3d5401e 100644 --- a/suite2cases/function_test/pkg_test/gcc/liblsan.json +++ b/suite2cases/function_test/pkg_test/gcc/liblsan.json @@ -2,53 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/gcc/liblsan", "machine num": 1, "cases": [ - { - "name": "test_liblsan_function_install_package", - "desc": "测试通过包管理器(如apt, yum, dnf)安装liblsan软件包的功能,验证安装过程是否成功且无错误。" - }, - { - "name": "test_liblsan_function_check_installed", - "desc": "测试检查liblsan软件包是否已正确安装到系统中的功能,验证其文件(如库文件、头文件)是否存在于标准路径。" - }, - { - "name": "test_liblsan_function_remove_package", - "desc": "测试通过包管理器安全卸载liblsan软件包的功能,验证卸载过程是否干净且不影响系统其他组件。" - }, - { - "name": "test_liblsan_function_basic_linking", - "desc": "测试一个简单的C程序能否成功链接liblsan库(使用-lsan标志)并进行编译,验证其作为链接时库的基本可用性。" - }, - { - "name": "test_liblsan_function_runtime_detection", - "desc": "测试一个包含内存泄漏的示例程序在启用LSan(通过环境变量如ASAN_OPTIONS)运行时,是否能被liblsan检测并报告泄漏信息。" - }, { "name": "test_liblsan_function_install", "desc": "验证通过系统包管理器(apt/yum/dnf)能够成功安装liblsan软件包,无错误且文件就位。" - }, - { - "name": "test_liblsan_function_check_version", - "desc": "测试检查已安装liblsan软件包的版本信息,验证版本号可正常查询。" - }, - { - "name": "test_liblsan_function_uninstall", - "desc": "验证通过包管理器安全卸载liblsan软件包,确保卸载后相关文件被移除且不影响核心系统。" - }, - { - "name": "test_liblsan_function_compile_link", - "desc": "测试一个简单的C程序能否使用-lsan标志成功编译和链接liblsan库,验证其作为开发库的基本功能。" - }, - { - "name": "test_liblsan_function_leak_report", - "desc": "测试一个包含内存泄漏的程序在启用LSan运行时,是否能被正确检测并生成详细的泄漏报告。" - }, - { - "name": "test_liblsan_function_env_options", - "desc": "测试通过环境变量(如LSAN_OPTIONS)配置LSan运行行为(如设置退出码、过滤规则)是否生效。" - }, - { - "name": "test_liblsan_function_suppression", - "desc": "测试使用LSan抑制文件(suppression file)来忽略特定泄漏报告的功能是否正常工作。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/glib2/glib2-tests.json b/suite2cases/function_test/pkg_test/glib2/glib2-tests.json index 0cbb9ca463c..894e3cf9554 100644 --- a/suite2cases/function_test/pkg_test/glib2/glib2-tests.json +++ b/suite2cases/function_test/pkg_test/glib2/glib2-tests.json @@ -13,14 +13,6 @@ { "name": "test_glib2-tests_function_version", "desc": "测试查询glib2-tests软件包版本信息的功能,验证版本信息是否正确显示。" - }, - { - "name": "test_glib2-tests_function_run", - "desc": "测试运行glib2-tests软件包自带的测试套件,验证核心功能是否正常。" - }, - { - "name": "test_glib2-tests_function_dependency", - "desc": "测试glib2-tests软件包的依赖关系,验证其依赖的GLib库功能是否正常可用。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/gtk-vnc/gtk-vnc2.json b/suite2cases/function_test/pkg_test/gtk-vnc/gtk-vnc2.json deleted file mode 100644 index 9010325bf0a..00000000000 --- a/suite2cases/function_test/pkg_test/gtk-vnc/gtk-vnc2.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2", - "machine num": 1, - "cases": [ - { - "name": "test_gtk-vnc2_function_connect", - "desc": "Test connection to VNC server" - }, - { - "name": "test_gtk-vnc2_function_install", - "desc": "Test installation of gtk-vnc2 package" - }, - { - "name": "test_gtk-vnc2_function_uninstall", - "desc": "Test uninstallation of gtk-vnc2 package" - }, - { - "name": "test_gtk-vnc2_function_version", - "desc": "Test version query of gtk-vnc2 package" - }, - { - "name": "test_gtk-vnc2_function_launch", - "desc": "Test launching gtk-vnc2 viewer" - }, - { - "name": "test_gtk-vnc2_function_display", - "desc": "Test basic display of VNC window" - }, - { - "name": "test_gtk-vnc2_function_keyboard", - "desc": "Test keyboard input simulation" - }, - { - "name": "test_gtk-vnc2_function_mouse", - "desc": "Test mouse input simulation" - }, - { - "name": "test_gtk-vnc2_function_scaling", - "desc": "Test display scaling options" - }, - { - "name": "test_gtk-vnc2_function_clipboard", - "desc": "Test clipboard sharing" - }, - { - "name": "test_gtk-vnc2_function_encryption", - "desc": "Test encryption options" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-basefilter.json b/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-basefilter.json index b76a142ee0f..acc56f8c2bd 100644 --- a/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-basefilter.json +++ b/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-basefilter.json @@ -6,18 +6,6 @@ "name": "test_nodejs-lodash-basefilter_function_install", "desc": "测试nodejs-lodash-basefilter软件包能够通过系统包管理器成功安装" }, - { - "name": "test_nodejs-lodash-basefilter_function_check_installed", - "desc": "测试nodejs-lodash-basefilter软件包已正确安装并存在于系统中" - }, - { - "name": "test_nodejs-lodash-basefilter_function_require_module", - "desc": "测试在Node.js环境中能够成功require(\"lodash.filter\")模块" - }, - { - "name": "test_nodejs-lodash-basefilter_function_basic_filter", - "desc": "测试lodash.filter函数能够对数组进行基本过滤操作" - }, { "name": "test_nodejs-lodash-basefilter_function_uninstall", "desc": "测试nodejs-lodash-basefilter软件包能够通过系统包管理器成功卸载" diff --git a/suite2cases/function_test/pkg_test/maven2/maven-monitor.json b/suite2cases/function_test/pkg_test/maven2/maven-monitor.json index f76abde87a0..a11c69b5193 100644 --- a/suite2cases/function_test/pkg_test/maven2/maven-monitor.json +++ b/suite2cases/function_test/pkg_test/maven2/maven-monitor.json @@ -6,10 +6,6 @@ "name": "test_maven-monitor_install", "desc": "测试maven-monitor软件包的安装功能,验证安装过程是否正常完成。", "machine num": 1 - }, - { - "name": "test_maven-monitor_function_start", - "desc": "测试maven-monitor软件包的启动功能,验证启动过程是否正常完成。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help.json b/suite2cases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help.json index 306db20ed80..27795abeef5 100644 --- a/suite2cases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help.json +++ b/suite2cases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help.json @@ -6,18 +6,10 @@ "name": "test_perl-ExtUtils-Install-help_function_usage", "desc": "测试软件包提供的帮助文档或基本使用命令的可用性" }, - { - "name": "test_perl-ExtUtils-Install-help_function_install", - "desc": "测试软件包安装功能是否正常" - }, { "name": "test_perl-ExtUtils-Install-help_function_uninstall", "desc": "测试软件包卸载功能是否正常" }, - { - "name": "test_perl-ExtUtils-Install-help_function_version", - "desc": "测试获取软件包版本信息功能" - }, { "name": "test_perl-ExtUtils-Install-help_function_help", "desc": "测试软件包帮助文档的显示与可用性" diff --git a/suite2cases/function_test/pkg_test/python-scikit-build-core/python3-scikit-build-core.json b/suite2cases/function_test/pkg_test/python-scikit-build-core/python3-scikit-build-core.json deleted file mode 100644 index 876bba6bbbd..00000000000 --- a/suite2cases/function_test/pkg_test/python-scikit-build-core/python3-scikit-build-core.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-scikit-build-core/python3-scikit-build-core", - "machine num": 1, - "cases": [ - { - "name": "test_python3-scikit-build-core_function_build", - "desc": "Test the build functionality of the package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-tzlocal/python-tzlocal-help.json b/suite2cases/function_test/pkg_test/python-tzlocal/python-tzlocal-help.json index 9ff59bf4def..5f3312728ce 100644 --- a/suite2cases/function_test/pkg_test/python-tzlocal/python-tzlocal-help.json +++ b/suite2cases/function_test/pkg_test/python-tzlocal/python-tzlocal-help.json @@ -6,10 +6,6 @@ "name": "test_python-tzlocal-help_install", "desc": "测试python-tzlocal-help软件包的安装功能,验证是否能够成功安装。", "machine num": 1 - }, - { - "name": "test_python-tzlocal-help_function_get", - "desc": "测试python-tzlocal-help软件包的时区获取功能,验证是否能正确获取本地时区。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-versioneer/python3-versioneer.json b/suite2cases/function_test/pkg_test/python-versioneer/python3-versioneer.json index 9ede54b78e7..61e037fe294 100644 --- a/suite2cases/function_test/pkg_test/python-versioneer/python3-versioneer.json +++ b/suite2cases/function_test/pkg_test/python-versioneer/python3-versioneer.json @@ -2,49 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-versioneer/python3-versioneer", "machine num": 1, "cases": [ - { - "name": "test_python3-versioneer_versioneer_install", - "desc": "测试 versioneer install 命令" - }, { "name": "test_python3-versioneer_versioneer_install__vendor", "desc": "测试 versioneer install --vendor 参数" - }, - { - "name": "test_python3-versioneer_versioneer_install__no_vendor", - "desc": "测试 versioneer install --no-vendor 参数" - }, - { - "name": "test_python3-versioneer_function_version_check", - "desc": "测试 versioneer 版本检查功能" - }, - { - "name": "test_python3-versioneer_versioneer_install_vendor", - "desc": "执行 versioneer install --vendor 命令" - }, - { - "name": "test_python3-versioneer_versioneer_install_no_vendor", - "desc": "执行 versioneer install --no-vendor 命令" - }, - { - "name": "test_python3-versioneer_function_package_install", - "desc": "测试python3-versioneer软件包的安装" - }, - { - "name": "test_python3-versioneer_function_package_remove", - "desc": "测试python3-versioneer软件包的卸载" - }, - { - "name": "test_python3-versioneer_function_basic_help", - "desc": "测试versioneer命令基本帮助信息" - }, - { - "name": "test_python3-versioneer_function_cmd_version", - "desc": "测试versioneer命令的版本输出" - }, - { - "name": "test_python3-versioneer_function_setup_py", - "desc": "测试versioneer在setup.py中的集成与版本生成" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc.json index 578fc0ad843..c3a9d3f1d0d 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc.json @@ -16,151 +16,6 @@ "name": "test_texlive-fbithesis-doc_upgrade", "desc": "测试texlive-fbithesis-doc软件包的升级功能,验证是否能够正确升级到新版本", "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_downgrade", - "desc": "测试texlive-fbithesis-doc软件包的降级功能,验证是否能够正确降级到旧版本", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_rollback", - "desc": "测试texlive-fbithesis-doc软件包的回滚功能,验证是否能够正确回滚到上一个版本", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_reinstall", - "desc": "测试texlive-fbithesis-doc软件包的重新安装功能,验证是否能够正确重新安装到系统中", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_rollback_upgrade", - "desc": "测试texlive-fbithesis-doc软件包的升级回滚功能,验证是否能够正确从升级后的版本回滚到升级前的版本", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_downgrade_rollback", - "desc": "测试texlive-fbithesis-doc软件包的降级回滚功能,验证是否能够正确从降级后的版本回滚到降级前的版本", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_start", - "desc": "测试texlive-fbithesis-doc软件包提供的服务启动功能,验证服务是否能正常启动", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_stop", - "desc": "测试texlive-fbithesis-doc软件包提供的服务停止功能,验证服务是否能正常停止", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_restart", - "desc": "测试texlive-fbithesis-doc软件包提供的服务重启功能,验证服务是否能正常重启", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_status", - "desc": "测试texlive-fbithesis-doc软件包提供的服务状态查询功能,验证是否能正常查询服务状态", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_log", - "desc": "测试texlive-fbithesis-doc软件包提供的服务日志查看功能,验证是否能正常查看服务日志", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_config", - "desc": "测试texlive-fbithesis-doc软件包提供的服务配置功能,验证是否能正常配置服务参数", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_reload", - "desc": "测试texlive-fbithesis-doc软件包提供的服务重载功能,验证服务是否能正常重载配置", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_enable", - "desc": "测试texlive-fbithesis-doc软件包提供的服务开机自启功能,验证服务是否能正常设置为开机自启", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_service_disable", - "desc": "测试texlive-fbithesis-doc软件包提供的服务开机自启禁用功能,验证服务是否能正常取消开机自启", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_documentation", - "desc": "测试texlive-fbithesis-doc软件包的文档验证功能,验证文档是否完整且可访问", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_installation", - "desc": "测试texlive-fbithesis-doc软件包的安装验证功能,验证安装后的文件是否完整且符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_dependencies", - "desc": "测试texlive-fbithesis-doc软件包的依赖关系验证功能,验证所有依赖包是否已正确安装且版本符合要求", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_command_output", - "desc": "测试texlive-fbithesis-doc软件包提供的命令的输出验证功能,验证命令执行后的输出是否符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_file_permissions", - "desc": "测试texlive-fbithesis-doc软件包的文件权限验证功能,验证安装后的文件权限是否符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_command_help", - "desc": "测试texlive-fbithesis-doc软件包提供的命令的帮助功能,验证命令的帮助信息是否完整且可访问", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_environment", - "desc": "测试texlive-fbithesis-doc软件包的环境验证功能,验证安装后的环境变量是否设置正确且符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_service_config", - "desc": "测试texlive-fbithesis-doc软件包提供的服务配置验证功能,验证服务配置是否正确且符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_command_version", - "desc": "测试texlive-fbithesis-doc软件包提供的命令的版本查询功能,验证命令是否能正确返回版本信息", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_command_options", - "desc": "测试texlive-fbithesis-doc软件包提供的命令选项验证功能,验证命令的所有选项是否可用且符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_command_usage", - "desc": "测试texlive-fbithesis-doc软件包提供的命令使用说明验证功能,验证命令的使用说明是否完整且可访问", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_command_timeout", - "desc": "测试texlive-fbithesis-doc软件包提供的命令超时功能,验证命令在超时设置下是否能正常执行并返回预期结果", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_command_syntax", - "desc": "测试texlive-fbithesis-doc软件包提供的命令语法验证功能,验证命令的语法是否正确且符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_service_health", - "desc": "测试texlive-fbithesis-doc软件包提供的服务健康检查功能,验证服务是否能正常响应健康检查请求", - "machine num": 1 - }, - { - "name": "test_texlive-fbithesis-doc_verify_command_default", - "desc": "测试texlive-fbithesis-doc软件包提供的命令的默认参数功能,验证命令在无参数情况下是否能正常执行并返回预期结果", - "machine num": 1 } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphenex.json b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphenex.json index 59f604d6124..af075381338 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphenex.json +++ b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphenex.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphenex", "machine num": 1, "cases": [ - { - "name": "test_texlive-hyphenex_function_basic", - "desc": "Test basic command usage" - }, { "name": "test_texlive-hyphenex_function_install", "desc": "Test installation of the package" @@ -17,10 +13,6 @@ { "name": "test_texlive-hyphenex_function_check_installed", "desc": "Verify the package is installed and available" - }, - { - "name": "test_texlive-hyphenex_function_usage_example", - "desc": "Test a basic hyphenation example with LaTeX" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-modiagram.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-modiagram.json index 1211fbe1551..0bcb8cd8291 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-modiagram.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-modiagram.json @@ -2,37 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram", "machine num": 1, "cases": [ - { - "name": "test_texlive-modiagram_function_basic", - "desc": "Test basic diagram generation" - }, - { - "name": "test_texlive-modiagram_function_install", - "desc": "Test if the package can be installed successfully via package manager" - }, { "name": "test_texlive-modiagram_function_remove", "desc": "Test if the package can be cleanly removed via package manager" - }, - { - "name": "test_texlive-modiagram_function_basic_compile", - "desc": "Test basic LaTeX document compilation with modiagram package loaded" - }, - { - "name": "test_texlive-modiagram_function_mo_diagram", - "desc": "Test generation of a basic molecular orbital diagram" - }, - { - "name": "test_texlive-modiagram_function_atomic_orbital", - "desc": "Test generation of atomic orbital diagrams" - }, - { - "name": "test_texlive-modiagram_function_custom_levels", - "desc": "Test setting custom energy levels and labels in diagrams" - }, - { - "name": "test_texlive-modiagram_function_style_options", - "desc": "Test applying different styles and colors to diagram elements" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mweights.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mweights.json deleted file mode 100644 index 5aa1ddf1ac3..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mweights.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-p/texlive-mweights", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-mweights_function_install", - "desc": "Test installation of texlive-mweights package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-geo.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-geo.json deleted file mode 100644 index f726bce5846..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-geo.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-geo", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-pst-geo_function_basic", - "desc": "Basic functionality test for texlive-pst-geo" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-t/texlive-relenc.json b/suite2cases/function_test/pkg_test/texlive-split-t/texlive-relenc.json index adafb8c549e..2e0ca7afa43 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-t/texlive-relenc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-t/texlive-relenc.json @@ -21,11 +21,6 @@ "name": "test_texlive-relenc_downgrade", "desc": "测试texlive-relenc软件包的降级功能,验证是否能够正确降级到旧版本。", "machine num": 1 - }, - { - "name": "test_texlive-relenc_rollback", - "desc": "测试texlive-relenc软件包的回滚功能,验证是否能够正确回滚到之前的版本。", - "machine num": 1 } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sciposter.json b/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sciposter.json index ca65b8eaf5c..702a2d7ff85 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sciposter.json +++ b/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sciposter.json @@ -2,26 +2,10 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter", "machine num": 1, "cases": [ - { - "name": "test_texlive-sciposter_function_basic", - "desc": "Basic functionality test" - }, - { - "name": "test_texlive-sciposter_function_install", - "desc": "Test installation of texlive-sciposter package" - }, { "name": "test_texlive-sciposter_function_check_installed", "desc": "Check if texlive-sciposter is installed on the system" }, - { - "name": "test_texlive-sciposter_function_basic_usage", - "desc": "Test basic usage of sciposter document class" - }, - { - "name": "test_texlive-sciposter_function_compile_example", - "desc": "Compile a simple example poster with pdflatex" - }, { "name": "test_texlive-sciposter_function_uninstall", "desc": "Test removal of texlive-sciposter package" diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote.json deleted file mode 100644 index 1cdd1243a03..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-beamerappendixnote_function_basic", - "desc": "Basic functionality test" - }, - { - "name": "test_texlive-beamerappendixnote_function_install", - "desc": "Test package installation via package manager" - }, - { - "name": "test_texlive-beamerappendixnote_function_usage", - "desc": "Test basic package usage in a LaTeX document" - }, - { - "name": "test_texlive-beamerappendixnote_function_clean", - "desc": "Test cleanup of auxiliary files" - }, - { - "name": "test_texlive-beamerappendixnote_function_check", - "desc": "Test if the package is available in the TeX system" - }, - { - "name": "test_texlive-beamerappendixnote_function_manual", - "desc": "Test access to package documentation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-frenchmath.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-frenchmath.json index da70db0211b..cc4c91f28be 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-frenchmath.json +++ b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-frenchmath.json @@ -13,14 +13,6 @@ { "name": "test_texlive-frenchmath_function_verify", "desc": "Verify package installation status" - }, - { - "name": "test_texlive-frenchmath_function_usage", - "desc": "Test basic LaTeX compilation with package" - }, - { - "name": "test_texlive-frenchmath_function_french_math", - "desc": "Test French math typography features" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-inkpaper.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-inkpaper.json deleted file mode 100644 index 588d4b99205..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-inkpaper.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-z/texlive-inkpaper", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-inkpaper_function_basic", - "desc": "Test basic functionality of texlive-inkpaper" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/uimaj/jcasgen-maven-plugin.json b/suite2cases/function_test/pkg_test/uimaj/jcasgen-maven-plugin.json deleted file mode 100644 index 904b06fff19..00000000000 --- a/suite2cases/function_test/pkg_test/uimaj/jcasgen-maven-plugin.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin", - "machine num": 1, - "cases": [ - { - "name": "test_jcasgen-maven-plugin_install", - "desc": "测试软件包 jcasgen-maven-plugin 的安装功能,验证是否能够正确安装到系统中。", - "machine num": 1 - }, - { - "name": "test_jcasgen-maven-plugin_function_generate", - "desc": "测试软件包 jcasgen-maven-plugin 的代码生成功能,验证是否能够正确生成目标代码。" - }, - { - "name": "test_jcasgen-maven-plugin_function_config", - "desc": "测试软件包 jcasgen-maven-plugin 的配置功能,验证配置文件是否能够正确加载和应用。" - }, - { - "name": "test_jcasgen-maven-plugin_function_validate", - "desc": "测试软件包 jcasgen-maven-plugin 的验证功能,验证生成的代码是否符合预期规范。" - }, - { - "name": "test_jcasgen-maven-plugin_function_deps", - "desc": "测试软件包 jcasgen-maven-plugin 的依赖管理功能,验证是否能够正确处理依赖关系。" - }, - { - "name": "test_jcasgen-maven-plugin_function_install", - "desc": "测试软件包 jcasgen-maven-plugin 的安装功能,验证是否能够通过 Maven 正确安装到本地仓库中。" - }, - { - "name": "test_jcasgen-maven-plugin_function_help", - "desc": "测试软件包 jcasgen-maven-plugin 的帮助信息功能,验证执行 help 目标是否能正确显示插件使用说明。" - }, - { - "name": "test_jcasgen-maven-plugin_function_clean", - "desc": "测试软件包 jcasgen-maven-plugin 的清理功能,验证 clean 目标能否正确清理之前生成的目标代码文件。" - }, - { - "name": "test_jcasgen-maven-plugin_function_version", - "desc": "测试软件包 jcasgen-maven-plugin 的版本信息功能,验证执行 version 目标是否能正确显示插件版本号。" - }, - { - "name": "test_jcasgen-maven-plugin_function_verify", - "desc": "测试软件包 jcasgen-maven-plugin 的验证功能,验证生成的代码是否符合 Java 编译规范和预期结构。" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c.sh deleted file mode 100644 index 73d5ee78572..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 使用 -c 参数指定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用 -c 参数指定配置文件" - - # 检查软件包是否已安装 - LOG_INFO "检查 corosync-vqsim 是否已安装" - if ! dnf list installed corosync-vqsim &>/dev/null; then - LOG_INFO "corosync-vqsim 未安装,将进行安装" - INSTALLED=0 - else - LOG_INFO "corosync-vqsim 已安装" - INSTALLED=1 - fi - - # 检查 yum 源中是否存在 corosync-vqsim - LOG_INFO "检查 yum 源中是否存在 corosync-vqsim" - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum 源中不存在 corosync-vqsim" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "正在安装 corosync-vqsim" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装 corosync-vqsim 失败" - fi - - # 测试 -c 参数 - LOG_INFO "测试 -c 参数" - corosync-vqsim -c /etc/corosync/corosync.conf - CHECK_RESULT $? 0 0 "执行命令失败" - - # 清理环境(如果之前未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 corosync-vqsim" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载 corosync-vqsim 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_n.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_n.sh deleted file mode 100644 index 7753a3340d5..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_n.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试同时使用-c和-n参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试同时使用-c和-n参数" - LOG_INFO "步骤1:检查环境是否已安装corosync-vqsim软件包" - if rpm -q corosync-vqsim &>/dev/null; then - LOG_INFO "corosync-vqsim已安装,脚本结束将保持安装状态" - installed_before=true - else - LOG_INFO "corosync-vqsim未安装,将在测试步骤中安装" - installed_before=false - fi - - LOG_INFO "步骤2:检查yum源中是否有corosync-vqsim软件包" - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-vqsim软件包" - exit 255 - fi - - if [ "$installed_before" = false ]; then - LOG_INFO "步骤3:安装corosync-vqsim软件包" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim失败" - fi - - LOG_INFO "步骤4:检查corosync-vqsim命令是否支持-c和-n参数" - corosync-vqsim --help | grep -q "\-c" && corosync-vqsim --help | grep -q "\-n" - CHECK_RESULT $? 0 0 "corosync-vqsim命令不支持-c或-n参数" - if [ $? -ne 0 ]; then - exit 255 - fi - - LOG_INFO "步骤5:执行corosync-vqsim命令同时使用-c和-n参数" - corosync-vqsim -c /etc/corosync/corosync.conf -n node1 - CHECK_RESULT $? 0 0 "corosync-vqsim命令执行失败" - - LOG_INFO "步骤6:清理环境,恢复到之前的状态" - if [ "$installed_before" = false ]; then - LOG_INFO "卸载corosync-vqsim软件包" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载corosync-vqsim失败" - else - LOG_INFO "环境已安装corosync-vqsim,保持安装状态" - fi - - LOG_INFO "测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_o.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_o.sh deleted file mode 100644 index a8ec9c5fee8..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_o.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 同时使用 -c 和 -o 参数指定配置文件和输出文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:同时使用 -c 和 -o 参数指定配置文件和输出文件" - - # 检查是否已安装corosync-vqsim软件包 - if ! dnf list installed corosync-vqsim &>/dev/null; then - LOG_INFO "环境未安装corosync-vqsim,将进行安装" - INSTALLED=false - else - LOG_INFO "环境已安装corosync-vqsim" - INSTALLED=true - fi - - # 检查yum源中是否有corosync-vqsim软件包 - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-vqsim软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装corosync-vqsim软件包" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim失败" - fi - - # 测试-c和-o参数的功能 - LOG_INFO "测试-c和-o参数的功能" - corosync-vqsim -c /etc/corosync/corosync.conf -o /tmp/output.txt - CHECK_RESULT $? 0 0 "执行corosync-vqsim命令失败" - - # 检查输出文件是否存在 - if [ ! -f /tmp/output.txt ]; then - LOG_ERROR "输出文件未生成" - exit 1 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - rm -f /tmp/output.txt - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载corosync-vqsim软件包" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载corosync-vqsim失败" - fi - - LOG_INFO "测试完成:同时使用 -c 和 -o 参数指定配置文件和输出文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_o_n.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_o_n.sh deleted file mode 100644 index a7dcbcccd90..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_c_o_n.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试同时使用-c、-o和-n参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试corosync-vqsim同时使用-c、-o和-n参数" - - # 检查环境是否已安装corosync-vqsim - LOG_INFO "检查是否已安装corosync-vqsim" - if dnf list installed corosync-vqsim &>/dev/null; then - LOG_INFO "corosync-vqsim已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "corosync-vqsim未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有corosync-vqsim软件包 - LOG_INFO "检查yum源中是否有corosync-vqsim软件包" - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-vqsim软件包" - exit 255 - fi - - # 如果未安装,则安装corosync-vqsim - if [ "$already_installed" = false ]; then - LOG_INFO "安装corosync-vqsim软件包" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim失败" - fi - - # 测试同时使用-c、-o和-n参数 - LOG_INFO "测试corosync-vqsim同时使用-c、-o和-n参数" - corosync-vqsim -c 1 -o 2 -n 3 - CHECK_RESULT $? 0 0 "corosync-vqsim同时使用-c、-o和-n参数执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载corosync-vqsim软件包" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载corosync-vqsim失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_h.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_h.sh deleted file mode 100644 index e5df737e567..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_h.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 使用 -h 参数显示帮助文本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装corosync-vqsim软件包 - LOG_INFO "检查是否已安装corosync-vqsim软件包" - if rpm -q corosync-vqsim &>/dev/null; then - LOG_INFO "corosync-vqsim已安装" - installed=true - else - LOG_INFO "corosync-vqsim未安装" - installed=false - fi - - # 检查yum源中是否存在corosync-vqsim软件包 - LOG_INFO "检查yum源中是否存在corosync-vqsim软件包" - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum源中不存在corosync-vqsim软件包" - exit 255 - fi - - # 如果未安装,则安装corosync-vqsim软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装corosync-vqsim软件包" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim失败" - fi - - # 测试-h参数显示帮助文本 - LOG_INFO "测试-h参数显示帮助文本" - corosync-vqsim -h &>/dev/null - CHECK_RESULT $? 0 0 "执行corosync-vqsim -h失败" - - # 如果最初未安装,则卸载corosync-vqsim软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载corosync-vqsim软件包" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载corosync-vqsim失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_n.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_n.sh deleted file mode 100644 index 772b28b1ceb..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_n.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 使用 -n 参数禁用节点添加时的同步 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装corosync-vqsim - LOG_INFO "检查是否已安装corosync-vqsim" - if dnf list installed corosync-vqsim &>/dev/null; then - LOG_INFO "corosync-vqsim已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "corosync-vqsim未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有corosync-vqsim软件包 - LOG_INFO "检查yum源中是否有corosync-vqsim软件包" - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-vqsim软件包" - exit 255 - fi - - # 安装corosync-vqsim(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装corosync-vqsim" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim失败" - fi - - # 测试禁用节点添加时的同步功能(-n参数) - LOG_INFO "测试禁用节点添加时的同步功能(-n参数)" - if ! corosync-vqsim -n &>/dev/null; then - LOG_ERROR "-n参数不支持或执行失败" - exit 255 - fi - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载corosync-vqsim" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载corosync-vqsim失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_no_args.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_no_args.sh deleted file mode 100644 index 62b2df162a9..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_no_args.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试不使用任何参数(使用默认配置和输出到stdout) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试不使用任何参数(使用默认配置和输出到stdout)" - LOG_INFO "步骤1:检查测试环境是否已安装corosync-vqsim软件包" - if dnf list installed corosync-vqsim &>/dev/null; then - LOG_INFO "环境已安装corosync-vqsim软件包,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装corosync-vqsim软件包,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在corosync-vqsim软件包" - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-vqsim软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装corosync-vqsim软件包" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim软件包失败" - fi - - LOG_INFO "步骤4:执行corosync-vqsim命令,不使用任何参数" - corosync-vqsim - CHECK_RESULT $? 0 0 "corosync-vqsim命令执行失败" - - LOG_INFO "步骤5:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载corosync-vqsim软件包" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载corosync-vqsim软件包失败" - else - LOG_INFO "测试环境已安装corosync-vqsim软件包,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_o.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_o.sh deleted file mode 100644 index 967f0297229..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_o.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 使用 -o 参数指定输出文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装corosync-qsim软件包 - LOG_INFO "检查是否已安装corosync-qsim软件包" - if rpm -q corosync-qsim &>/dev/null; then - LOG_INFO "corosync-qsim已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "corosync-qsim未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有corosync-qsim软件包 - LOG_INFO "检查yum源中是否有corosync-qsim软件包" - if ! dnf list available corosync-qsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-qsim软件包" - exit 255 - fi - - # 如果未安装,则安装corosync-qsim - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装corosync-qsim软件包" - dnf install -y corosync-qsim - CHECK_RESULT $? 0 0 "安装corosync-qsim失败" - fi - - # 测试使用-o参数指定输出文件 - LOG_INFO "测试使用-o参数指定输出文件" - OUTPUT_FILE="/tmp/corosync-vqsim_output" - corosync-vqsim -o "$OUTPUT_FILE" - CHECK_RESULT $? 0 0 "执行corosync-vqsim -o失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否存在" - if [ -f "$OUTPUT_FILE" ]; then - LOG_INFO "输出文件创建成功: $OUTPUT_FILE" - else - LOG_ERROR "输出文件未创建" - exit 1 - fi - - # 清理环境 - LOG_INFO "清理环境" - rm -f "$OUTPUT_FILE" - - # 如果脚本开始时未安装corosync-qsim,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载corosync-qsim软件包" - dnf remove -y corosync-qsim - CHECK_RESULT $? 0 0 "卸载corosync-qsim失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_o_n.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_o_n.sh deleted file mode 100644 index e250a5e6a05..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_corosync-vqsim_o_n.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试同时使用-o和-n参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试corosync-vqsim同时使用-o和-n参数功能" - - # 检查corosync-vqsim软件包是否已在yum源中 - LOG_INFO "检查corosync-vqsim软件包在yum源中的可用性" - dnf list available corosync-vqsim > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到corosync-vqsim软件包" - exit 255 - fi - - # 检查系统是否已安装corosync-vqsim - LOG_INFO "检查系统是否已安装corosync-vqsim" - rpm -q corosync-vqsim > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装corosync-vqsim,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "系统未安装corosync-vqsim,将安装软件包作为测试步骤" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装corosync-vqsim软件包" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim失败" - fi - - # 检查corosync-vqsim命令的-o和-n参数是否支持 - LOG_INFO "检查corosync-vqsim命令是否支持-o和-n参数" - corosync-vqsim --help 2>&1 | grep -E "\-o|\-n" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "corosync-vqsim命令不支持-o或-n参数" - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - dnf remove -y corosync-vqsim - fi - exit 255 - fi - - # 测试同时使用-o和-n参数 - LOG_INFO "执行corosync-vqsim -o test_output -n test_node命令" - corosync-vqsim -o test_output -n test_node - CHECK_RESULT $? 0 0 "corosync-vqsim -o test_output -n test_node执行失败" - - # 清理测试生成的文件(如果存在) - LOG_INFO "清理测试生成的文件" - rm -f test_output - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载corosync-vqsim软件包" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载corosync-vqsim失败" - fi - - LOG_INFO "corosync-vqsim同时使用-o和-n参数测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_check_installed.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_check_installed.sh deleted file mode 100644 index b688fd50c39..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_check_installed.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试检查软件包是否已安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试检查软件包是否已安装 - LOG_INFO "开始测试检查软件包是否已安装功能" - - # 定义软件包名称 - PACKAGE_NAME="corosync-qsim" - - # 步骤1: 检查yum源中是否存在指定软件包 - LOG_INFO "步骤1: 检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2: 检查当前是否已安装指定软件包 - LOG_INFO "步骤2: 检查当前是否已安装${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME}软件包已安装,测试结束时保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME}软件包未安装,将在测试中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3: 安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "安装${PACKAGE_NAME}软件包成功" - fi - - # 步骤4: 验证软件包是否已正确安装 - LOG_INFO "步骤4: 验证${PACKAGE_NAME}软件包是否已正确安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "${PACKAGE_NAME}软件包未正确安装" - - # 步骤5: 检查软件包提供的命令是否可用 - LOG_INFO "步骤5: 检查${PACKAGE_NAME}软件包提供的命令" - # 这里假设corosync-qsim提供了corosync-qdevice命令,根据实际软件包调整 - COMMAND_NAME="corosync-qdevice" - which ${COMMAND_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "${COMMAND_NAME}命令不存在或不支持" - exit 255 - fi - LOG_INFO "${COMMAND_NAME}命令可用" - - # 步骤6: 测试命令基本功能 - LOG_INFO "步骤6: 测试${COMMAND_NAME}命令基本功能" - ${COMMAND_NAME} --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "${COMMAND_NAME}命令执行失败" - - # 步骤7: 环境恢复 - LOG_INFO "步骤7: 环境恢复" - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "卸载${PACKAGE_NAME}软件包成功" - else - LOG_INFO "保持${PACKAGE_NAME}软件包安装状态" - fi - - # 步骤8: 验证环境已恢复 - LOG_INFO "步骤8: 验证环境已恢复" - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "环境恢复失败,${PACKAGE_NAME}软件包仍存在" - exit 1 - else - LOG_INFO "环境恢复成功,${PACKAGE_NAME}软件包已卸载" - fi - else - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "环境恢复失败,${PACKAGE_NAME}软件包丢失" - LOG_INFO "环境恢复成功,${PACKAGE_NAME}软件包保持安装" - fi - - LOG_INFO "测试检查软件包是否已安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_default_run.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_default_run.sh deleted file mode 100644 index 30838ecf5b1..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_default_run.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试使用默认配置启动模拟器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用默认配置启动模拟器" - LOG_INFO "步骤1:检查corosync-qsim软件包是否已在yum源中" - if ! dnf list available corosync-qsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-qsim软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装corosync-qsim" - if rpm -q corosync-qsim &>/dev/null; then - INSTALLED=true - LOG_INFO "corosync-qsim已安装,脚本结束后将保持安装状态" - else - INSTALLED=false - LOG_INFO "corosync-qsim未安装,将进行安装" - fi - - LOG_INFO "步骤3:如果未安装,则安装corosync-qsim软件包" - if [ "$INSTALLED" = false ]; then - dnf install -y corosync-qsim - CHECK_RESULT $? 0 0 "安装corosync-qsim失败" - fi - - LOG_INFO "步骤4:检查corosync-qsim命令是否支持默认参数启动" - corosync-qsim --help 2>&1 | grep -q "default" - CHECK_RESULT $? 0 0 "corosync-qsim命令不支持默认参数启动" - - LOG_INFO "步骤5:使用默认配置启动corosync-qsim模拟器" - corosync-qsim --default - CHECK_RESULT $? 0 0 "使用默认配置启动模拟器失败" - - LOG_INFO "步骤6:清理环境,如果脚本开始时未安装则卸载软件包" - if [ "$INSTALLED" = false ]; then - dnf remove -y corosync-qsim - CHECK_RESULT $? 0 0 "卸载corosync-qsim失败" - LOG_INFO "已卸载corosync-qsim软件包,环境已恢复" - else - LOG_INFO "corosync-qsim保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成:测试使用默认配置启动模拟器" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_install.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_install.sh deleted file mode 100644 index d991f439e9a..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_install.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试软件包安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包安装功能" - - # 检查是否已安装corosync-qsim - LOG_INFO "检查corosync-qsim是否已安装" - if rpm -q corosync-qsim > /dev/null 2>&1; then - LOG_INFO "corosync-qsim已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "corosync-qsim未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有corosync-qsim软件包 - LOG_INFO "检查yum源中是否有corosync-qsim软件包" - if ! dnf list available corosync-qsim > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到corosync-qsim软件包" - exit 255 - fi - - # 安装corosync-qsim - LOG_INFO "安装corosync-qsim软件包" - if [ "$INSTALLED_BEFORE" = false ]; then - dnf install -y corosync-qsim - CHECK_RESULT $? 0 0 "安装corosync-qsim失败" - LOG_INFO "corosync-qsim安装成功" - else - LOG_INFO "corosync-qsim已安装,跳过安装步骤" - fi - - # 验证安装 - LOG_INFO "验证corosync-qsim安装" - rpm -q corosync-qsim - CHECK_RESULT $? 0 0 "验证corosync-qsim安装失败" - - # 测试corosync-qsim命令 - LOG_INFO "测试corosync-qsim命令" - if ! corosync-qsim --help > /dev/null 2>&1; then - LOG_ERROR "corosync-qsim命令执行失败或参数不支持" - exit 255 - fi - LOG_INFO "corosync-qsim命令测试成功" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载corosync-qsim软件包" - dnf remove -y corosync-qsim - CHECK_RESULT $? 0 0 "卸载corosync-qsim失败" - LOG_INFO "corosync-qsim卸载成功,环境已恢复" - else - LOG_INFO "保持corosync-qsim安装状态,无需卸载" - fi - - LOG_INFO "测试软件包安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_simulate_cluster.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_simulate_cluster.sh deleted file mode 100644 index b4b84e56ed9..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_simulate_cluster.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试模拟指定节点数的集群 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:模拟指定节点数的集群" - LOG_INFO "步骤1:检查环境是否已安装corosync-qsim软件包" - if rpm -q corosync-qsim &> /dev/null; then - LOG_INFO "corosync-qsim已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "corosync-qsim未安装,将在测试步骤中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有corosync-qsim软件包" - if ! dnf list available corosync-qsim &> /dev/null; then - LOG_ERROR "yum源中未找到corosync-qsim软件包" - exit 255 - fi - - LOG_INFO "步骤3:检查corosync-qsim命令是否支持模拟集群的参数" - if ! corosync-qsim --help 2>&1 | grep -q "simulate-cluster"; then - LOG_ERROR "corosync-qsim命令不支持模拟集群参数" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤4:安装corosync-qsim软件包" - dnf install -y corosync-qsim - CHECK_RESULT $? 0 0 "安装corosync-qsim失败" - fi - - LOG_INFO "步骤5:模拟指定节点数的集群,假设节点数为3" - corosync-qsim simulate-cluster --nodes 3 - CHECK_RESULT $? 0 0 "模拟集群失败" - - LOG_INFO "步骤6:验证集群模拟是否成功" - if systemctl status corosync-qsim &> /dev/null; then - LOG_INFO "集群模拟成功,corosync-qsim服务正在运行" - else - LOG_ERROR "集群模拟失败,corosync-qsim服务未运行" - exit 1 - fi - - LOG_INFO "步骤7:清理环境,恢复到之前的状态" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载corosync-qsim软件包" - dnf remove -y corosync-qsim - CHECK_RESULT $? 0 0 "卸载corosync-qsim失败" - else - LOG_INFO "保持corosync-qsim安装状态" - fi - - LOG_INFO "测试完成:模拟指定节点数的集群" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_start.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_start.sh deleted file mode 100644 index 0216fb84f3b..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_start.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试启动corosync-vqsim服务 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试启动corosync-vqsim服务" - - # 检查是否已安装corosync-vqsim - if rpm -q corosync-vqsim &>/dev/null; then - LOG_INFO "corosync-vqsim已安装" - installed=true - else - LOG_INFO "corosync-vqsim未安装" - installed=false - fi - - # 检查yum源中是否有corosync-vqsim软件包 - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-vqsim软件包" - exit 255 - fi - - # 如果未安装则进行安装 - if [ "$installed" = false ]; then - LOG_INFO "开始安装corosync-vqsim" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim失败" - LOG_INFO "corosync-vqsim安装成功" - fi - - # 检查corosync-vqsim服务是否支持start参数 - if ! systemctl list-unit-files | grep -q corosync-vqsim.service; then - LOG_ERROR "corosync-vqsim服务不存在或不支持" - exit 255 - fi - - # 启动corosync-vqsim服务 - LOG_INFO "启动corosync-vqsim服务" - systemctl start corosync-vqsim - CHECK_RESULT $? 0 0 "启动corosync-vqsim服务失败" - LOG_INFO "corosync-vqsim服务启动成功" - - # 检查服务状态是否为active - LOG_INFO "检查corosync-vqsim服务状态" - systemctl is-active corosync-vqsm &>/dev/null - CHECK_RESULT $? 0 0 "corosync-qvsm服务未运行" - - # 如果之前未安装则在测试结束后卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载coroysnc-qvsm软件包" - dnf remove -y coroysnc-qvsm - CHECK_RESULT $? 0 0 "卸载coroysnc-qvsm失败" - LOG_INFO “环境恢复完成” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_uninstall.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_uninstall.sh deleted file mode 100644 index 56b24ff1f5f..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_uninstall.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试软件包卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="corosync-vqsim" - TEST_COMMAND="corosync-vqsim" - TEST_OPTION="--help" - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包 $PACKAGE_NAME" - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则进行安装 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令 $TEST_COMMAND 是否存在" - which $TEST_COMMAND &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $TEST_COMMAND 不存在" - exit 255 - fi - - # 检查命令参数是否支持 - LOG_INFO "检查命令 $TEST_COMMAND 参数 $TEST_OPTION 是否支持" - $TEST_COMMAND $TEST_OPTION &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "命令 $TEST_COMMAND 不支持参数 $TEST_OPTION" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行命令 $TEST_COMMAND $TEST_OPTION" - $TEST_COMMAND $TEST_OPTION - CHECK_RESULT $? 0 0 "执行命令 $TEST_COMMAND $TEST_OPTION 失败" - - # 测试卸载功能 - LOG_INFO "测试卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 验证卸载是否成功 - LOG_INFO "验证软件包 $PACKAGE_NAME 是否已卸载" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载失败" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - fi - - # 环境恢复 - LOG_INFO "环境恢复" - if [ "$INSTALLED_BEFORE_TEST" = true ]; then - LOG_INFO "重新安装软件包 $PACKAGE_NAME 以恢复到初始状态" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "重新安装软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "初始状态未安装软件包 $PACKAGE_NAME,无需重新安装" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_verify_output.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_verify_output.sh deleted file mode 100644 index 450055d1434..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_verify_output.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试验证输出文件内容格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证输出文件内容格式" - - # 检查是否已安装corosync-qsim - LOG_INFO "检查corosync-qsim是否已安装" - if rpm -q corosync-qsim > /dev/null 2>&1; then - LOG_INFO "corosync-qsim已安装,测试完成后保持安装状态" - installed_before=true - else - LOG_INFO "corosync-qsim未安装,将在测试前安装" - installed_before=false - fi - - # 检查yum源中是否有corosync-qsim包 - LOG_INFO "检查yum源中是否有corosync-qsim包" - if ! dnf list available corosync-qsim > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到corosync-qsim包" - exit 255 - fi - - # 如果未安装,则安装corosync-qsim - if [ "$installed_before" = false ]; then - LOG_INFO "安装corosync-qsim" - dnf install -y corosync-qsim - CHECK_RESULT $? 0 0 "安装corosync-qsim失败" - fi - - # 检查corosync-qsim命令是否支持--output参数 - LOG_INFO "检查corosync-qsim命令是否支持--output参数" - if ! corosync-qsim --help 2>&1 | grep -q -- "--output"; then - LOG_ERROR "corosync-qsim命令不支持--output参数" - exit 255 - fi - - # 执行corosync-qsim命令生成输出文件 - LOG_INFO "执行corosync-qsim命令生成输出文件" - output_file="/tmp/corosync_qsim_output.txt" - corosync-qsim --output "$output_file" - CHECK_RESULT $? 0 0 "执行corosync-qsim命令失败" - - # 验证输出文件是否存在 - LOG_INFO "验证输出文件是否存在" - if [ ! -f "$output_file" ]; then - LOG_ERROR "输出文件未生成" - exit 1 - fi - - # 验证输出文件内容格式 - LOG_INFO "验证输出文件内容格式" - # 示例检查:文件非空且包含特定关键字(根据实际格式要求调整) - if [ -s "$output_file" ] && grep -q "expected_keyword" "$output_file"; then - LOG_INFO "输出文件内容格式符合预期" - else - LOG_ERROR "输出文件内容格式不符合预期" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$output_file" - - # 如果测试前未安装,则卸载corosync-qsim - if [ "$installed_before" = false ]; then - LOG_INFO "卸载corosync-qsim" - dnf remove -y corosync-qsim - CHECK_RESULT $? 0 0 "卸载corosync-qsim失败" - fi - - LOG_INFO "测试完成:验证输出文件内容格式" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_version.sh b/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_version.sh deleted file mode 100644 index e9aee30be7c..00000000000 --- a/testcases/function_test/pkg_test/corosync/corosync-vqsim/test_corosync-vqsim_function_version.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试显示版本信息" - - # 检查环境是否已安装corosync-vqsim - LOG_INFO "检查corosync-vqsim是否已安装" - if dnf list installed corosync-vqsim &>/dev/null; then - LOG_INFO "corosync-vqsim已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "corosync-vqsim未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有corosync-vqsim软件包 - LOG_INFO "检查yum源中是否有corosync-vqsim软件包" - if ! dnf list available corosync-vqsim &>/dev/null; then - LOG_ERROR "yum源中未找到corosync-vqsim软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装corosync-vqsim软件包" - dnf install -y corosync-vqsim - CHECK_RESULT $? 0 0 "安装corosync-vqsim失败" - fi - - # 测试显示版本信息 - LOG_INFO "执行corosync-vqsim --version命令" - corosync-vqsim --version - CHECK_RESULT $? 0 0 "执行corosync-vqsim --version失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载corosync-vqsim软件包" - dnf remove -y corosync-vqsim - CHECK_RESULT $? 0 0 "卸载corosync-vqsim失败" - fi - - LOG_INFO "测试完成:测试显示版本信息" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_basic_linking.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_basic_linking.sh deleted file mode 100644 index e56e5729a85..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_basic_linking.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试一个简单的C程序能否成功链接liblsan库(使用-lsan标志)并进行编译,验证其作为链接时库的基本可用性。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - TEST_PKG="gcc" - TEST_FILE="test_lsan.c" - TEST_BINARY="test_lsan" - TEST_SOURCE=" - #include - int main() { - int *p = malloc(10 * sizeof(int)); - free(p); - return 0; - } - " - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查yum源中是否存在$TEST_PKG软件包" - dnf list available $TEST_PKG &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在$TEST_PKG软件包" - exit 255 - fi - - # 判断环境是否已安装gcc - LOG_INFO "检查环境是否已安装$TEST_PKG" - rpm -q $TEST_PKG &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$TEST_PKG已安装,测试结束后保持安装状态" - PKG_INSTALLED=1 - else - LOG_INFO "$TEST_PKG未安装,将在测试过程中安装" - PKG_INSTALLED=0 - fi - - # 如果未安装,则安装gcc - if [ $PKG_INSTALLED -eq 0 ]; then - LOG_INFO "安装$TEST_PKG软件包" - dnf install -y $TEST_PKG - CHECK_RESULT $? 0 0 "安装$TEST_PKG失败" - fi - - # 创建测试C程序 - LOG_INFO "创建测试C程序文件" - echo "$TEST_SOURCE" > $TEST_FILE - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试编译链接liblsan库 - LOG_INFO "测试编译链接liblsan库" - gcc -o $TEST_BINARY $TEST_FILE -fsanitize=address -lsan - CHECK_RESULT $? 0 0 "编译链接liblsan库失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./$TEST_BINARY - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f $TEST_FILE $TEST_BINARY - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装gcc,则卸载 - if [ $PKG_INSTALLED -eq 0 ]; then - LOG_INFO "卸载$TEST_PKG软件包" - dnf remove -y $TEST_PKG - CHECK_RESULT $? 0 0 "卸载$TEST_PKG失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_check_installed.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_check_installed.sh deleted file mode 100644 index d4ac64fd378..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_check_installed.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试检查liblsan软件包是否已正确安装到系统中的功能,验证其文件(如库文件、头文件)是否存在于标准路径。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PKG_NAME="liblsan" - LOG_INFO "开始测试${PKG_NAME}软件包安装检查功能" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PKG_NAME}软件包" - dnf list available ${PKG_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PKG_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PKG_NAME}软件包" - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装${PKG_NAME}软件包" - rpm -q ${PKG_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "${PKG_NAME}软件包已安装,标记为保持安装状态" - INSTALLED_BEFORE="true" - else - LOG_INFO "${PKG_NAME}软件包未安装,标记为需要清理" - INSTALLED_BEFORE="false" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "步骤3:安装${PKG_NAME}软件包" - dnf install -y ${PKG_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装${PKG_NAME}软件包失败" - LOG_INFO "${PKG_NAME}软件包安装成功" - fi - - # 步骤4:验证库文件是否存在 - LOG_INFO "步骤4:验证${PKG_NAME}库文件是否存在" - LIB_FILES=$(rpm -ql ${PKG_NAME} | grep -E "\.so(\.|$)") - if [ -z "${LIB_FILES}" ]; then - LOG_ERROR "未找到${PKG_NAME}库文件" - CHECK_RESULT 1 0 0 "库文件检查失败" - else - LOG_INFO "找到${PKG_NAME}库文件:" - echo "${LIB_FILES}" - # 检查第一个库文件是否存在 - FIRST_LIB=$(echo "${LIB_FILES}" | head -1) - if [ -f "${FIRST_LIB}" ]; then - LOG_INFO "库文件${FIRST_LIB}存在" - CHECK_RESULT $? 0 0 "库文件存在性检查失败" - else - LOG_ERROR "库文件${FIRST_LIB}不存在" - CHECK_RESULT 1 0 0 "库文件存在性检查失败" - fi - fi - - # 步骤5:验证头文件是否存在(如果软件包包含头文件) - LOG_INFO "步骤5:验证${PKG_NAME}头文件是否存在" - HEADER_FILES=$(rpm -ql ${PKG_NAME} | grep -E "\.h$") - if [ -n "${HEADER_FILES}" ]; then - LOG_INFO "找到${PKG_NAME}头文件:" - echo "${HEADER_FILES}" - # 检查第一个头文件是否存在 - FIRST_HEADER=$(echo "${HEADER_FILES}" | head -1) - if [ -f "${FIRST_HEADER}" ]; then - LOG_INFO "头文件${FIRST_HEADER}存在" - CHECK_RESULT $? 0 0 "头文件存在性检查失败" - else - LOG_ERROR "头文件${FIRST_HEADER}不存在" - CHECK_RESULT 1 0 0 "头文件存在性检查失败" - fi - else - LOG_INFO "${PKG_NAME}软件包不包含头文件,跳过头文件检查" - fi - - # 步骤6:验证软件包文件完整性 - LOG_INFO "步骤6:验证${PKG_NAME}软件包文件完整性" - rpm -V ${PKG_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "${PKG_NAME}软件包文件完整性检查失败" - LOG_INFO "${PKG_NAME}软件包文件完整性验证通过" - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理测试环境" - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载测试安装的${PKG_NAME}软件包" - dnf remove -y ${PKG_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载${PKG_NAME}软件包失败" - LOG_INFO "${PKG_NAME}软件包卸载成功" - else - LOG_INFO "测试前${PKG_NAME}已安装,保持安装状态" - fi - - LOG_INFO "测试完成:${PKG_NAME}软件包安装检查功能验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_check_version.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_check_version.sh deleted file mode 100644 index afb16e74fef..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_check_version.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-29 -# @License : Mulan PSL v2 -# @Desc : 测试检查已安装liblsan软件包的版本信息,验证版本号可正常查询。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查已安装liblsan软件包的版本信息,验证版本号可正常查询。" - - # 步骤1:检查yum源中是否存在liblsan软件包 - LOG_INFO "检查yum源中是否存在liblsan软件包" - dnf list available liblsan --quiet - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到liblsan软件包" - exit 255 - fi - - # 步骤2:检查系统是否已安装liblsan软件包 - LOG_INFO "检查系统是否已安装liblsan软件包" - rpm -q liblsan - if [ $? -eq 0 ]; then - LOG_INFO "liblsan软件包已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "liblsan软件包未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 步骤3:如果未安装,则安装liblsan软件包 - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "开始安装liblsan软件包" - dnf install -y liblsan --quiet - CHECK_RESULT $? 0 0 "安装liblsan软件包失败" - LOG_INFO "liblsan软件包安装成功" - fi - - # 步骤4:检查liblsan软件包版本信息 - LOG_INFO "检查liblsan软件包版本信息" - rpm -q --queryformat "%{VERSION}-%{RELEASE}\n" liblsan - CHECK_RESULT $? 0 0 "查询liblsan软件包版本信息失败" - - # 步骤5:验证版本号格式 - LOG_INFO "验证版本号格式" - VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}\n" liblsan) - if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?-[0-9]+(\.[0-9]+)?(\.[0-9]+)?$ ]]; then - LOG_INFO "版本号格式正确:$VERSION" - else - LOG_ERROR "版本号格式不正确:$VERSION" - exit 1 - fi - - # 步骤6:清理环境,如果测试前未安装则卸载软件包 - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "清理环境:卸载liblsan软件包" - dnf remove -y liblsan --quiet - CHECK_RESULT $? 0 0 "卸载liblsan软件包失败" - LOG_INFO "liblsan软件包卸载成功" - else - LOG_INFO "测试前已安装liblsan软件包,保持安装状态" - fi - - LOG_INFO "测试完成:liblsan软件包版本信息检查成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_compile_link.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_compile_link.sh deleted file mode 100644 index d4c7398b15b..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_compile_link.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-29 -# @License : Mulan PSL v2 -# @Desc : 测试一个简单的C程序能否使用-lsan标志成功编译和链接liblsan库,验证其作为开发库的基本功能。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试liblsan库编译链接功能" - - # 检查是否已安装gcc和liblsan开发包 - LOG_INFO "检查gcc和libasan开发包是否已安装" - if rpm -q gcc libasan &> /dev/null; then - LOG_INFO "gcc和libasan已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "gcc和libasan未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 如果未安装,则尝试安装 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "尝试安装gcc和libasan开发包" - # 检查yum源中是否有gcc和libasan包 - LOG_INFO "检查yum源中是否有gcc包" - if ! dnf list available gcc &> /dev/null; then - LOG_ERROR "yum源中未找到gcc包" - exit 255 - fi - LOG_INFO "检查yum源中是否有libasan包" - if ! dnf list available libasan &> /dev/null; then - LOG_ERROR "yum源中未找到libasan包" - exit 255 - fi - - LOG_INFO "开始安装gcc和libasan" - dnf install -y gcc libasan - CHECK_RESULT $? 0 0 "安装gcc和libasan失败" - LOG_INFO "gcc和libasan安装成功" - fi - - # 创建测试C程序 - LOG_INFO "创建测试C程序test_liblsan.c" - cat > test_liblsan.c << "EOF" - #include - #include - - int main() { - int *p = (int*)malloc(sizeof(int)); - *p = 42; - printf("Value: %d\n", *p); - free(p); - return 0; - } - EOF - - # 编译测试程序,使用-lsan标志链接liblsan库 - LOG_INFO "编译测试程序,使用-lsan标志链接liblsan库" - gcc -fsanitize=address -o test_liblsan test_liblsan.c -lsan - CHECK_RESULT $? 0 0 "使用-lsan标志编译链接失败" - - # 运行测试程序 - LOG_INFO "运行编译后的测试程序" - ./test_liblsan - CHECK_RESULT $? 0 0 "运行测试程序失败" - - LOG_INFO "测试程序运行成功,输出符合预期" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_liblsan test_liblsan.c - - # 如果之前未安装,则卸载安装的软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载之前安装的gcc和libasan开发包" - dnf remove -y gcc libasan - CHECK_RESULT $? 0 0 "卸载gcc和libasan失败" - LOG_INFO "gcc和libasan卸载成功" - else - LOG_INFO "保持gcc和libasan的安装状态" - fi - - LOG_INFO "liblsan库编译链接功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_env_options.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_env_options.sh deleted file mode 100644 index ff4447838ae..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_env_options.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-29 -# @License : Mulan PSL v2 -# @Desc : 测试通过环境变量(如LSAN_OPTIONS)配置LSan运行行为(如设置退出码、过滤规则)是否生效。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试LSan环境变量配置功能" - LOG_INFO "步骤1: 检查lsan软件包是否在yum源中可用" - dnf list available lsan > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到lsan软件包" - LOG_INFO "步骤2: 检查系统是否已安装lsan" - rpm -q lsan > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "lsan已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "lsan未安装,将进行安装" - INSTALLED=0 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装lsan软件包" - dnf install -y lsan > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装lsan软件包失败" - fi - LOG_INFO "步骤4: 设置LSAN_OPTIONS环境变量并验证退出码配置" - export LSAN_OPTIONS="exitcode=42" - cat > test_lsan.c << "EOF" - #include - int main() { - char *x = malloc(10); - return 0; - } - EOF - gcc -fsanitize=leak -o test_lsan test_lsan.c 2>/dev/null - CHECK_RESULT $? 0 0 "编译测试程序失败" - ./test_lsan > /dev/null 2>&1 - CHECK_RESULT $? 42 0 "LSAN_OPTIONS设置的退出码未生效" - LOG_INFO "步骤5: 设置LSAN_OPTIONS环境变量并验证过滤规则" - export LSAN_OPTIONS="suppressions=./suppress.txt" - cat > suppress.txt << "EOF" - leak:main - EOF - cat > test_lsan2.c << "EOF" - #include - int main() { - char *x = malloc(10); - return 0; - } - EOF - gcc -fsanitize=leak -o test_lsan2 test_lsan2.c 2>/dev/null - CHECK_RESULT $? 0 0 "编译第二个测试程序失败" - ./test_lsan2 > output.txt 2>&1 - grep -q "LeakSanitizer" output.txt - CHECK_RESULT $? 1 0 "过滤规则未生效,内存泄漏未被抑制" - LOG_INFO "步骤6: 清理临时文件" - rm -f test_lsan test_lsan.c test_lsan2 test_lsan2.c output.txt suppress.txt - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7: 卸载lsan软件包" - dnf remove -y lsan > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载lsan软件包失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_install_package.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_install_package.sh deleted file mode 100644 index 56dd2d0bd03..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_install_package.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试通过包管理器(如apt, yum, dnf)安装liblsan软件包的功能,验证安装过程是否成功且无错误。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试liblsan软件包安装功能" - LOG_INFO "检查是否已安装liblsan软件包" - rpm -q liblsan > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "liblsan软件包已安装,测试将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "liblsan软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - LOG_INFO "检查yum源中是否存在liblsan软件包" - dnf list available liblsan > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到liblsan软件包" - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装liblsan软件包" - dnf install -y liblsan - CHECK_RESULT $? 0 0 "安装liblsan软件包失败" - fi - - LOG_INFO "验证liblsan软件包安装是否成功" - rpm -q liblsan > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "liblsan软件包未正确安装" - - LOG_INFO "测试liblsan相关命令是否可用" - lsan-cmd --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "liblsan相关命令不可用或参数不支持" - exit 255 - fi - - LOG_INFO "清理测试环境" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载测试安装的liblsan软件包" - dnf remove -y liblsan - CHECK_RESULT $? 0 0 "卸载liblsan软件包失败" - LOG_INFO "已恢复环境到测试前状态" - else - LOG_INFO "保持liblsan软件包安装状态" - fi - - LOG_INFO "liblsan软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_leak_report.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_leak_report.sh deleted file mode 100644 index 4917e94c563..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_leak_report.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-29 -# @License : Mulan PSL v2 -# @Desc : 测试一个包含内存泄漏的程序在启用LSan运行时,是否能被正确检测并生成详细的泄漏报告。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 检查软件包是否存在 - check_package_exist() { - local package_name=$1 - dnf list installed "$package_name" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $package_name 已安装" - return 0 - fi - dnf search "$package_name" | grep -q "^$package_name\." - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不存在于yum源中" - exit 255 - fi - LOG_INFO "软件包 $package_name 存在于yum源中" - return 1 - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "开始安装软件包 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 安装成功" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "开始卸载软件包 $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 卸载成功" - } - - # 检查命令参数是否支持 - check_command_option() { - local command=$1 - local option=$2 - $command --help 2>&1 | grep -q "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $option" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $option" - } - - # 清理函数,用于恢复环境 - cleanup() { - LOG_INFO "开始清理环境" - if [ "$originally_installed" = false ]; then - uninstall_package "gcc" - uninstall_package "liblsan" - fi - if [ -f "leak_program.c" ]; then - rm -f leak_program.c - LOG_INFO "已删除测试程序源文件" - fi - if [ -f "leak_program" ]; then - rm -f leak_program - LOG_INFO "已删除测试程序可执行文件" - fi - LOG_INFO "环境清理完成" - } - - # 主函数 - main() { - # 设置环境变量 - export LD_PRELOAD=/usr/lib64/liblsan.so.0 - export ASAN_OPTIONS=detect_leaks=1 - - # 检查软件包是否已安装 - local originally_installed=true - check_package_exist "gcc" - local gcc_installed=$? - check_package_exist "liblsan" - local liblsan_installed=$? - if [ $gcc_installed -ne 0 ] || [ $liblsan_installed -ne 0 ]; then - originally_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$originally_installed" = false ]; then - install_package "gcc" - install_package "liblsan" - fi - - # 检查gcc是否支持-fsanitize=leak参数 - LOG_INFO "检查gcc是否支持-fsanitize=leak参数" - check_command_option "gcc" "-fsanitize=leak" - - # 创建内存泄漏测试程序 - LOG_INFO "创建内存泄漏测试程序" - cat > leak_program.c << "EOF" - #include - #include - - void leak_memory() { - int *ptr = malloc(sizeof(int) * 100); - if (ptr == NULL) { - printf("Memory allocation failed\n"); - return; - } - // 故意不释放内存,造成内存泄漏 - printf("Memory allocated but not freed\n"); - } - - int main() { - leak_memory(); - return 0; - } - EOF - - # 编译测试程序,启用LSan检测 - LOG_INFO "编译测试程序,启用LSan检测" - gcc -fsanitize=leak -o leak_program leak_program.c - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序,检查是否生成泄漏报告 - LOG_INFO "运行测试程序,检查是否生成泄漏报告" - ./leak_program 2>&1 | grep -q "detected memory leaks" - CHECK_RESULT $? 0 0 "未检测到内存泄漏" - - # 检查泄漏报告是否详细 - LOG_INFO "检查泄漏报告是否详细" - ./leak_program 2>&1 | grep -q "leak_program.c" - CHECK_RESULT $? 0 0 "泄漏报告不详细,未显示源代码位置" - - LOG_INFO "测试通过:LSan成功检测到内存泄漏并生成了详细的泄漏报告" - - # 清理环境 - cleanup - } - - # 设置trap,确保脚本退出时清理环境 - trap cleanup EXIT - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_remove_package.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_remove_package.sh deleted file mode 100644 index 4575d7bd94b..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_remove_package.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试通过包管理器安全卸载liblsan软件包的功能,验证卸载过程是否干净且不影响系统其他组件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="liblsan" - LOG_INFO "步骤1:检查系统中是否已安装${PACKAGE_NAME}软件包" - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统中已安装${PACKAGE_NAME}软件包,记录当前状态。结束后将保持安装状态。" - ORIGINAL_STATE="INSTALLED" - else - LOG_INFO "系统中未安装${PACKAGE_NAME}软件包,将在测试前安装它。" - ORIGINAL_STATE="NOT_INSTALLED" - fi - - LOG_INFO "步骤2:检查YUM/DNF源中是否存在${PACKAGE_NAME}软件包" - dnf search "$PACKAGE_NAME" --quiet 2>&1 | grep "^${PACKAGE_NAME}\." > /dev/null - CHECK_RESULT $? 0 0 "YUM/DNF源中未找到${PACKAGE_NAME}软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "指定的软件包 ${PACKAGE_NAME} 在YUM源中不存在。" - exit 255 - fi - - LOG_INFO "步骤3:如果当前未安装,则安装${PACKAGE_NAME}软件包作为测试前提" - if [ "$ORIGINAL_STATE" == "NOT_INSTALLED" ]; then - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "成功安装${PACKAGE_NAME}软件包。" - fi - - LOG_INFO "步骤4:验证${PACKAGE_NAME}软件包能否正常卸载(模拟安全卸载)" - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "运行卸载前检查软件包状态失败" - if [ $? -eq 0 ]; then - LOG_INFO "执行dnf remove命令卸载${PACKAGE_NAME}..." - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包过程失败" - LOG_INFO "卸载命令执行完成。" - fi - - LOG_INFO "步骤5:检查卸载后系统是否残留关键文件或目录" - LOG_INFO "检查卸载后${PACKAGE_NAME}软件包状态..." - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 1 ]; then - LOG_INFO "软件包卸载成功,rpm查询确认已移除。" - else - LOG_ERROR "软件包卸载后,rpm查询仍然能找到该包,卸载不彻底。" - exit 255 - fi - - LOG_INFO "检查系统是否残留该软件包相关的关键共享库文件..." - find /usr/lib* /lib* -name "*lsan*" 2>/dev/null | head -5 - CHECK_RESULT $? 1 0 "卸载后系统中仍存在liblsan相关的关键库文件残留" - RESIDUAL_FILES=$(find /usr/lib* /lib* -name "*lsan*" 2>/dev/null | wc -l) - if [ "$RESIDUAL_FILES" -ne 0 ]; then - LOG_ERROR "发现${RESIDUAL_FILES}个疑似残留文件,卸载不干净。" - exit 255 - fi - LOG_INFO "未发现明显的软件包关键文件残留。" - - LOG_INFO "步骤6:检查卸载是否影响了系统其他核心组件(如gcc, glibc)" - LOG_INFO "检查gcc是否依然可以正常工作..." - gcc --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}后,gcc命令无法正常执行" - LOG_INFO "检查glibc是否依然可以正常工作..." - ldd --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}后,glibc相关工具(ldd)无法正常执行" - LOG_INFO "系统核心组件gcc和glibc功能正常。" - - LOG_INFO "步骤7:恢复测试环境至初始状态" - if [ "$ORIGINAL_STATE" == "NOT_INSTALLED" ]; then - LOG_INFO "初始状态未安装${PACKAGE_NAME},确认当前已卸载,无需操作。" - else - LOG_INFO "初始状态已安装${PACKAGE_NAME},重新安装以恢复到初始状态。" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "重新安装${PACKAGE_NAME}软件包以恢复环境失败" - LOG_INFO "已成功将${PACKAGE_NAME}软件包恢复到初始安装状态。" - fi - - LOG_INFO "步骤8:最终验证系统状态正常" - dnf check-update --quiet > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "环境恢复后DNF包管理器状态异常" - LOG_INFO "环境清理和恢复完成,系统状态正常。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_runtime_detection.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_runtime_detection.sh deleted file mode 100644 index 8f365bd0bdc..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_runtime_detection.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试一个包含内存泄漏的示例程序在启用LSan(通过环境变量如ASAN_OPTIONS)运行时,是否能被liblsan检测并报告泄漏信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试liblsan运行时内存泄漏检测功能" - - LOG_INFO "步骤1: 检查liblsan相关软件包是否已安装" - if rpm -q gcc libasan 2>/dev/null; then - LOG_INFO "liblsan相关软件包已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "liblsan相关软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2: 检查yum源中是否有需要的软件包" - if ! dnf list available gcc libasan 2>/dev/null | grep -q gcc; then - LOG_ERROR "yum源中缺少gcc软件包" - exit 255 - fi - if ! dnf list available gcc libasan 2>/dev/null | grep -q libasan; then - LOG_ERROR "yum源中缺少libasan软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装liblsan相关软件包" - dnf install -y gcc libasan - CHECK_RESULT $? 0 0 "安装liblsan相关软件包失败" - fi - - LOG_INFO "步骤4: 创建包含内存泄漏的测试程序" - cat > memory_leak.c << "EOF" - #include - #include - - void leak_memory() { - int *ptr = (int*)malloc(100 * sizeof(int)); - if (ptr == NULL) { - printf("内存分配失败\n"); - return; - } - for (int i = 0; i < 100; i++) { - ptr[i] = i; - } - printf("内存已分配但未释放\n"); - } - - int main() { - printf("开始内存泄漏测试程序\n"); - leak_memory(); - printf("程序执行完成\n"); - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建测试程序失败" - - LOG_INFO "步骤5: 编译测试程序并启用LSan检测" - gcc -fsanitize=address -o memory_leak memory_leak.c - CHECK_RESULT $? 0 0 "编译测试程序失败" - - LOG_INFO "步骤6: 设置LSan环境变量并运行测试程序" - export ASAN_OPTIONS="detect_leaks=1" - LOG_INFO "ASAN_OPTIONS设置为: $ASAN_OPTIONS" - - LOG_INFO "运行测试程序..." - ./memory_leak 2>&1 | tee test_output.log - RUN_RESULT=$? - - LOG_INFO "步骤7: 检查LSan是否检测到内存泄漏" - if grep -q "detected memory leaks" test_output.log; then - LOG_INFO "LSan成功检测到内存泄漏" - LEAK_DETECTED=1 - else - LOG_ERROR "LSan未检测到内存泄漏" - LEAK_DETECTED=0 - fi - - LOG_INFO "步骤8: 验证测试程序执行结果" - if [ $RUN_RESULT -eq 0 ]; then - LOG_INFO "测试程序执行完成" - if [ $LEAK_DETECTED -eq 1 ]; then - LOG_INFO "测试通过:LSan正确检测到内存泄漏" - else - LOG_ERROR "测试失败:程序有内存泄漏但LSan未检测到" - exit 1 - fi - else - LOG_ERROR "测试程序执行失败,退出码: $RUN_RESULT" - exit $RUN_RESULT - fi - - LOG_INFO "步骤9: 清理测试文件" - rm -f memory_leak.c memory_leak test_output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10: 卸载测试安装的软件包" - dnf remove -y gcc libasan - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "已恢复原始环境状态" - else - LOG_INFO "保持liblsan软件包安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_suppression.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_suppression.sh deleted file mode 100644 index 83be958e578..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_suppression.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用LSan抑制文件(suppression file)来忽略特定泄漏报告的功能是否正常工作。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试LSan抑制文件功能" - - # 检查yum源中是否存在需要的软件包 - LOG_INFO "检查yum源中是否存在liblsan0软件包" - if ! dnf list available liblsan0 2>/dev/null | grep -q liblsan0; then - LOG_ERROR "yum源中不存在liblsan0软件包" - exit 255 - fi - - # 检查是否已安装liblsan0 - LOG_INFO "检查系统是否已安装liblsan0" - if rpm -q liblsan0 >/dev/null 2>&1; then - already_installed=true - LOG_INFO "liblsan0已安装,测试完成后将保持安装状态" - else - already_installed=false - LOG_INFO "liblsan0未安装,将在测试完成后卸载" - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "安装liblsan0软件包" - dnf install -y liblsan0 - CHECK_RESULT $? 0 0 "安装liblsan0失败" - fi - - # 创建测试程序 - LOG_INFO "创建测试程序" - cat > test_leak.c << "EOF" - #include - #include - - void intentional_leak() { - void *p = malloc(100); - printf("故意泄漏内存: %p\n", p); - } - - void suppressed_leak() { - void *p = malloc(200); - printf("应该被抑制的泄漏: %p\n", p); - } - - int main() { - intentional_leak(); - suppressed_leak(); - return 0; - } - EOF - - # 创建抑制文件 - LOG_INFO "创建LSan抑制文件" - cat > suppression.txt << "EOF" - leak:suppressed_leak - EOF - - # 编译测试程序 - LOG_INFO "编译测试程序" - gcc -fsanitize=address -fno-omit-frame-pointer -o test_leak test_leak.c - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 测试不带抑制文件的运行 - LOG_INFO "测试不带抑制文件的运行" - output=$(ASAN_OPTIONS=detect_leaks=1 ./test_leak 2>&1) - echo "$output" | grep -q "故意泄漏内存" - CHECK_RESULT $? 0 0 "未检测到故意泄漏" - echo "$output" | grep -q "应该被抑制的泄漏" - CHECK_RESULT $? 0 0 "未检测到应该被抑制的泄漏" - - # 测试带抑制文件的运行 - LOG_INFO "测试带抑制文件的运行" - output=$(ASAN_OPTIONS="detect_leaks=1:suppressions=suppression.txt" ./test_leak 2>&1) - echo "$output" | grep -q "故意泄漏内存" - CHECK_RESULT $? 0 0 "抑制文件运行未检测到故意泄漏" - echo "$output" | grep -q "应该被抑制的泄漏" && { LOG_ERROR "抑制文件未生效"; exit 1; } - CHECK_RESULT $? 1 0 "抑制文件未正确工作" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_leak.c test_leak suppression.txt - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载liblsan0软件包" - dnf remove -y liblsan0 - CHECK_RESULT $? 0 0 "卸载liblsan0失败" - fi - - LOG_INFO "LSan抑制文件功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_uninstall.sh b/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_uninstall.sh deleted file mode 100644 index 4c07c45bad9..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan/test_liblsan_function_uninstall.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-29 -# @License : Mulan PSL v2 -# @Desc : 验证通过包管理器安全卸载liblsan软件包,确保卸载后相关文件被移除且不影响核心系统。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="liblsan" - LOG_INFO "开始测试:验证通过包管理器安全卸载liblsan软件包,确保卸载后相关文件被移除且不影响核心系统。" - LOG_INFO "步骤1:检查yum源中是否存在$PACKAGE_NAME软件包。" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到$PACKAGE_NAME软件包。" - exit 255 - fi - LOG_INFO "步骤2:检查当前环境中$PACKAGE_NAME软件包是否已安装。" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - IS_INSTALLED=$? - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "环境中$PACKAGE_NAME已安装,测试将执行卸载操作,并在结束后重新安装。" - NEED_REINSTALL=1 - else - LOG_INFO "环境中$PACKAGE_NAME未安装,测试将执行安装和卸载操作,并在结束后保持未安装状态。" - NEED_REINSTALL=0 - fi - if [ $NEED_REINSTALL -eq 0 ]; then - LOG_INFO "步骤3:安装$PACKAGE_NAME软件包。" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME软件包失败。" - fi - LOG_INFO "步骤4:验证$PACKAGE_NAME软件包安装成功,相关文件存在。" - rpm -ql $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装后,$PACKAGE_NAME软件包文件列表获取失败。" - LOG_INFO "步骤5:卸载$PACKAGE_NAME软件包。" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME软件包失败。" - LOG_INFO "步骤6:验证$PACKAGE_NAME软件包已被卸载,相关文件已移除。" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "卸载后,$PACKAGE_NAME软件包查询仍成功(应失败)。" - LOG_INFO "步骤7:验证核心系统功能未受影响(示例:检查ls命令是否正常)。" - ls / > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载后,核心系统命令ls执行异常。" - if [ $NEED_REINSTALL -eq 1 ]; then - LOG_INFO "步骤8:恢复环境,重新安装$PACKAGE_NAME软件包。" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "重新安装$PACKAGE_NAME软件包失败。" - LOG_INFO "环境已恢复至初始安装状态。" - else - LOG_INFO "步骤8:环境已恢复至初始未安装状态。" - fi - LOG_INFO "测试完成:$PACKAGE_NAME软件包安全卸载验证通过。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glib2/glib2-tests/test_glib2-tests_function_dependency.sh b/testcases/function_test/pkg_test/glib2/glib2-tests/test_glib2-tests_function_dependency.sh deleted file mode 100644 index 5669797e54d..00000000000 --- a/testcases/function_test/pkg_test/glib2/glib2-tests/test_glib2-tests_function_dependency.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试glib2-tests软件包的依赖关系,验证其依赖的GLib库功能是否正常可用。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试glib2-tests软件包的依赖关系,验证其依赖的GLib库功能是否正常可用 - LOG_INFO "开始测试glib2-tests软件包的依赖关系" - - # 检查环境是否已安装glib2-tests软件包 - LOG_INFO "检查环境中是否已安装glib2-tests软件包" - rpm -q glib2-tests > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到glib2-tests软件包已安装,脚本结束后将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "未检测到glib2-tests软件包,将在测试过程中安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有glib2-tests软件包 - LOG_INFO "检查yum源中是否有glib2-tests软件包" - dnf list available glib2-tests > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到glib2-tests软件包" - exit 255 - fi - - # 如果未安装,则安装glib2-tests软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装glib2-tests软件包" - dnf install -y glib2-tests > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装glib2-tests软件包失败" - LOG_INFO "glib2-tests软件包安装成功" - fi - - # 验证glib2-tests软件包是否正确安装 - LOG_INFO "验证glib2-tests软件包是否正确安装" - rpm -q glib2-tests > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "glib2-tests软件包未正确安装" - - # 检查glib2-tests依赖的GLib库功能是否正常可用 - LOG_INFO "检查glib2-tests依赖的GLib库功能是否正常可用" - # 使用glib2-tests提供的测试工具验证GLib库功能 - if [ -x /usr/libexec/installed-tests/glib/glib-testing ]; then - LOG_INFO "使用glib-testing工具验证GLib库功能" - /usr/libexec/installed-tests/glib/glib-testing --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "glib-testing工具执行失败,GLib库功能可能异常" - LOG_INFO "GLib库功能验证通过" - else - LOG_INFO "未找到glib-testing工具,尝试其他验证方式" - # 尝试使用glib2-tests中的其他测试工具 - if [ -f /usr/libexec/installed-tests/glib/gobject-test ]; then - LOG_INFO "使用gobject-test工具验证GLib库功能" - /usr/libexec/installed-tests/glib/gobject-test --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "gobject-test工具执行失败,GLib库功能可能异常" - LOG_INFO "GLib库功能验证通过" - else - LOG_INFO "尝试使用glib2-tests中的测试套件验证" - # 运行一个简单的GLib功能测试 - gdbus --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "gdbus命令执行失败,GLib库功能可能异常" - LOG_INFO "GLib库功能验证通过" - fi - fi - - # 验证glib2-tests的依赖关系 - LOG_INFO "验证glib2-tests的依赖关系" - rpm -qR glib2-tests > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取glib2-tests依赖关系失败" - - # 检查主要依赖包是否存在 - LOG_INFO "检查glib2-tests主要依赖包" - for pkg in glib2 glib2-devel; do - rpm -q $pkg > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "glib2-tests依赖的$pkg包未安装" - LOG_INFO "依赖包$pkg已正确安装" - done - - # 清理环境:如果测试前未安装glib2-tests,则卸载它 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "清理测试环境,卸载glib2-tests软件包" - dnf remove -y glib2-tests > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载glib2-tests软件包失败" - LOG_INFO "glib2-tests软件包卸载成功" - else - LOG_INFO "保持glib2-tests软件包安装状态" - fi - - LOG_INFO "glib2-tests软件包依赖关系测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glib2/glib2-tests/test_glib2-tests_function_run.sh b/testcases/function_test/pkg_test/glib2/glib2-tests/test_glib2-tests_function_run.sh deleted file mode 100644 index 622a2a99cdc..00000000000 --- a/testcases/function_test/pkg_test/glib2/glib2-tests/test_glib2-tests_function_run.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试运行glib2-tests软件包自带的测试套件,验证核心功能是否正常。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装glib2-tests软件包 - LOG_INFO "检查是否已安装glib2-tests软件包" - CHECK_PKG=$(dnf list installed glib2-tests 2>/dev/null | grep glib2-tests) - if [ -n "${CHECK_PKG}" ]; then - LOG_INFO "glib2-tests已安装,标识为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "glib2-tests未安装,标识为未安装状态,将执行安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有glib2-tests软件包,如果没有则退出 - LOG_INFO "检查yum源中是否存在glib2-tests软件包" - dnf list available glib2-tests &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到glib2-tests软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中无glib2-tests软件包" - exit 255 - fi - - # 若未安装,则安装glib2-tests - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "开始安装glib2-tests软件包" - dnf install -y glib2-tests &>/dev/null - CHECK_RESULT $? 0 0 "安装glib2-tests失败" - LOG_INFO "glib2-tests安装成功" - fi - - # 检查glib2-tests是否提供测试命令,这里假设使用 glib2-tests-run 命令 - LOG_INFO "检查测试命令 glib2-tests-run 是否存在" - command -v glib2-tests-run &>/dev/null - CHECK_RESULT $? 0 0 "glib2-tests-run 命令不存在或不支持" - if [ $? -ne 0 ]; then - LOG_ERROR "glib2-tests-run 命令不存在或不支持" - exit 255 - fi - - # 执行glib2-tests-run命令 - LOG_INFO "开始运行glib2-tests软件包自带的测试套件" - glib2-tests-run - CHECK_RESULT $? 0 0 "运行glib2-tests测试套件失败" - - # 清理环境,恢复到之前的状态 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "脚本开始安装的glib2-tests软件包,现在进行卸载" - dnf remove -y glib2-tests &>/dev/null - CHECK_RESULT $? 0 0 "卸载glib2-tests失败" - LOG_INFO "glib2-tests卸载成功" - else - LOG_INFO "环境已安装glib2-tests软件包,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_clipboard.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_clipboard.sh deleted file mode 100644 index 38f9cc10127..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_clipboard.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test clipboard sharing -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=${4:-root} - - sshpass -p "$password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$user@$ip" "$cmd" - } - - # 测试用例描述 - LOG_INFO "Test clipboard sharing" - - # 步骤1:检查是否已安装gtk-vnc2软件包 - LOG_INFO "步骤1:检查gtk-vnc2软件包是否已安装" - if rpm -q gtk-vnc2 >/dev/null 2>&1; then - LOG_INFO "gtk-vnc2已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "gtk-vnc2未安装,将在测试过程中安装并在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - # 步骤2:检查yum源中是否有gtk-vnc2软件包 - LOG_INFO "步骤2:检查yum源中是否有gtk-vnc2软件包" - if ! dnf list available gtk-vnc2 >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装gtk-vnc2 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2失败" - fi - - # 步骤4:检查gtk-vnc2相关命令是否存在 - LOG_INFO "步骤4:检查gtk-vnc2相关命令" - if ! command -v gvncviewer >/dev/null 2>&1; then - LOG_ERROR "gvncviewer命令不存在" - exit 255 - fi - - # 步骤5:测试剪贴板共享功能 - LOG_INFO "步骤5:测试剪贴板共享功能" - # 检查gvncviewer是否支持剪贴板参数 - if ! gvncviewer --help 2>&1 | grep -q "clipboard"; then - LOG_ERROR "gvncviewer不支持剪贴板参数" - exit 255 - fi - - # 模拟剪贴板共享测试 - LOG_INFO "步骤6:执行剪贴板共享测试" - # 这里使用一个简单的测试,实际测试可能需要启动VNC服务器 - # 由于测试环境限制,这里只检查命令基本功能 - echo "测试剪贴板功能" | gvncviewer --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "剪贴板功能测试失败" - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理测试环境" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2失败" - else - LOG_INFO "保持gtk-vnc2安装状态" - fi - - LOG_INFO "测试完成:剪贴板共享功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_connect.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_connect.sh deleted file mode 100644 index e7a8d977ea9..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_connect.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-25 -# @License : Mulan PSL v2 -# @Desc : Test connection to VNC server -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_gtk-vnc2_function_connect - - # 步骤1:检查是否已安装gtk-vnc2 - LOG_INFO "检查是否已安装gtk-vnc2" - rpm -q gtk-vnc2 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gtk-vnc2已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "gtk-vnc2未安装,脚本结束时将卸载" - installed=false - fi - - # 步骤2:检查yum源中是否有gtk-vnc2 - LOG_INFO "检查yum源中是否有gtk-vnc2" - dnf list available gtk-vnc2 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - # 步骤3:安装gtk-vnc2 - if [ "$installed" = false ]; then - LOG_INFO "安装gtk-vnc2" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2失败" - fi - - # 步骤4:测试连接到VNC服务器 - LOG_INFO "测试连接到VNC服务器" - vncviewer --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "vncviewer命令不存在或不支持" - exit 255 - fi - - # 模拟连接测试(假设VNC服务器地址为localhost:1) - LOG_INFO "尝试连接到VNC服务器(模拟)" - vncviewer localhost:1 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "连接到VNC服务器失败" - - # 步骤5:清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载gtk-vnc2" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2失败" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_display.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_display.sh deleted file mode 100644 index 392c6027396..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_display.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test basic display of VNC window -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic display of VNC window" - - LOG_INFO "步骤1:检查系统是否已安装gtk-vnc2软件包" - if rpm -q gtk-vnc2 &> /dev/null; then - LOG_INFO "gtk-vnc2已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "gtk-vnc2未安装,将在测试过程中安装,并在脚本结束前卸载" - ALREADY_INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有gtk-vnc2软件包" - if ! dnf list available gtk-vnc2 &> /dev/null; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2失败" - fi - - LOG_INFO "步骤4:检查gtk-vnc2命令是否支持--help参数" - gtk-vnc-2.0 --help &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "gtk-vnc2命令不支持--help参数或命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:执行gtk-vnc2基本显示测试" - gtk-vnc-2.0 --help | grep -q "Usage:" - CHECK_RESULT $? 0 0 "gtk-vnc2基本显示测试失败" - - LOG_INFO "步骤6:清理测试环境" - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "卸载gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2失败" - else - LOG_INFO "保持gtk-vnc2安装状态" - fi - - LOG_INFO "测试完成:Test basic display of VNC window" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_encryption.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_encryption.sh deleted file mode 100644 index b49ff942bcc..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_encryption.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test encryption options -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断gtk-vnc2软件包是否可用 - LOG_INFO "检查yum源中是否存在gtk-vnc2软件包" - dnf list available gtk-vnc2 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - # 检查是否已安装gtk-vnc2 - LOG_INFO "检查gtk-vnc2是否已安装" - rpm -q gtk-vnc2 > /dev/null 2>&1 - INSTALLED=$? - - # 记录初始安装状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "gtk-vnc2已安装,测试结束后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "gtk-vnc2未安装,将在测试结束后卸载" - NEED_CLEANUP=1 - fi - - # 如果未安装,则安装软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2失败" - fi - - # 测试加密选项 - LOG_INFO "测试gtk-vnc2的加密选项" - - # 检查vncviewer命令是否支持加密选项 - LOG_INFO "检查vncviewer命令是否支持加密选项" - vncviewer --help 2>&1 | grep -i "encrypt" > /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "vncviewer命令不支持加密选项" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理环境:卸载gtk-vnc2" - dnf remove -y gtk-vnc2 - fi - exit 255 - fi - - # 测试使用加密选项连接(预期会失败,因为需要实际的VNC服务器) - LOG_INFO "测试使用加密选项连接VNC服务器" - vncviewer -encodings "copyrect hextile" localhost:1 > /dev/null 2>&1 - # 这里预期会失败,因为localhost:1没有VNC服务器 - # 我们主要测试命令参数是否被正确解析和执行 - CHECK_RESULT $? 0 1 "加密选项测试异常" - - # 测试无效加密选项 - LOG_INFO "测试无效加密选项" - vncviewer -encodings "invalid_encoding" localhost:1 2>&1 | grep -i "error\|invalid\|unsupported" > /dev/null - CHECK_RESULT $? 0 0 "无效加密选项未按预期处理" - - # 清理环境 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理环境:卸载gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2失败" - else - LOG_INFO "保持gtk-vnc2安装状态,不进行卸载" - fi - - LOG_INFO "加密选项测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_install.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_install.sh deleted file mode 100644 index c293ee7f413..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_install.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test installation of gtk-vnc2 package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "测试用例:Test installation of gtk-vnc2 package" - - LOG_INFO "步骤1:检查yum源中是否存在gtk-vnc2软件包" - if ! dnf list available gtk-vnc2 &>/dev/null; then - LOG_ERROR "yum源中不存在gtk-vnc2软件包" - exit 255 - fi - LOG_INFO "yum源中存在gtk-vnc2软件包" - - LOG_INFO "步骤2:检查系统是否已安装gtk-vnc2" - if rpm -q gtk-vnc2 &>/dev/null; then - LOG_INFO "系统已安装gtk-vnc2,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "系统未安装gtk-vnc2,标记为未安装状态" - INSTALLED="false" - fi - - LOG_INFO "步骤3:如果未安装,则安装gtk-vnc2软件包" - if [ "$INSTALLED" = "false" ]; then - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2软件包失败" - LOG_INFO "安装gtk-vnc2软件包成功" - fi - - LOG_INFO "步骤4:验证gtk-vnc2命令是否可用" - if ! command -v gtk-vnc2 &>/dev/null; then - LOG_ERROR "gtk-vnc2命令不存在或不支持" - exit 255 - fi - LOG_INFO "gtk-vnc2命令可用" - - LOG_INFO "步骤5:执行一个简单的gtk-vnc2命令测试" - gtk-vnc2 --help &>/dev/null - CHECK_RESULT $? 0 0 "执行gtk-vnc2 --help命令失败" - - LOG_INFO "步骤6:环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载在测试过程中安装的gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2软件包失败" - LOG_INFO "卸载gtk-vnc2软件包成功" - else - LOG_INFO "测试前已安装gtk-vnc2,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_keyboard.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_keyboard.sh deleted file mode 100644 index 2b0412f38b3..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_keyboard.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test keyboard input simulation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试键盘输入模拟功能 - - LOG_INFO "开始测试键盘输入模拟功能" - - # 定义软件包名称 - PACKAGE_NAME="gtk-vnc2" - LOG_INFO "检查系统中是否已安装${PACKAGE_NAME}" - - # 检查软件包是否已安装 - if rpm -q ${PACKAGE_NAME} >/dev/null 2>&1; then - LOG_INFO "${PACKAGE_NAME}已安装,标记为需要保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "${PACKAGE_NAME}未安装,标记为需要清理安装" - KEEP_INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "${KEEP_INSTALLED}" = "false" ]; then - LOG_INFO "开始安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - LOG_INFO "${PACKAGE_NAME}软件包安装成功" - fi - - # 测试gtk-vnc2的基本功能 - LOG_INFO "测试gtk-vnc2的基本功能" - if ! command -v gtk-vnc-2.0 >/dev/null 2>&1; then - LOG_ERROR "gtk-vnc-2.0命令不存在" - exit 255 - fi - - # 检查gtk-vnc2支持的参数 - LOG_INFO "检查gtk-vnc2支持的参数" - gtk-vnc-2.0 --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "gtk-vnc-2.0命令执行失败" - - # 测试键盘输入模拟功能 - LOG_INFO "测试键盘输入模拟功能" - # 创建一个临时的VNC服务器进行测试 - LOG_INFO "启动临时VNC服务器进行键盘输入测试" - vncserver :99 -geometry 800x600 -localhost >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "启动VNC服务器失败" - - # 等待VNC服务器启动 - sleep 2 - - # 测试键盘输入功能 - LOG_INFO "模拟键盘输入测试" - # 这里使用expect工具来模拟键盘输入 - if command -v expect >/dev/null 2>&1; then - LOG_INFO "使用expect工具进行键盘输入模拟" - # 创建一个简单的expect脚本测试键盘输入 - cat > /tmp/test_keyboard.exp << "EOF" - #!/usr/bin/expect - spawn gtk-vnc-2.0 localhost:99 - expect "Password:" - send "test\r" - expect eof - EOF - chmod +x /tmp/test_keyboard.exp - timeout 5 /tmp/test_keyboard.exp >/dev/null 2>&1 - CHECK_RESULT $? 0 124 "键盘输入模拟测试失败" - else - LOG_INFO "expect工具未安装,跳过复杂的键盘输入模拟测试" - LOG_INFO "执行基本的gtk-vnc2连接测试" - timeout 3 gtk-vnc-2.0 --help >/dev/null 2>&1 - CHECK_RESULT $? 0 124 "gtk-vnc2基本功能测试失败" - fi - - # 清理临时VNC服务器 - LOG_INFO "清理临时VNC服务器" - vncserver -kill :99 >/dev/null 2>&1 - rm -f /tmp/.X99-lock /tmp/.X11-unix/X99 - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/test_keyboard.exp - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ "${KEEP_INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "${PACKAGE_NAME}软件包卸载成功" - else - LOG_INFO "保持${PACKAGE_NAME}软件包安装状态" - fi - - LOG_INFO "键盘输入模拟功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_launch.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_launch.sh deleted file mode 100644 index 81942026407..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_launch.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test launching gtk-vnc2 viewer -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试用例:Test launching gtk-vnc2 viewer" - - LOG_INFO "步骤1:检查yum源中是否存在gtk-vnc2软件包" - dnf list available gtk-vnc2 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查gtk-vnc2是否已经安装" - rpm -q gtk-vnc2 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gtk-vnc2已经安装,测试结束将保持安装状态" - INSTALLED=true - else - LOG_INFO "gtk-vnc2未安装,将在测试步骤中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2失败" - fi - - LOG_INFO "步骤4:检查gtk-vnc2命令参数是否支持" - gtk-vnc2 --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "gtk-vnc2命令参数不支持或命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:尝试启动gtk-vnc2 viewer(无连接)" - timeout 2 gtk-vnc2 --help > /dev/null 2>&1 - CHECK_RESULT $? 0 124 "gtk-vnc2 viewer启动失败" - - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2失败" - else - LOG_INFO "保持gtk-vnc2安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_mouse.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_mouse.sh deleted file mode 100644 index 8611062539e..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_mouse.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test mouse input simulation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:模拟鼠标输入功能测试" - - # 检查是否已安装gtk-vnc2软件包 - LOG_INFO "步骤1:检查gtk-vnc2软件包是否已安装" - if dnf list installed gtk-vnc2 &> /dev/null; then - LOG_INFO "gtk-vnc2已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "gtk-vnc2未安装,将在测试步骤中安装" - INSTALLED_BEFORE_TEST=0 - fi - - # 检查yum源中是否有gtk-vnc2软件包 - LOG_INFO "步骤2:检查yum源中是否存在gtk-vnc2软件包" - if ! dnf list available gtk-vnc2 &> /dev/null; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤3:安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2软件包失败" - fi - - # 检查gtk-vnc2命令是否存在 - LOG_INFO "步骤4:检查gtk-vnc2命令是否存在" - if ! command -v gtk-vnc2 &> /dev/null; then - LOG_ERROR "gtk-vnc2命令不存在" - exit 255 - fi - - # 测试鼠标输入模拟功能 - LOG_INFO "步骤5:测试鼠标输入模拟功能" - # 这里假设gtk-vnc2支持鼠标输入模拟,具体参数根据实际软件调整 - # 示例:gtk-vnc2 --mouse-input-test - # 如果参数不存在或不支持,则退出 - if ! gtk-vnc2 --help | grep -q "mouse-input-test"; then - LOG_ERROR "gtk-vnc2不支持鼠标输入模拟参数" - exit 255 - fi - - # 执行鼠标输入模拟测试 - gtk-vnc2 --mouse-input-test - CHECK_RESULT $? 0 0 "鼠标输入模拟测试失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2软件包失败" - else - LOG_INFO "步骤6:保持gtk-vnc2软件包安装状态" - fi - - LOG_INFO "测试完成:鼠标输入模拟功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_scaling.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_scaling.sh deleted file mode 100644 index 3b5be0f0670..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_scaling.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test display scaling options -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test display scaling options" - - # 环境检查 - LOG_INFO "步骤1:检查gtk-vnc2软件包是否已安装" - if rpm -q gtk-vnc2 &>/dev/null; then - LOG_INFO "gtk-vnc2已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "gtk-vnc2未安装,将在测试前安装,测试后卸载" - INSTALLED_BEFORE_TEST=false - fi - - # 检查yum源中是否存在gtk-vnc2软件包 - LOG_INFO "步骤2:检查yum源中是否存在gtk-vnc2软件包" - if ! dnf list available gtk-vnc2 &>/dev/null; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2失败" - fi - - # 检查gtk-vnc2命令是否存在 - LOG_INFO "步骤4:检查gtk-vnc2命令是否存在" - if ! command -v gtk-vnc2 &>/dev/null; then - LOG_ERROR "gtk-vnc2命令不存在" - exit 255 - fi - - # 测试display scaling选项 - LOG_INFO "步骤5:测试display scaling选项" - # 假设gtk-vnc2支持--scaling参数,这里仅作示例检查 - if ! gtk-vnc2 --help | grep -q "scaling"; then - LOG_ERROR "gtk-vnc2不支持scaling参数" - exit 255 - fi - - # 执行具体的scaling测试命令(示例命令,实际根据gtk-vnc2文档调整) - LOG_INFO "步骤6:执行scaling测试命令" - gtk-vnc2 --scaling=on dummy-host &>/dev/null - CHECK_RESULT $? 0 0 "执行scaling测试命令失败" - - # 清理环境 - LOG_INFO "步骤7:清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2失败" - else - LOG_INFO "保持gtk-vnc2软件包安装状态" - fi - - LOG_INFO "测试完成:Test display scaling options" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_uninstall.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_uninstall.sh deleted file mode 100644 index 91dbd6ff74a..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_uninstall.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of gtk-vnc2 package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:卸载gtk-vnc2软件包" - - LOG_INFO "步骤1:检查yum源中是否存在gtk-vnc2软件包" - dnf list available gtk-vnc2 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前是否已安装gtk-vnc2软件包" - rpm -q gtk-vnc2 > /dev/null 2>&1 - installed=$? - if [ $installed -eq 0 ]; then - LOG_INFO "检测到gtk-vnc2已安装,测试结束后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "检测到gtk-vnc2未安装,将在测试前安装" - need_cleanup=1 - fi - - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "步骤3:安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2失败" - fi - - LOG_INFO "步骤4:验证gtk-vnc2软件包功能" - which gtk-vnc-viewer > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "gtk-vnc2软件包功能验证失败" - - LOG_INFO "步骤5:卸载gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2失败" - - LOG_INFO "步骤6:验证卸载是否成功" - rpm -q gtk-vnc2 > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "卸载后仍检测到gtk-vnc2软件包" - - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "步骤7:清理环境,重新安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "重新安装gtk-vnc2失败" - else - LOG_INFO "步骤7:恢复原始安装状态" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "恢复gtk-vnc2安装状态失败" - fi - - LOG_INFO "步骤8:最终验证" - rpm -q gtk-vnc2 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "最终验证失败,gtk-vnc2未正确安装" - - LOG_INFO "测试完成:gtk-vnc2软件包卸载功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_version.sh b/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_version.sh deleted file mode 100644 index 78ce5e74644..00000000000 --- a/testcases/function_test/pkg_test/gtk-vnc/gtk-vnc2/test_gtk-vnc2_function_version.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test version query of gtk-vnc2 package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试gtk-vnc2软件包的版本查询功能" - - LOG_INFO "步骤1:检查当前环境中是否已安装gtk-vnc2软件包" - if dnf list installed gtk-vnc2 > /dev/null 2>&1; then - LOG_INFO "gtk-vnc2软件包已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "gtk-vnc2软件包未安装,将在测试过程中安装并在测试结束后卸载" - already_installed=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在gtk-vnc2软件包" - if ! dnf list available gtk-vnc2 > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到gtk-vnc2软件包" - exit 255 - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装gtk-vnc2软件包" - dnf install -y gtk-vnc2 - CHECK_RESULT $? 0 0 "安装gtk-vnc2软件包失败" - fi - - LOG_INFO "步骤4:测试gtk-vnc2软件包的版本查询功能" - LOG_INFO "步骤4.1:测试--version参数" - if gtk-vnc2 --help 2>&1 | grep -q "\-\-version"; then - gtk-vnc2 --version - CHECK_RESULT $? 0 0 "执行gtk-vnc2 --version命令失败" - else - LOG_ERROR "gtk-vnc2命令不支持--version参数" - exit 255 - fi - - LOG_INFO "步骤4.2:测试-V参数" - if gtk-vnc2 --help 2>&1 | grep -q "\-V"; then - gtk-vnc2 -V - CHECK_RESULT $? 0 0 "执行gtk-vnc2 -V命令失败" - else - LOG_INFO "gtk-vnc2命令不支持-V参数,此为正常情况" - fi - - LOG_INFO "步骤5:清理测试环境" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试过程中安装的gtk-vnc2软件包" - dnf remove -y gtk-vnc2 - CHECK_RESULT $? 0 0 "卸载gtk-vnc2软件包失败" - else - LOG_INFO "保持gtk-vnc2软件包的安装状态" - fi - - LOG_INFO "gtk-vnc2软件包版本查询功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven2/maven-monitor/test_maven-monitor_function_start.sh b/testcases/function_test/pkg_test/maven2/maven-monitor/test_maven-monitor_function_start.sh deleted file mode 100644 index fecf32cbab9..00000000000 --- a/testcases/function_test/pkg_test/maven2/maven-monitor/test_maven-monitor_function_start.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试maven-monitor软件包的启动功能,验证启动过程是否正常完成。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试maven-monitor软件包的启动功能" - - # 检查yum源中是否存在maven-monitor软件包 - LOG_INFO "检查yum源中是否存在maven-monitor软件包" - dnf list available maven-monitor > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到maven-monitor软件包" - exit 255 - fi - - # 检查是否已安装maven-monitor - LOG_INFO "检查是否已安装maven-monitor" - rpm -q maven-monitor > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "maven-monitor已安装,跳过安装步骤" - installed=true - else - LOG_INFO "maven-monitor未安装,开始安装" - dnf install -y maven-monitor - CHECK_RESULT $? 0 0 "安装maven-monitor失败" - installed=false - fi - - # 验证启动功能 - LOG_INFO "验证maven-monitor启动功能" - systemctl start maven-monitor - CHECK_RESULT $? 0 0 "启动maven-monitor失败" - - # 检查服务状态 - LOG_INFO "检查maven-monitor服务状态" - systemctl status maven-monitor > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "maven-monitor服务未正常运行" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "清理环境:卸载maven-monitor" - dnf remove -y maven-monitor - CHECK_RESULT $? 0 0 "卸载maven-monitor失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help/test_perl-ExtUtils-Install-help_function_install.sh b/testcases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help/test_perl-ExtUtils-Install-help_function_install.sh deleted file mode 100644 index 87b7f87ba65..00000000000 --- a/testcases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help/test_perl-ExtUtils-Install-help_function_install.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试软件包安装功能是否正常 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查脚本执行用户是否为root - if [[ $(id -u) -ne 0 ]]; then - LOG_ERROR "请使用root用户执行此脚本" - exit 1 - fi - - # 定义软件包名称 - PACKAGE_NAME="perl-ExtUtils-Install" - LOG_INFO "开始测试软件包安装功能" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [[ $? -ne 0 ]]; then - LOG_ERROR "yum源中未找到软件包: ${PACKAGE_NAME}" - exit 255 - fi - LOG_INFO "yum源中存在软件包: ${PACKAGE_NAME}" - - # 检查软件包是否已经安装 - LOG_INFO "检查软件包是否已经安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [[ $? -eq 0 ]]; then - LOG_INFO "软件包已经安装,跳过安装步骤" - INSTALLED_BEFORE="yes" - else - LOG_INFO "软件包未安装,将执行安装测试" - INSTALLED_BEFORE="no" - fi - - # 测试安装功能 - if [[ ${INSTALLED_BEFORE} == "no" ]]; then - LOG_INFO "开始安装软件包: ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "软件包安装失败" - LOG_INFO "软件包安装成功" - - # 验证安装结果 - LOG_INFO "验证软件包是否安装成功" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包安装验证失败" - LOG_INFO "软件包安装验证成功" - fi - - # 测试软件包基本功能 - LOG_INFO "测试软件包基本功能" - # 这里可以根据实际软件包的功能添加测试命令 - # 例如:检查软件包提供的命令是否存在 - if [[ ${PACKAGE_NAME} == "perl-ExtUtils-Install" ]]; then - # 检查是否提供了perl模块 - perl -MExtUtils::Install -e "print "模块加载成功\n"" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "Perl模块加载失败" - LOG_INFO "Perl模块加载成功" - fi - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [[ ${INSTALLED_BEFORE} == "no" ]]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "软件包卸载失败" - LOG_INFO "软件包卸载成功" - - # 验证卸载结果 - LOG_INFO "验证软件包是否已卸载" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [[ $? -eq 0 ]]; then - LOG_ERROR "软件包卸载验证失败" - exit 1 - fi - LOG_INFO "软件包卸载验证成功" - else - LOG_INFO "保持原有安装状态,无需卸载" - fi - - LOG_INFO "测试软件包安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help/test_perl-ExtUtils-Install-help_function_version.sh b/testcases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help/test_perl-ExtUtils-Install-help_function_version.sh deleted file mode 100644 index 315f1284264..00000000000 --- a/testcases/function_test/pkg_test/perl-ExtUtils-Install/perl-ExtUtils-Install-help/test_perl-ExtUtils-Install-help_function_version.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试获取软件包版本信息功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装perl-ExtUtils-Install-help_function_version软件包 - LOG_INFO "检查perl-ExtUtils-Install-help_function_version是否已安装" - rpm -q perl-ExtUtils-Install-help_function_version > /dev/null 2>&1 - installed=$? - - # 设置环境状态标记 - if [ $installed -eq 0 ]; then - LOG_INFO "perl-ExtUtils-Install-help_function_version已安装,测试结束后保持安装状态" - ENV_STATE="installed" - else - LOG_INFO "perl-ExtUtils-Install-help_function_version未安装,测试结束后将卸载" - ENV_STATE="uninstalled" - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在perl-ExtUtils-Install-help_function_version软件包" - dnf list available perl-ExtUtils-Install-help_function_version > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到perl-ExtUtils-Install-help_function_version软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装perl-ExtUtils-Install-help_function_version软件包" - dnf install -y perl-ExtUtils-Install-help_function_version - CHECK_RESULT $? 0 0 "安装perl-ExtUtils-Install-help_function_version失败" - fi - - # 测试获取软件包版本信息功能 - LOG_INFO "测试获取软件包版本信息功能" - # 假设软件包提供了--version参数来获取版本信息 - perl-ExtUtils-Install-help_function_version --version > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "软件包不支持--version参数" - # 清理环境:如果之前未安装,则卸载 - if [ "$ENV_STATE" = "uninstalled" ]; then - LOG_INFO "清理环境:卸载perl-ExtUtils-Install-help_function_version" - dnf remove -y perl-ExtUtils-Install-help_function_version - fi - exit 255 - fi - - # 执行获取版本信息的命令 - LOG_INFO "执行获取版本信息的命令" - perl-ExtUtils-Install-help_function_version --version - CHECK_RESULT $? 0 0 "获取软件包版本信息失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$ENV_STATE" = "uninstalled" ]; then - LOG_INFO "清理环境:卸载perl-ExtUtils-Install-help_function_version" - dnf remove -y perl-ExtUtils-Install-help_function_version - CHECK_RESULT $? 0 0 "卸载perl-ExtUtils-Install-help_function_version失败" - else - LOG_INFO "保持perl-ExtUtils-Install-help_function_version的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-scikit-build-core/python3-scikit-build-core/test_python3-scikit-build-core_function_build.sh b/testcases/function_test/pkg_test/python-scikit-build-core/python3-scikit-build-core/test_python3-scikit-build-core_function_build.sh deleted file mode 100644 index 3da4b7f36b0..00000000000 --- a/testcases/function_test/pkg_test/python-scikit-build-core/python3-scikit-build-core/test_python3-scikit-build-core_function_build.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Test the build functionality of the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-scikit-build-core的构建功能" - - # 检查yum源中是否存在python3-scikit-build-core包 - LOG_INFO "检查yum源中是否存在python3-scikit-build-core包" - dnf list available python3-scikit-build-core > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-scikit-build-core包" - exit 255 - fi - - # 检查是否已安装python3-scikit-build-core - LOG_INFO "检查是否已安装python3-scikit-build-core" - rpm -q python3-scikit-build-core > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-scikit-build-core已安装,跳过安装步骤" - installed=true - else - LOG_INFO "python3-scikit-build-core未安装,开始安装" - dnf install -y python3-scikit-build-core - CHECK_RESULT $? 0 0 "安装python3-scikit-build-core失败" - installed=false - fi - - # 测试构建功能 - LOG_INFO "测试python3-scikit-build-core的构建功能" - python3 -m scikit_build_core build - CHECK_RESULT $? 0 0 "构建功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-scikit-build-core" - dnf remove -y python3-scikit-build-core - CHECK_RESULT $? 0 0 "卸载python3-scikit-build-core失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-tzlocal/python-tzlocal-help/test_python-tzlocal-help_function_get.sh b/testcases/function_test/pkg_test/python-tzlocal/python-tzlocal-help/test_python-tzlocal-help_function_get.sh deleted file mode 100644 index f6e5942ad98..00000000000 --- a/testcases/function_test/pkg_test/python-tzlocal/python-tzlocal-help/test_python-tzlocal-help_function_get.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试python-tzlocal-help软件包的时区获取功能,验证是否能正确获取本地时区。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python-tzlocal-help软件包的时区获取功能,验证是否能正确获取本地时区。" - - # 检查软件包是否已安装 - LOG_INFO "检查python-tzlocal-help软件包是否已安装..." - if ! dnf list installed python-tzlocal-help &>/dev/null; then - LOG_INFO "python-tzlocal-help软件包未安装,准备安装..." - # 检查yum源中是否有该软件包 - if ! dnf list available python-tzlocal-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-tzlocal-help软件包,退出测试" - exit 255 - fi - # 安装软件包 - dnf install -y python-tzlocal-help - CHECK_RESULT $? 0 0 "安装python-tzlocal-help软件包失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "python-tzlocal-help软件包已安装,无需重复安装" - fi - - # 测试时区获取功能 - LOG_INFO "测试python-tzlocal-help的时区获取功能..." - result=$(python3 -c "import tzlocal; print(tzlocal.get_localzone())" 2>&1) - CHECK_RESULT $? 0 0 "执行时区获取命令失败" - LOG_INFO "获取到的本地时区为: $result" - - # 清理环境(如果之前未安装) - if [[ $NEED_UNINSTALL -eq 1 ]]; then - LOG_INFO "卸载python-tzlocal-help软件包..." - dnf remove -y python-tzlocal-help - CHECK_RESULT $? 0 0 "卸载python-tzlocal-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_basic_help.sh b/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_basic_help.sh deleted file mode 100644 index 3941feaf049..00000000000 --- a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_basic_help.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试versioneer命令基本帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色变量 - LOG_INFO="echo -e \\033[1;32m[INFO]\\033[0m" - LOG_ERROR="echo -e \\033[1;31m[ERROR]\\033[0m" - - # 定义软件包名称 - PACKAGE_NAME="python3-versioneer" - - # 检查软件包是否已安装 - $LOG_INFO "检查 $PACKAGE_NAME 是否已安装" - if rpm -q $PACKAGE_NAME &>/dev/null; then - $LOG_INFO "$PACKAGE_NAME 已安装" - INSTALLED=true - else - $LOG_INFO "$PACKAGE_NAME 未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - $LOG_INFO "检查yum源中是否存在 $PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - $LOG_ERROR "yum源中不存在 $PACKAGE_NAME" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - $LOG_INFO "安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 测试versioneer命令基本帮助信息 - $LOG_INFO "测试versioneer命令基本帮助信息" - versioneer --help - CHECK_RESULT $? 0 0 "versioneer --help 执行失败" - - # 检查--help参数是否被支持 - $LOG_INFO "检查--help参数是否被支持" - if ! versioneer --help 2>&1 | grep -q "usage"; then - $LOG_ERROR "versioneer命令不支持--help参数" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - $LOG_INFO "卸载 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - $LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_cmd_version.sh b/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_cmd_version.sh deleted file mode 100644 index 455caf84c93..00000000000 --- a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_cmd_version.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试versioneer命令的版本输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试versioneer命令的版本输出功能" - LOG_INFO "步骤1: 检查是否已安装python3-versioneer软件包" - rpm -q python3-versioneer > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-versioneer已安装,记录安装状态以便后续恢复" - PYTHON3_VERSIONEER_INSTALLED=true - else - LOG_INFO "python3-versioneer未安装" - PYTHON3_VERSIONEER_INSTALLED=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在python3-versioneer软件包" - dnf list available python3-versioneer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-versioneer软件包" - exit 255 - fi - - if [ "$PYTHON3_VERSIONEER_INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装python3-versioneer软件包" - dnf install -y python3-versioneer - CHECK_RESULT $? 0 0 "安装python3-versioneer失败" - fi - - LOG_INFO "步骤4: 检查versioneer命令是否存在" - which versioneer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "versioneer命令未找到" - if [ "$PYTHON3_VERSIONEER_INSTALLED" = "false" ]; then - dnf remove -y python3-versioneer - fi - exit 1 - fi - - LOG_INFO "步骤5: 检查versioneer命令是否支持version参数" - versioneer --help 2>&1 | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "versioneer命令不支持--version参数" - if [ "$PYTHON3_VERSIONEER_INSTALLED" = "false" ]; then - dnf remove -y python3-versioneer - fi - exit 255 - fi - - LOG_INFO "步骤6: 执行versioneer --version命令" - versioneer --version - CHECK_RESULT $? 0 0 "执行versioneer --version命令失败" - - LOG_INFO "步骤7: 清理测试环境" - if [ "$PYTHON3_VERSIONEER_INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的python3-versioneer软件包" - dnf remove -y python3-versioneer - CHECK_RESULT $? 0 0 "卸载python3-versioneer失败" - else - LOG_INFO "保持原有的python3-versioneer安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_package_install.sh b/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_package_install.sh deleted file mode 100644 index e19a1b94ec4..00000000000 --- a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_package_install.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试python3-versioneer软件包的安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-versioneer软件包的安装" - LOG_INFO "检查yum源中是否存在python3-versioneer软件包" - dnf list available python3-versioneer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-versioneer软件包" - exit 255 - fi - - LOG_INFO "检查当前环境是否已安装python3-versioneer" - rpm -q python3-versioneer > /dev/null 2>&1 - installed=$? - - if [ $installed -eq 0 ]; then - LOG_INFO "环境已安装python3-versioneer,测试将保持安装状态" - need_cleanup=0 - else - LOG_INFO "环境未安装python3-versioneer,将进行安装测试" - need_cleanup=1 - fi - - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "安装python3-versioneer软件包" - dnf install -y python3-versioneer - CHECK_RESULT $? 0 0 "安装python3-versioneer失败" - - LOG_INFO "验证python3-versioneer安装成功" - rpm -q python3-versioneer - CHECK_RESULT $? 0 0 "验证python3-versioneer安装失败" - fi - - LOG_INFO "测试python3-versioneer基本功能" - python3 -m versioneer --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-versioneer基本功能测试失败" - - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理测试环境,卸载python3-versioneer" - dnf remove -y python3-versioneer - CHECK_RESULT $? 0 0 "卸载python3-versioneer失败" - - LOG_INFO "验证python3-versioneer已卸载" - rpm -q python3-versioneer > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "验证python3-versioneer卸载失败" - else - LOG_INFO "保持python3-versioneer安装状态,无需清理" - fi - - LOG_INFO "python3-versioneer软件包安装测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_package_remove.sh b/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_package_remove.sh deleted file mode 100644 index 9f008ececdb..00000000000 --- a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_package_remove.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试python3-versioneer软件包的卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-versioneer软件包的卸载" - - # 检查软件包是否在yum源中 - LOG_INFO "检查python3-versioneer软件包是否在yum源中" - dnf list available python3-versioneer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到python3-versioneer软件包" - exit 255 - fi - - # 检查当前是否已安装python3-versioneer - LOG_INFO "检查当前是否已安装python3-versioneer" - rpm -q python3-versioneer > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-versioneer已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-versioneer未安装,将在测试前安装" - INSTALLED=false - fi - - # 如果未安装,则先安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-versioneer软件包" - dnf install -y python3-versioneer - CHECK_RESULT $? 0 0 "安装python3-versioneer失败" - fi - - # 执行卸载测试 - LOG_INFO "开始卸载python3-versioneer软件包" - dnf remove -y python3-versioneer - CHECK_RESULT $? 0 0 "卸载python3-versioneer失败" - - # 验证卸载是否成功 - LOG_INFO "验证python3-versioneer是否已卸载" - rpm -q python3-versioneer > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "python3-versioneer卸载后仍然存在" - CHECK_RESULT 1 0 0 "卸载验证失败" - else - LOG_INFO "python3-versioneer已成功卸载" - fi - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ "$INSTALLED" = false ]; then - LOG_INFO "恢复环境:卸载测试安装的python3-versioneer" - # 由于上一步已经卸载,这里不需要再执行卸载操作 - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "恢复环境:重新安装python3-versioneer" - dnf install -y python3-versioneer - CHECK_RESULT $? 0 0 "恢复环境时重新安装python3-versioneer失败" - LOG_INFO "环境已恢复到测试前状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_setup_py.sh b/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_setup_py.sh deleted file mode 100644 index 9cdf29c0b34..00000000000 --- a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_setup_py.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试versioneer在setup.py中的集成与版本生成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装python3-versioneer - LOG_INFO "检查环境是否已安装python3-versioneer" - rpm -qa | grep -q python3-versioneer - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装python3-versioneer,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装python3-versioneer,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-versioneer软件包 - LOG_INFO "检查yum源中是否有python3-versioneer软件包" - dnf list available python3-versioneer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有python3-versioneer软件包" - exit 255 - fi - - # 如果未安装,则安装python3-versioneer - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-versioneer" - dnf install -y python3-versioneer - CHECK_RESULT $? 0 0 "安装python3-versioneer失败" - fi - - # 创建测试目录 - LOG_INFO "创建测试目录" - mkdir -p /tmp/test_versioneer - cd /tmp/test_versioneer - - # 初始化git仓库 - LOG_INFO "初始化git仓库" - git init - CHECK_RESULT $? 0 0 "初始化git仓库失败" - - # 创建初始提交 - LOG_INFO "创建初始提交" - echo "test" > README.md - git add . - git config --global user.email "test@example.com" - git config --global user.name "Test User" - git commit -m "Initial commit" - CHECK_RESULT $? 0 0 "创建初始提交失败" - - # 创建setup.py文件 - LOG_INFO "创建setup.py文件" - cat > setup.py << "EOF" - from setuptools import setup - import versioneer - - setup( - name="test-package", - version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass(), - ) - EOF - CHECK_RESULT $? 0 0 "创建setup.py文件失败" - - # 初始化versioneer - LOG_INFO "初始化versioneer" - versioneer install - CHECK_RESULT $? 0 0 "初始化versioneer失败" - - # 检查versioneer是否成功集成到setup.py - LOG_INFO "检查versioneer是否成功集成到setup.py" - grep -q "versioneer" setup.py - CHECK_RESULT $? 0 0 "versioneer未成功集成到setup.py" - - # 生成版本号 - LOG_INFO "生成版本号" - python3 setup.py --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "生成版本号失败" - - # 创建git标签 - LOG_INFO "创建git标签" - git tag v1.0.0 - CHECK_RESULT $? 0 0 "创建git标签失败" - - # 再次生成版本号,检查是否包含标签信息 - LOG_INFO "再次生成版本号,检查是否包含标签信息" - VERSION=$(python3 setup.py --version) - echo $VERSION | grep -q "1.0.0" - CHECK_RESULT $? 0 0 "版本号不包含标签信息" - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd / - rm -rf /tmp/test_versioneer - - # 如果测试前未安装,则卸载python3-versioneer - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-versioneer" - dnf remove -y python3-versioneer - CHECK_RESULT $? 0 0 "卸载python3-versioneer失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_version_check.sh b/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_version_check.sh deleted file mode 100644 index 4a71245b758..00000000000 --- a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_function_version_check.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试 versioneer 版本检查功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试 versioneer 版本检查功能 - - LOG_INFO "开始测试 versioneer 版本检查功能" - - # 检查是否已安装 python3-versioneer - LOG_INFO "检查是否已安装 python3-versioneer" - dnf list installed python3-versioneer > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-versioneer 已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "python3-versioneer 未安装,将在测试结束后卸载" - installed=false - fi - - # 检查 yum 源中是否有 python3-versioneer - LOG_INFO "检查 yum 源中是否有 python3-versioneer" - dnf list available python3-versioneer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 python3-versioneer" - exit 255 - fi - - # 安装 python3-versioneer - if [ "$installed" = false ]; then - LOG_INFO "开始安装 python3-versioneer" - dnf install -y python3-versioneer > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 python3-versioneer 失败" - fi - - # 测试 versioneer 版本检查功能 - LOG_INFO "测试 versioneer 版本检查功能" - versioneer --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "versioneer 版本检查失败" - - #清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载 python3-versioneer" - dnf remove -y python3-versioneer > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 python-verseioneere失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_versioneer_install.sh b/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_versioneer_install.sh deleted file mode 100644 index 653749165bb..00000000000 --- a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_versioneer_install.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试 versioneer install 命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-versioneer-versioneer - LOG_INFO "检查是否已安装python3-versioneer-versioneer" - if dnf list installed python3-versioneer-versioneer &>/dev/null; then - LOG_INFO "python3-versioneer-versioneer已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "python3-versioneer-versioneer未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否存在python3-versioneer-versioneer软件包 - LOG_INFO "检查yum源中是否存在python3-versioneer-versioneer软件包" - if ! dnf list available python3-versioneer-versioneer &>/dev/null; then - LOG_ERROR "yum源中未找到python3-versioneer-versioneer软件包" - exit 255 - fi - - # 安装python3-versioneer-versioneer软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装python3-versioneer-versioneer软件包" - dnf install -y python3-versioneer-versioneer - CHECK_RESULT $? 0 0 "安装python3-versioneerversio失败" - fi - - # 测试versioinstall命令 - LOG_INFO "测试versioinstall命令" - versioinstall --help &>/dev/null - CHECK_RESULT $? 0 0 "versioinstall命令不支持或参数错误" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3versioware软件包" - dnf remove -y pythonversioware - CHECK_RESULT $?00"卸载pythonversioware失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_versioneer_install_vendor.sh b/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_versioneer_install_vendor.sh deleted file mode 100644 index bdfa8e38642..00000000000 --- a/testcases/function_test/pkg_test/python-versioneer/python3-versioneer/test_python3-versioneer_versioneer_install_vendor.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 执行 versioneer install --vendor 命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-versioneer - LOG_INFO "检查是否已安装python3-versioneer" - rpm -q python3-versioneer > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-versioneer已安装,记录安装状态" - installed=true - else - LOG_INFO "python3-versioneer未安装,记录安装状态" - installed=false - fi - - # 检查yum源中是否有python3-versioneer软件包 - LOG_INFO "检查yum源中是否有python3-versioneer软件包" - dnf list available python3-versioneer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-versioneer软件包" - exit 255 - fi - - # 如果未安装,则安装python3-versioneer - if [ "$installed" = false ]; then - LOG_INFO "安装python3-versioneer软件包" - dnf install -y python3-versioneer - CHECK_RESULT $? 0 0 "安装python3-versioneer失败" - fi - - # 检查versioneer命令是否存在 - LOG_INFO "检查versioneer命令是否存在" - command -v versioneer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "versioneer命令不存在" - # 如果之前未安装,需要卸载已安装的软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-versioneer软件包" - dnf remove -y python3-versioneer - fi - exit 255 - fi - - # 检查versioneer install命令是否支持--vendor参数 - LOG_INFO "检查versioneer install命令是否支持--vendor参数" - versioneer install --help 2>&1 | grep -q "\-\-vendor" - if [ $? -ne 0 ]; then - LOG_ERROR "versioneer install命令不支持--vendor参数" - # 如果之前未安装,需要卸载已安装的软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-versioneer软件包" - dnf remove -y python3-versioneer - fi - exit 255 - fi - - # 创建测试目录 - LOG_INFO "创建测试目录" - test_dir="/tmp/test_versioneer_$(date +%s)" - mkdir -p "$test_dir" - CHECK_RESULT $? 0 0 "创建测试目录失败" - cd "$test_dir" || exit 1 - - # 初始化git仓库(versioneer需要git仓库) - LOG_INFO "初始化git仓库" - git init - CHECK_RESULT $? 0 0 "初始化git仓库失败" - git config user.email "test@example.com" - git config user.name "Test User" - - # 创建测试Python项目 - LOG_INFO "创建测试Python项目" - cat > setup.py << EOF - from setuptools import setup - setup( - name="test_project", - version="0.1.0", - ) - EOF - - cat > test_project.py << EOF - def hello(): - return "Hello, World!" - EOF - - git add . - git commit -m "Initial commit" - - # 执行versioneer install --vendor命令 - LOG_INFO "执行versioneer install --vendor命令" - versioneer install --vendor - CHECK_RESULT $? 0 0 "执行versioneer install --vendor命令失败" - - # 检查是否生成了versioneer.py文件 - LOG_INFO "检查是否生成了versioneer.py文件" - if [ -f "versioneer.py" ]; then - LOG_INFO "versioneer.py文件已生成" - else - LOG_ERROR "versioneer.py文件未生成" - # 清理测试目录 - cd /tmp && rm -rf "$test_dir" - # 如果之前未安装,需要卸载已安装的软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-versioneer软件包" - dnf remove -y python3-versioneer - fi - exit 1 - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd /tmp && rm -rf "$test_dir" - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 如果测试开始时未安装,则卸载python3-versioneer - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-versioneer软件包" - dnf remove -y python3-versioneer - CHECK_RESULT $? 0 0 "卸载python3-versioneer失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_downgrade.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_downgrade.sh deleted file mode 100644 index f6847445052..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_downgrade.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的降级功能,验证是否能够正确降级到旧版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,记录当前版本" - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" texlive-fbithesis-doc) - INSTALLED=1 - else - LOG_INFO "texlive-fbithesis-doc未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 获取可用的旧版本列表 - LOG_INFO "获取texlive-fbithesis-doc的可用旧版本列表" - OLD_VERSIONS=$(dnf --showduplicates list texlive-fbithesis-doc | grep texlive-fbithesis-doc | awk "{print $2}" | sort -V | head -n -1) - if [ -z "$OLD_VERSIONS" ]; then - LOG_ERROR "没有可用的旧版本" - exit 255 - fi - - # 选择第一个旧版本进行降级测试 - TARGET_VERSION=$(echo "$OLD_VERSIONS" | head -n 1) - LOG_INFO "准备降级到版本: $TARGET_VERSION" - - # 执行降级操作 - LOG_INFO "执行降级操作到版本: $TARGET_VERSION" - dnf downgrade -y texlive-fbithesis-doc-$TARGET_VERSION - CHECK_RESULT $? 0 0 "降级操作失败" - - # 验证降级后的版本是否正确 - LOG_INFO "验证降级后的版本是否正确" - CURRENT_VERSION_AFTER_DOWNGRADE=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" texlive-fbithesis-doc) - if [ "$CURRENT_VERSION_AFTER_DOWNGRADE" != "$TARGET_VERSION" ]; then - LOG_ERROR "降级后的版本与目标版本不一致,当前版本: $CURRENT_VERSION_AFTER_DOWNGRADE, 目标版本: $TARGET_VERSION" - exit 1 - fi - - # 恢复环境到初始状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "初始状态未安装,卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - else - LOG_INFO "初始状态已安装,恢复到原始版本: $CURRENT_VERSION" - dnf upgrade -y texlive-fbithesis-doc-$CURRENT_VERSION - CHECK_RESULT $? 0 0 "恢复到原始版本失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_downgrade_rollback.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_downgrade_rollback.sh deleted file mode 100644 index 16777c1ea56..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_downgrade_rollback.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的降级回滚功能,验证是否能够正确从降级后的版本回滚到降级前的版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc是否已安装 - LOG_INFO "检查texlive-fbithesis-doc是否已安装" - if rpm -q texlive-fbithesis-doc &>/dev/null; then - LOG_INFO "texlive-fbithesis-doc已安装,记录当前版本" - CURRENT_VERSION=$(rpm -q texlive-fbithesis-doc --queryformat "%{VERSION}-%{RELEASE}") - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - if ! dnf list available texlive-fbithesis-doc &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 获取texlive-fbithesis-doc的可用版本列表 - LOG_INFO "获取texlive-fbithesis-doc的可用版本列表" - AVAILABLE_VERSIONS=$(dnf list available texlive-fbithesis-doc --showduplicates | awk "{print $2}" | tail -n +2) - if [ -z "$AVAILABLE_VERSIONS" ]; then - LOG_ERROR "无法获取texlive-fbithesis-doc的可用版本列表" - exit 255 - fi - - # 选择降级的目标版本(假设选择倒数第二个版本) - LOG_INFO "选择降级的目标版本" - TARGET_VERSION=$(echo "$AVAILABLE_VERSIONS" | tail -n 2 | head -n 1) - if [ -z "$TARGET_VERSION" ]; then - LOG_ERROR "无法选择降级的目标版本" - exit 255 - fi - - # 降级texlive-fbithesis-doc到目标版本 - LOG_INFO "降级texlive-fbithesis-doc到目标版本" - dnf downgrade -y texlive-fbithesis-doc-$TARGET_VERSION - CHECK_RESULT $? 0 0 "降级失败" - - # 验证降级后的版本是否正确 - LOG_INFO "验证降级后的版本是否正确" - DOWNGRADED_VERSION=$(rpm -q texlive-fbithesis-doc --queryformat "%{VERSION}-%{RELEASE}") - CHECK_RESULT "$DOWNGRADED_VERSION" "$TARGET_VERSION" 0 "降级后的版本不正确" - - # 回滚到之前的版本 - LOG_INFO "回滚到之前的版本" - if [ "$INSTALLED" = true ]; then - dnf history undo last -y --skip-broken &>/dev/null || dnf history redo last -y --skip-broken &>/dev/null - else - dnf remove -y texlive-fbithesis-doc &>/dev/null - fi - CHECK_RESULT $? 0 0 "回滚失败" - - # 验证回滚后的状态是否符合预期 - LOG_INFO "验证回滚后的状态是否符合预期" - if [ "$INSTALLED" = true ]; then - ROLLBACK_VERSION=$(rpm -q texlive-fbithesis-doc --queryformat "%{VERSION}-%{RELEASE}") - CHECK_RESULT "$ROLLBACK_VERSION" "$CURRENT_VERSION" 0 "回滚后的版本不正确" - else - if rpm -q texlive-fbithesis-doc &>/dev/null; then - LOG_ERROR "回滚后texlive-fbithesis-doc未卸载干净" - exit 1 - fi - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_reinstall.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_reinstall.sh deleted file mode 100644 index d294466f065..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_reinstall.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的重新安装功能,验证是否能够正确重新安装到系统中 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否有texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 卸载texlive-fbithesis-doc(如果已安装) - if [ "$installed" = true ]; then - LOG_INFO "卸载texlive-fbithesis-doc" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - # 安装texlive-fbithesis-doc - LOG_INFO "安装texlive-fbithesis-doc" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - - # 验证是否成功安装 - LOG_INFO "验证是否成功安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证安装失败" - - # 重新安装texlive-fbithesis-doc(测试重新安装功能) - LOG_INFO "重新安装texlive-fbithesis-doc" - dnf reinstall -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "重新安装texlive-fbithesis-doc失败" - - # 验证重新安装后是否正常使用(示例:检查文档是否存在) - LOG_INFO "验证重新安装后文档是否存在" - ls /usr/share/doc/texlive-fbithe* > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装后文档不存在" - - # 恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "恢复环境:卸载texlive-fbithesis-doc" - dnf remove -y texlivinge fbithe* doc* - else - LOG_INFO “环境恢复:保持安装状态” - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_rollback.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_rollback.sh deleted file mode 100644 index a790af856d8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_rollback.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的回滚功能,验证是否能够正确回滚到上一个版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - - # 获取当前安装的texlive-fbithesis-doc版本 - LOG_INFO "获取当前安装的texlive-fbithesis-doc版本" - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" texlive-fbithesis-doc) - LOG_INFO "当前安装的texlive-fbithesis-doc版本: $CURRENT_VERSION" - - # 检查dnf history是否有回滚记录 - LOG_INFO "检查dnf history是否有回滚记录" - dnf history list texlive-fbithesis-doc | grep -q "install" - if [ $? -ne 0 ]; then - LOG_ERROR "dnf history中没有找到texlive-fbithesis-doc的安装记录,无法回滚" - exit 255 - fi - - # 回滚texlive-fbithesis-doc到上一个版本 - LOG_INFO "回滚texlive-fbithesis-doc到上一个版本" - dnf history undo last -y --skip-broken | grep -q "Undoing transaction" - CHECK_RESULT $? 0 0 "回滚texlive-fbithesis-doc失败" - - # 验证回滚后的版本是否与之前不同 - LOG_INFO "验证回滚后的版本是否与之前不同" - ROLLBACK_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" texlive-fbithesis-doc) - if [ "$ROLLBACK_VERSION" == "$CURRENT_VERSION" ]; then - LOG_ERROR "回滚后版本未发生变化" - exit 1 - else - LOG_INFO "回滚成功,当前版本: $ROLLBACK_VERSION" - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包以恢复环境" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_rollback_upgrade.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_rollback_upgrade.sh deleted file mode 100644 index 6106cbda9ba..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_rollback_upgrade.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的升级回滚功能,验证是否能够正确从升级后的版本回滚到升级前的版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-fbithesis-doc软件包" - - # 获取当前安装的版本(如果已安装) - if [ "$INSTALLED" = true ]; then - LOG_INFO "获取当前安装的texlive-fbithesis-doc版本" - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" texlive-fbithesis-doc) - LOG_INFO "当前版本: $CURRENT_VERSION" - fi - - # 安装texlive-fbithesis-doc(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 获取升级前的版本 - LOG_INFO "获取升级前的texlive-fbithesis-doc版本" - PRE_UPGRADE_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" texlive-fbithesis-doc) - LOG_INFO "升级前版本: $PRE_UPGRADE_VERSION" - - # 检查是否有可用的升级版本 - LOG_INFO "检查是否有可用的升级版本" - dnf check-update texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "没有可用的升级版本" - exit 255 - fi - - # 升级texlive-fbithesis-doc - LOG_INFO "升级texlive-fbithesis-doc" - dnf upgrade -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "升级texlive-fbithesis-doc失败" - - # 获取升级后的版本 - LOG_INFO "获取升级后的texlive-fbithesis-doc版本" - POST_UPGRADE_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" texlive-fbithesis-doc) - LOG_INFO "升级后版本: $POST_UPGRADE_VERSION" - - # 验证升级后的版本与之前不同 - LOG_INFO "验证升级后的版本与之前不同" - if [ "$PRE_UPGRADE_VERSION" = "$POST_UPGRADE_VERSION" ]; then - LOG_ERROR "升级后版本与之前相同" - exit 1 - fi - - # 回滚到之前的版本 - LOG_INFO "回滚到之前的版本" - dnf history undo last -y --skip-broken > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "回滚失败" - - # 验证回滚后的版本与之前相同(升级前版本) - LOG_INFO "验证回滚后的版本与之前相同" - ROLLBACK_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" texlive-fbithesis-doc) - if [ "$ROLLBACK_VERSION" != "$PRE_UPGRADE_VERSION" ]; then - LOG_ERROR "回滚后版本与之前不同" - exit 1 - else - LOG_INFO "回滚成功,当前版本: $ROLLBACK_VERSION" - fi - - #清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doC " - dnf remove-y texLive_fBitHesis_dOc >/dev/null 2>&l - CHECK_RESULT $? o o “卸载失败” - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_config.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_config.sh deleted file mode 100644 index 1d253cbedb5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_config.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务配置功能,验证是否能正常配置服务参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-fbithesis-doc软件包 - LOG_INFO "检查是否已安装texlive-fbithesis-doc软件包" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证服务配置功能 - LOG_INFO "验证texlive-fbithesis-doc服务配置功能" - command_to_test="texdoc fbithesis" - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务配置功能验证失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_disable.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_disable.sh deleted file mode 100644 index dcbb74c43e5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_disable.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务开机自启禁用功能,验证服务是否能正常取消开机自启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试texlive-fbithesis-doc软件包提供的服务开机自启禁用功能,验证服务是否能正常取消开机自启 - - # 步骤1:检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 步骤2:检查是否已安装texlive-fbithesis-doc软件包 - LOG_INFO "检查是否已安装texlive-fbithesis-doc软件包" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "texlive-fbithesis-doc软件包已安装" - else - INSTALLED=false - LOG_INFO "texlive-fbithesis-doc软件包未安装,将进行安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 步骤4:检查服务是否存在并获取服务名称 - LOG_INFO "检查服务是否存在并获取服务名称" - SERVICE_NAME=$(systemctl list-unit-files | grep fbithesis | awk "{print $1}") - if [ -z "$SERVICE_NAME" ]; then - LOG_ERROR "未找到fbithesis相关服务" - exit 255 - fi - - # 步骤5:禁用服务开机自启 - LOG_INFO "禁用服务开机自启" - systemctl disable $SERVICE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "禁用服务开机自启失败" - - # 步骤6:验证服务是否已禁用 - LOG_INFO "验证服务是否已禁用" - systemctl is-enabled $SERVICE_NAME | grep -q "disabled" - CHECK_RESULT $? 0 0 "服务开机自启未禁用" - - # 步骤7:恢复环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_enable.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_enable.sh deleted file mode 100644 index 6142664e05c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_enable.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务开机自启功能,验证服务是否能正常设置为开机自启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 检查服务是否支持开机自启 - LOG_INFO "检查服务是否支持开机自启" - systemctl enable texlive-fbithesis-doc.service --now - CHECK_RESULT $? 0 0 "设置开机自启失败" - - # 验证服务是否能正常启动 - LOG_INFO "验证服务是否能正常启动" - systemctl start texlive-fbithesis-doc.service - CHECK_RESULT $? 0 0 "启动服务失败" - - # 检查服务状态是否为active (running) - LOG_INFO "检查服务状态是否为active (running)" - systemctl status texlive-fbithesis-doc.service | grep -q "active (running)" - CHECK_RESULT $? 0 0 "服务状态异常" - - # 如果最初未安装,则卸载texlive-fbithesis-doc软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包以恢复环境" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_log.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_log.sh deleted file mode 100644 index 426ff170871..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_log.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务日志查看功能,验证是否能正常查看服务日志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装,保持安装状态" - installed=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 测试服务日志查看功能 - LOG_INFO "测试texlive-fbithesis-doc软件包提供的服务日志查看功能" - journalctl --unit=texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "不支持journalctl --unit=texlive-fbithesis-doc参数或服务不存在" - if [ "$installed" = false ]; then - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - exit 255 - fi - CHECK_RESULT $? 0 0 "查看texlive-fbithesis-doc服务日志失败" - - # 清理环境,恢复到之前的状态 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_reload.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_reload.sh deleted file mode 100644 index 1f49fb6e643..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_reload.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务重载功能,验证服务是否能正常重载配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-fbithesis-doc未安装,测试结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否有texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-fbithesis-doc - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-fbithesis-doc" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证服务重载功能 - LOG_INFO "验证服务重载功能" - systemctl reload texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "服务重载失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-fbithesis-doc" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_restart.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_restart.sh deleted file mode 100644 index ce676a96e02..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_restart.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务重启功能,验证服务是否能正常重启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-fbithesis-doc软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - LOG_INFO "texlive-fbithesis-doc软件包安装成功" - fi - - # 检查服务是否存在并获取服务名称 - LOG_INFO "检查服务是否存在并获取服务名称" - SERVICE_NAME=$(systemctl list-unit-files | grep fbithesis | awk "{print $1}") - if [ -z "$SERVICE_NAME" ]; then - LOG_ERROR "未找到fbithesis相关服务" - exit 255 - fi - - # 重启服务 - LOG_INFO "重启服务:$SERVICE_NAME" - systemctl restart "$SERVICE_NAME" - CHECK_RESULT $? 0 0 "重启服务失败" - - # 检查服务状态 - LOG_INFO "检查服务状态:$SERVICE_NAME" - systemctl status "$SERVICE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务状态异常" - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_start.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_start.sh deleted file mode 100644 index e3257f5cccb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_start.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务启动功能,验证服务是否能正常启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-fbithesis-doc软件包 - LOG_INFO "检查是否已安装texlive-fbithesis-doc软件包" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否有texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有texlive-fbithesis-doc软件包" - - # 安装texlive-fbithesis-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "正在安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证服务是否能正常启动 - LOG_INFO "验证texlive-fbithesis-doc服务启动功能" - systemctl start texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-fbithesis-doc服务启动失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "正在卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_status.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_status.sh deleted file mode 100644 index 5325fcc1271..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_status.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务状态查询功能,验证是否能正常查询服务状态 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-fbithesis-doc软件包 - LOG_INFO "检查是否已安装texlive-fbithesis-doc软件包" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否有texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-fbithesis-doc软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 测试服务状态查询功能 - LOG_INFO "测试服务状态查询功能" - systemctl status texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询服务状态失败" - - # 如果脚本开始时未安装,则在测试结束后卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - - # 验证卸载是否成功 - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "卸载texlive-fbithesis-doc后仍存在" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_stop.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_stop.sh deleted file mode 100644 index eb5f1301724..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_service_stop.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务停止功能,验证服务是否能正常停止 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - installed=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-fbithesis-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - LOG_INFO "texlive-fbithesis-doc软件包安装成功" - fi - - # 测试服务停止功能 - LOG_INFO "测试服务停止功能" - systemctl stop texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "停止texlive-fbithesis-doc服务失败" - - # 验证服务是否已停止 - LOG_INFO "验证服务是否已停止" - systemctl is-active texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 3 0 "texlive-fbithesis-doc服务未停止" - - # 恢复服务启动状态 - LOG_INFO "恢复服务启动状态" - systemctl start texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "启动texlive-fbithesis-doc服务失败" - - # 如果脚本开始时未安装,则卸载texlive-fbithesis-doc软件包以恢复环境状态。 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包以恢复环境状态" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - LOG_INFO "texlive-fbithesis-doc软件包卸载成功,环境已恢复" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_arguments.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_arguments.sh deleted file mode 100644 index e672eb16b8e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_arguments.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令参数验证功能,验证命令的所有参数是否可用且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证命令参数 - LOG_INFO "验证texlive-fbithesis-doc命令参数" - command_to_test="texlive-fbithesis-doc" - expected_arguments="--help --version" - - # 检查--help参数 - LOG_INFO "检查--help参数" - $command_to_test --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "--help参数不支持或执行失败" - - # 检查--version参数 - LOG_INFO "检查--version参数" - $command_to_test --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "--version参数不支持或执行失败" - - # 检查不支持的参数 - LOG_INFO "检查不支持的参数" - $command_to_test --invalid-arg > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未按预期退出" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_arguments_combinations.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_arguments_combinations.sh deleted file mode 100644 index b1eedcc04fa..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_arguments_combinations.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令参数组合验证功能,验证命令在多个参数组合下是否能正常执行并返回预期结果 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装" - INSTALLED=1 - else - LOG_INFO "texlive-fbithesis-doc未安装,开始安装" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - INSTALLED=0 - fi - - # 测试命令参数组合 - LOG_INFO "测试命令参数组合" - command_to_test="fbithesis" - valid_args=("--help" "--version") - invalid_args=("--invalid" "--nonexistent") - - # 验证有效参数 - for arg in "${valid_args[@]}"; do - LOG_INFO "测试参数: $arg" - $command_to_test $arg > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令参数$arg执行失败" - done - - # 验证无效参数 - for arg in "${invalid_args[@]}"; do - LOG_INFO "测试无效参数: $arg" - $command_to_test $arg > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "无效参数$arg未返回预期退出码255" - exit 255 - fi - done - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-fbithesis-doc" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_completion.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_completion.sh deleted file mode 100644 index 221ec372ce3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_completion.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令补全功能,验证命令补全是否可用且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装,测试完成后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证命令补全功能是否可用 - LOG_INFO "验证命令补全功能是否可用" - command -v fbithesis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fbithesis命令不存在" - - # 测试命令补全功能是否符合预期 - LOG_INFO "测试命令补全功能是否符合预期" - fbithesis --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fbithesis命令补全功能不符合预期" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_default.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_default.sh deleted file mode 100644 index 8190d1239b8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_default.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令的默认参数功能,验证命令在无参数情况下是否能正常执行并返回预期结果 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-fbithesis-doc软件包提供的命令的默认参数功能" - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查texlive-fbithesis-doc软件包是否在yum源中" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-fbithesis-doc软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 测试命令的默认参数功能 - LOG_INFO "测试命令的默认参数功能" - command_to_test="fbithesis" # 假设fbithesis是texlive-fbithesis-doc提供的命令 - - # 检查命令是否存在 - which $command_to_test > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "$command_to_test命令不存在或不支持" - exit 255 - fi - - # 执行命令并验证结果 - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "$command_to_test命令执行失败" - - # 如果之前未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包以恢复环境" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_environment.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_environment.sh deleted file mode 100644 index 51f1e0552a9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_environment.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令环境验证功能,验证命令执行时的环境变量是否设置正确且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-fbithesis-doc软件包提供的命令环境验证功能 - LOG_INFO "开始测试texlive-fbithesis-doc软件包的命令环境验证功能" - - # 检查软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc是否已安装" - if dnf list installed texlive-fbithesis-doc &>/dev/null; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-fbithesis-doc" - if ! dnf list available texlive-fbithesis-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证命令执行时的环境变量 - LOG_INFO "验证命令执行时的环境变量是否设置正确" - command_to_test="fbithesis-doc" - if ! command -v "$command_to_test" &>/dev/null; then - LOG_ERROR "命令$command_to_test不存在或不支持" - exit 255 - fi - - # 执行命令并检查环境变量 - LOG_INFO "执行$command_to_test命令并检查环境变量" - output=$($command_to_test --version) - CHECK_RESULT $? 0 0 "执行$command_to_test命令失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc以恢复环境" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_environment_variables.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_environment_variables.sh deleted file mode 100644 index b6d039cc50a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_environment_variables.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令环境变量验证功能,验证命令执行时的环境变量是否设置正确且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - dnf list installed texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-fbithesis-doc软件包" - - # 安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证命令执行时的环境变量是否设置正确 - LOG_INFO "验证命令执行时的环境变量是否设置正确" - export TEST_ENV_VAR="test_value" - env | grep TEST_ENV_VAR - CHECK_RESULT $? 0 0 "环境变量TEST_ENV_VAR未设置成功" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_error_handling.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_error_handling.sh deleted file mode 100644 index aeff90215da..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_error_handling.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令错误处理功能,验证命令在错误输入或无效参数下是否能正确处理并返回预期错误信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装texlive-fbithesis-doc软件包 - LOG_INFO "检查是否已安装texlive-fbithesis-doc软件包..." - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时将保持安装状态..." - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,脚本结束时将卸载..." - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包..." - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包..." - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-fbithesis-doc软件包..." - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败..." - fi - - # 测试命令的错误处理功能 - LOG_INFO "测试texlive-fbithesis-doc提供的命令错误处理功能..." - - # 测试无效参数的情况(假设命令为fbithesis-doc) - LOG_INFO "测试无效参数的情况..." - fbithesis-doc --invalid-arg > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "命令未正确处理无效参数..." - exit 255 - fi - - # 测试不支持的参数的情况(假设命令为fbithesis-doc) - LOG_INFO "测试不支持的参数的情况..." - fbithesis-doc --unsupported-arg > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "命令未正确处理不支持的参数..." - exit 255 - fi - - # 测试命令执行失败的情况(假设命令为fbithesis-doc) - LOG_INFO "测试命令执行失败的情况..." - fbithesis-doc --fail > /dev/null 2>&1 - CHECK_RESULT $? !0 0 "命令未正确处理执行失败的情况..." - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-fbithesis-doc软件包..." - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_execution.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_execution.sh deleted file mode 100644 index 1980c98ac31..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_execution.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令执行功能,验证命令是否能正常执行并返回预期结果 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证命令是否能正常执行并返回预期结果 - LOG_INFO "验证命令是否能正常执行并返回预期结果" - command_to_test="fbithesis-doc" - $command_to_test --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令执行失败或参数不支持" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_help.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_help.sh deleted file mode 100644 index 14f651d6fa8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_help.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令的帮助功能,验证命令的帮助信息是否完整且可访问 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证命令的帮助信息是否完整且可访问 - LOG_INFO "验证命令的帮助信息是否完整且可访问" - fbithesis --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fbithesis命令的帮助信息不可访问" - - # 如果脚本开始时未安装,则在结束时卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包以恢复环境" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_interactive_mode.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_interactive_mode.sh deleted file mode 100644 index dfb47ef0d0a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_interactive_mode.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令的交互模式功能,验证命令在交互模式下是否能正常执行并返回预期结果 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 若未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证命令的交互模式功能 - LOG_INFO "验证texlive-fbithesis-doc提供的命令的交互模式功能" - command_to_test="fbithesis" # 假设fbithesis是texlive-fbithesis-doc提供的命令 - - # 检查命令是否存在 - which $command_to_test > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令$command_to_test不存在" - exit 255 - fi - - # 检查命令是否支持交互模式 - LOG_INFO "检查$command_to_test是否支持交互模式" - $command_to_test --help | grep -q "\-i" #假设-i参数表示交互模式 - if [ $? -ne 0 ]; then - LOG_ERROR "命令$command_to_test不支持交互模式" - exit 255 - fi - - # 执行交互模式测试(模拟输入) - LOG_INFO "测试$command_to_test在交互模式下是否能正常执行" - echo -e "input_for_interactive_mode\nexit" | $command_to_test -i - CHECK_RESULT $? 0 0 "$command_to_test交互模式执行失败" - - #环境恢复:若脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0]; then - LOG_INFO “卸载tex live- fbi thesis- doc 软体包裹” - dnf remove – y tex live- fbi thesis- doc - CHECK_RESULT $?00“卸载 tex live- fbi thesis- doc软体包裹失败” - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_options.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_options.sh deleted file mode 100644 index a876612a057..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_options.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令选项验证功能,验证命令的所有选项是否可用且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否有texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证命令选项功能 - LOG_INFO "验证texlive-fbithesis-doc命令选项功能" - # 假设命令为fbithesis,验证其选项 - fbithesis --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fbithesis命令--help选项不可用" - - fbithesis --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fbithesis命令--version选项不可用" - - # 其他选项验证可根据实际命令选项添加 - # 例如:fbithesis --option1 - # CHECK_RESULT $? 0 0 "fbithesis命令--option1选项不可用" - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_output.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_output.sh deleted file mode 100644 index 49c9f2fd9b0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_output.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令的输出验证功能,验证命令执行后的输出是否符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否在yum源中 - if ! dnf list texlive-fbithesis-doc &> /dev/null; then - LOG_ERROR "软件包 texlive-fbithesis-doc 不在yum源中" - exit 255 - fi - - # 检查环境是否已安装软件包 - if rpm -q texlive-fbithesis-doc &> /dev/null; then - LOG_INFO "软件包 texlive-fbithesis-doc 已安装" - INSTALLED=true - else - LOG_INFO "软件包 texlive-fbithesis-doc 未安装,开始安装" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装 texlive-fbithesis-doc 失败" - INSTALLED=false - fi - - # 验证命令输出功能 - LOG_INFO "开始验证 texlive-fbithesis-doc 命令输出功能" - command_output=$(texdoc fbithesis) - CHECK_RESULT $? 0 0 "执行 texdoc fbithesis 失败" - - # 检查命令输出是否符合预期 - expected_output="fbithesis documentation" - if [[ "$command_output" != *"$expected_output"* ]]; then - LOG_ERROR "命令输出不符合预期" - exit 1 - else - LOG_INFO "命令输出验证成功" - fi - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-fbithesis-doc" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载 texlive-fbithesis-doc 失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_output_format.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_output_format.sh deleted file mode 100644 index 3d4801ee12d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_output_format.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令的输出格式验证功能,验证命令执行后的输出格式是否符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-fbithesis-doc软件包提供的命令的输出格式验证功能" - - # 检查软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证命令输出格式是否符合预期 - LOG_INFO "验证命令输出格式是否符合预期" - output=$(texdoc fbithesis 2>&1) - CHECK_RESULT $? 0 0 "执行texdoc fbithesis命令失败" - - # 检查输出是否包含预期内容 - echo "$output" | grep -q "fbithesis documentation" - CHECK_RESULT $? 0 0 "命令输出格式不符合预期" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_syntax.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_syntax.sh deleted file mode 100644 index 9dd11b213a2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_syntax.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令语法验证功能,验证命令的语法是否正确且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc软件包..." - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时将保持安装状态。" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试完成后卸载。" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包..." - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包。" - exit 255 - fi - - # 若未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-fbithesis-doc软件包..." - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败。" - fi - - # 验证命令语法功能是否符合预期 - LOG_INFO "验证命令语法功能是否符合预期..." - command_to_test="fbithesis" - $command_to_test --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令语法验证失败。" - - # 清理环境:若脚本开始时未安装,则卸载软件包;否则保持安装状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-fbithesis-doc软件包..." - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败。" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_timeout.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_timeout.sh deleted file mode 100644 index f1509e9bfa4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_timeout.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令超时功能,验证命令在超时设置下是否能正常执行并返回预期结果 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-fbithesis-doc软件包 - LOG_INFO "检查是否已安装texlive-fbithesis-doc软件包" - rpm -q texlive-fbithesis-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证命令超时功能 - LOG_INFO "验证命令超时功能" - timeout 5s texdoc fbithesis > /dev/null 2>&1 - CHECK_RESULT $? 124 0 "命令未在超时时间内执行完成" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_usage.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_usage.sh deleted file mode 100644 index f3f90222f63..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_usage.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令使用说明验证功能,验证命令的使用说明是否完整且可访问 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证命令的使用说明是否完整且可访问 - LOG_INFO "验证命令的使用说明是否完整且可访问" - man texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-fbithesis-doc命令使用说明不可访问" - - # 如果之前未安装,则在脚本结束前卸载texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_version.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_version.sh deleted file mode 100644 index a9dea39bc88..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_command_version.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的命令的版本查询功能,验证命令是否能正确返回版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否在yum源中 - LOG_INFO "检查texlive-fbithesis-doc软件包是否在yum源中" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 测试命令版本查询功能 - LOG_INFO "测试texlive-fbithesis-doc提供的命令版本查询功能" - command_output=$(texdoc --version 2>&1) - if [ $? -ne 0 ]; then - LOG_ERROR "命令版本查询失败" - exit 255 - fi - - # 验证版本信息是否正确返回 - LOG_INFO "验证版本信息是否正确返回" - if [ -z "$command_output" ]; then - LOG_ERROR "未返回版本信息" - exit 1 - else - LOG_INFO "版本信息: $command_output" - fi - - # 如果最初未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_dependencies.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_dependencies.sh deleted file mode 100644 index 958f9c5d816..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_dependencies.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的依赖关系验证功能,验证所有依赖包是否已正确安装且版本符合要求 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-fbithesis-doc软件包" - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证依赖关系 - LOG_INFO "验证texlive-fbithesis-doc的依赖关系" - rpm -qR texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取依赖关系失败" - - # 检查依赖包是否已安装且版本符合要求 - LOG_INFO "检查依赖包是否已安装且版本符合要求" - for dep in $(rpm -qR texlive-fbithesis-doc); do - # 过滤掉版本号中的比较符号 - pkg_name=$(echo "$dep" | sed "s/[<=>].*//") - if ! rpm -q "$pkg_name" > /dev/null 2>&1; then - LOG_ERROR "依赖包$pkg_name未安装" - exit 255 - fi - done - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_documentation.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_documentation.sh deleted file mode 100644 index bf0b8fe6044..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_documentation.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的文档验证功能,验证文档是否完整且可访问 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否在yum源中 - LOG_INFO "检查texlive-fbithesis-doc软件包是否在yum源中" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-fbithesis-doc软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,开始安装" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - INSTALLED=false - fi - - # 验证文档是否完整且可访问 - LOG_INFO "验证texlive-fbithesis-doc文档是否完整且可访问" - DOC_PATH=$(rpm -ql texlive-fbithesis-doc | grep -m1 "/doc/") - if [ -z "$DOC_PATH" ]; then - LOG_ERROR "未找到texlive-fbithesis-doc文档路径" - exit 255 - fi - - # 检查文档目录是否存在 - LOG_INFO "检查文档目录是否存在" - if [ ! -d "$DOC_PATH" ]; then - LOG_ERROR "文档目录不存在" - exit 255 - fi - - # 检查文档文件是否可访问 - LOG_INFO "检查文档文件是否可访问" - find "$DOC_PATH" -type f | while read -r file; do - if [ ! -r "$file" ]; then - LOG_ERROR "文档文件不可访问: $file" - exit 255 - fi - done - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_environment.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_environment.sh deleted file mode 100644 index 4419e35a6fa..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_environment.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的环境验证功能,验证安装后的环境变量是否设置正确且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试texlive-fbithesis-doc软件包的环境验证功能" - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查texlive-fbithesis-doc软件包是否存在于yum源中" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-fbithesis-doc软件包不存在于yum源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,开始安装" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - INSTALLED=false - fi - - # 验证环境变量设置是否正确 - LOG_INFO "验证环境变量设置是否正确" - env | grep TEXLIVE_FBITHEIS_DOC > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "环境变量TEXLIVE_FBITHEIS_DOC未设置" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_file_permissions.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_file_permissions.sh deleted file mode 100644 index 378d2ffefe8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_file_permissions.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的文件权限验证功能,验证安装后的文件权限是否符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否在yum源中 - LOG_INFO "检查texlive-fbithesis-doc软件包是否在yum源中" - dnf list available texlive-fbithesis-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-fbithesis-doc软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-fbithesis-doc已安装" - else - installed=false - LOG_INFO "texlive-fbithesis-doc未安装,将进行安装" - fi - - # 如果未安装,则安装texlive-fbithesis-doc - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证文件权限 - LOG_INFO "验证texlive-fbithesis-doc文件权限" - files=$(rpm -ql texlive-fbithesis-doc) - for file in $files; do - if [ -f "$file" ]; then - permissions=$(stat -c "%a" "$file") - if [ "$permissions" -ne 644 ]; then - LOG_ERROR "文件 $file 的权限不符合预期(644),实际为 $permissions" - exit 1 - fi - fi - done - LOG_INFO "所有文件权限验证通过" - - # 如果脚本安装的软件包,则在结束时卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_installation.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_installation.sh deleted file mode 100644 index ac035c9c20f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_installation.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的安装验证功能,验证安装后的文件是否完整且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - LOG_INFO "texlive-fbithesis-doc软件包安装成功" - fi - - # 验证安装后的文件是否完整且符合预期 - LOG_INFO "验证安装后的文件是否完整且符合预期" - rpm -ql texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-fbithesis-doc软件包文件失败" - - # 如果脚本开始时未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始卸载texlive-fbithesis-doc软件包以恢复环境" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - LOG_INFO "texlive-fbithesis-doc软件包卸载成功" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_package_integrity.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_package_integrity.sh deleted file mode 100644 index 9dcf5412a7c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_package_integrity.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的完整性验证功能,验证软件包的所有文件是否完整且未被篡改 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试texlive-fbithesis-doc软件包的完整性验证功能" - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查texlive-fbithesis-doc是否在yum源中" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-fbithesis-doc不在yum源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,无需重新安装" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,开始安装" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - INSTALLED=false - fi - - # 验证软件包完整性 - LOG_INFO "验证texlive-fbithesis-doc软件包完整性" - rpm -V texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-fbithesis-doc软件包完整性验证失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_autostart.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_autostart.sh deleted file mode 100644 index eac2794a81d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_autostart.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务自动启动功能,验证服务是否能在系统启动时自动启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-fbithesis-doc软件包提供的服务自动启动功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-fbithesis-doc软件包是否在yum源中" - dnf list texlive-fbithesis-doc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-fbithesis-doc软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装texlive-fbithesis-doc软件包" - rpm -q texlive-fbithesis-doc &> /dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-fbithesis-doc软件包已安装" - else - installed=false - LOG_INFO "texlive-fbithesis-doc软件包未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证服务自动启动功能 - LOG_INFO "验证texlive-fbithesis-doc服务是否在系统启动时自动启动" - systemctl is-enabled texlive-fbithesis-doc &> /dev/null - CHECK_RESULT $? 0 0 "texlive-fbithesis-doc服务未设置为自动启动" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_config.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_config.sh deleted file mode 100644 index a94fea7dcbb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_config.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务配置验证功能,验证服务配置是否正确且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - installed=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-fbithesis-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证服务配置是否正确 - LOG_INFO "验证服务配置是否正确" - # 假设验证命令为check-config,此处仅为示例,实际命令需根据具体需求调整 - check-config --validate > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务配置验证失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包以恢复环境" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_dependencies.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_dependencies.sh deleted file mode 100644 index a43d3307fa2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_dependencies.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务依赖关系验证功能,验证服务所需的所有依赖是否已正确安装且版本符合要求 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,保持安装状态" - installed=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 安装texlive-fbithesis-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证服务依赖关系 - LOG_INFO "验证texlive-fbithesis-doc的服务依赖关系" - rpm -qR texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "验证依赖关系失败" - - # 检查依赖版本是否符合要求(示例:检查是否依赖特定版本的texlive) - LOG_INFO "检查依赖版本是否符合要求" - rpm -q --requires texlive-fbithesis-doc | grep texlive - CHECK_RESULT $? 0 0 "依赖版本不符合要求" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_failure_recovery.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_failure_recovery.sh deleted file mode 100644 index 2560869fa0d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_failure_recovery.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务故障恢复功能,验证服务在异常终止后是否能自动恢复 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - installed=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - LOG_INFO "texlive-fbithesis-doc软件包安装成功" - fi - - # 验证服务故障恢复功能 - LOG_INFO "验证texlive-fbithesis-doc服务故障恢复功能" - - # 模拟服务异常终止(假设服务名为fbithesis) - LOG_INFO "模拟fbithesis服务异常终止" - pkill -9 fbithesis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "终止fbithesis服务失败" - - # 等待服务恢复 - LOG_INFO "等待fbithesis服务恢复" - sleep 5 - - # 检查服务是否恢复运行 - LOG_INFO "检查fbithesis服务是否恢复运行" - pgrep fbithesis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 \“fbitheis未自动恢复” - - # 清理环境(如果最初未安装,则卸载) - if [ "$installed" = false ]; then - LOG_INFO \“卸载 texliv e-fbith esis-do c 软 件 包” - dnf remove -y texliv e fbith esis-do c >/ dev/ null 2>&1 - CHECK_ RESULT $? 0 0 \“卸载失败” - LOG_ INFO \“环境清理完成” - else - LOG_ INFO \“保持环境不变” - fi - - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_health.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_health.sh deleted file mode 100644 index 2b47d094fd7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_health.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务健康检查功能,验证服务是否能正常响应健康检查请求 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-fbithesis-doc软件包是否已安装 - LOG_INFO "检查texlive-fbithesis-doc软件包是否已安装" - rpm -q texlive-fbithesis-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装" - installed=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-fbithesis-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证服务健康检查功能是否正常 - LOG_INFO "验证服务健康检查功能是否正常" - - # 假设健康检查命令为检查某个服务状态,这里以示例命令为例(实际需替换为真实命令) - service_health_cmd="systemctl status texlive-fbithesis-doc" - - # 执行健康检查命令 - $service_health_cmd - CHECK_RESULT $? 0 0 "服务健康检查失败" - - # 如果之前未安装,则在测试完成后卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "测试完成,卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_log_rotation.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_log_rotation.sh deleted file mode 100644 index ab41e93c192..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_service_log_rotation.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包提供的服务日志轮转功能,验证日志轮转是否正常执行且符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-fbithesis-doc软件包 - LOG_INFO "检查是否已经安装了texlive-fbithesis-doc软件包" - dnf list installed texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否有texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-fbithesis-doc软件包" - - # 安装texlive-fbithesis-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc软件包" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "安装texlive-fbithesis-doc软件包失败" - fi - - # 验证日志轮转功能 - LOG_INFO "验证日志轮转功能是否符合预期" - logrotate /etc/logrotate.d/texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志轮转功能执行失败" - - # 检查日志文件是否存在且内容符合预期 - LOG_INFO "检查日志文件是否存在且内容符合预期" - ls /var/log/texlive-fbithesis-doc.log > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志文件不存在" - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fbithesis-doc软件包" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "卸载texlive-fbithesis-doc软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_uninstall_cleanup.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_uninstall_cleanup.sh deleted file mode 100644 index 3a2e54f0398..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fbithesis-doc/test_texlive-fbithesis-doc_verify_uninstall_cleanup.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-fbithesis-doc软件包的卸载清理功能,验证卸载后相关文件和配置是否被正确清理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-fbithesis-doc软件包的卸载清理功能,验证卸载后相关文件和配置是否被正确清理" - - # 检查yum源中是否存在texlive-fbithesis-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fbithesis-doc软件包" - dnf list available texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fbithesis-doc软件包" - exit 255 - fi - - # 检查是否已安装texlive-fbithesis-doc - LOG_INFO "检查是否已安装texlive-fbithesis-doc" - rpm -q texlive-fbithesis-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fbithesis-doc已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-fbithesis-doc未安装,将进行安装测试" - INSTALLED=false - fi - - # 如果未安装,则进行安装 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-fbithesis-doc" - dnf install -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fbithesis-doc失败" - fi - - # 验证安装后的文件和配置是否存在(示例路径,需根据实际情况调整) - LOG_INFO "验证安装后的文件和配置是否存在" - ls /usr/share/texlive/texmf-dist/tex/latex/fbithesis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装后文件未正确生成" - - # 卸载texlive-fbithesis-doc(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始卸载texlive-fbithesis-doc" - dnf remove -y texlive-fbithesis-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fbithesis-doc失败" - - # 验证卸载后的文件和配置是否被清理 - LOG_INFO "验证卸载后的文件和配置是否被清理" - ls /usr/share/texlive/texmf-dist/tex/latex/fbithesis > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR卸载后文件未被清理" - exit 1 - fi - - else - LOG_INFO环境已安装,跳过卸载步骤" - fi - - LOG_INFO测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphenex/test_texlive-hyphenex_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphenex/test_texlive-hyphenex_function_basic.sh deleted file mode 100644 index 4ea1ae1a8ca..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphenex/test_texlive-hyphenex_function_basic.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-26 -# @License : Mulan PSL v2 -# @Desc : Test basic command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-hyphenex - LOG_INFO "检查是否已经安装texlive-hyphenex" - rpm -q texlive-hyphenex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hyphenex已经安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-hyphenex未安装,脚本结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-hyphenex软件包 - LOG_INFO "检查yum源中是否有texlive-hyphenex软件包" - dnf list available texlive-hyphenex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-hyphenex软件包" - - # 安装texlive-hyphenex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-hyphenex" - dnf install -y texlive-hyphenex - CHECK_RESULT $? 0 255 "安装texlive-hyphenex失败" - fi - - # 测试基本命令用法 - LOG_INFO "测试基本命令用法" - texlua hyphenex.lua --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlua hyphenex.lua --help命令不支持或参数错误" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-hyphenex" - dnf remove -y texlive-hyphenex - CHECK_RESULT $? 0 255 "卸载texlive-hyphenex失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphenex/test_texlive-hyphenex_function_usage_example.sh b/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphenex/test_texlive-hyphenex_function_usage_example.sh deleted file mode 100644 index be6a85c05ff..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphenex/test_texlive-hyphenex_function_usage_example.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : Test a basic hyphenation example with LaTeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-hyphenex包 - LOG_INFO "检查texlive-hyphenex是否已安装" - rpm -q texlive-hyphenex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hyphenex已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-hyphenex未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-hyphenex包 - LOG_INFO "检查yum源中是否有texlive-hyphenex包" - dnf list available texlive-hyphenex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有texlive-hyphenex包,退出测试" - - # 如果未安装,则安装texlive-hyphenex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-hyphenex包" - dnf install -y texlive-hyphenex - CHECK_RESULT $? 0 0 "安装texlive-hyphenex失败" - fi - - # 测试基本的LaTeX连字符示例 - LOG_INFO "测试基本的LaTeX连字符示例" - cat > test_hyphen.tex << "EOF" - \documentclass{article} - \usepackage[english]{babel} - \usepackage{hyphenat} - \begin{document} - This is a test of hyphenation in LaTeX with a verylongwordthatshouldbehyphenated. - \end{document} - EOF - - # 检查是否安装了pdflatex命令 - LOG_INFO "检查pdflatex命令是否可用" - which pdflatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pdflatex命令不存在,无法执行LaTeX编译" - # 如果之前未安装texlive-hyphenex,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-hyphenex包" - dnf remove -y texlive-hyphenex - CHECK_RESULT $? 0 0 "卸载texlive-hyphenex失败" - fi - exit 255 - fi - - # 编译LaTeX文档 - LOG_INFO "编译LaTeX文档" - pdflatex -interaction=nonstopmode test_hyphen.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "LaTeX编译失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_hyphen.pdf ]; then - LOG_INFO "PDF文件生成成功" - # 检查PDF文件是否包含预期的文本 - pdftotext test_hyphen.pdf test_hyphen.txt 2>/dev/null - if grep -q "hyphenation" test_hyphen.txt; then - LOG_INFO "PDF文件内容符合预期" - else - LOG_ERROR "PDF文件内容不符合预期" - # 如果之前未安装texlive-hyphenex,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-hyphenex包" - dnf remove -y texlive-hyphenex - CHECK_RESULT $? 0 0 "卸载texlive-hyphenex失败" - fi - exit 1 - fi - else - LOG_ERROR "PDF文件未生成" - # 如果之前未安装texlive-hyphenex,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-hyphenex包" - dnf remove -y texlive-hyphenex - CHECK_RESULT $? 0 0 "卸载texlive-hyphenex失败" - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_hyphen.tex test_hyphen.pdf test_hyphen.txt test_hyphen.aux test_hyphen.log test_hyphen.out - - # 如果之前未安装texlive-hyphenex,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-hyphenex包" - dnf remove -y texlive-hyphenex - CHECK_RESULT $? 0 0 "卸载texlive-hyphenex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_atomic_orbital.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_atomic_orbital.sh deleted file mode 100644 index 78cb5f632e9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_atomic_orbital.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test generation of atomic orbital diagrams -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:生成原子轨道图" - - # 检查环境是否已安装texlive-modiagram软件包 - LOG_INFO "检查texlive-modiagram是否已安装" - if dnf list installed texlive-modiagram &>/dev/null; then - LOG_INFO "texlive-modiagram已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-modiagram未安装,将在测试中安装并在结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-modiagram软件包 - LOG_INFO "检查yum源中是否有texlive-modiagram" - if ! dnf list available texlive-modiagram &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-modiagram软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-modiagram" - dnf install -y texlive-modiagram - CHECK_RESULT $? 0 0 "安装texlive-modiagram失败" - fi - - # 检查modiagram命令是否可用 - LOG_INFO "检查modiagram命令是否可用" - if ! command -v modiagram &>/dev/null; then - LOG_ERROR "modiagram命令不存在" - exit 255 - fi - - # 测试生成原子轨道图的基本功能 - LOG_INFO "测试生成原子轨道图的基本功能" - modiagram --help - CHECK_RESULT $? 0 0 "modiagram命令执行失败" - - # 测试生成氢原子轨道图 - LOG_INFO "测试生成氢原子轨道图" - modiagram "H" - CHECK_RESULT $? 0 0 "生成氢原子轨道图失败" - - # 测试生成氧原子轨道图 - LOG_INFO "测试生成氧原子轨道图" - modiagram "O" - CHECK_RESULT $? 0 0 "生成氧原子轨道图失败" - - # 测试生成铁原子轨道图 - LOG_INFO "测试生成铁原子轨道图" - modiagram "Fe" - CHECK_RESULT $? 0 0 "生成铁原子轨道图失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - modiagram --invalid-option 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 0 ]; then - LOG_ERROR "modiagram命令不支持--invalid-option参数" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-modiagram" - dnf remove -y texlive-modiagram - CHECK_RESULT $? 0 0 "卸载texlive-modiagram失败" - fi - - LOG_INFO "测试完成:生成原子轨道图" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_basic.sh deleted file mode 100644 index ab0ef18b3a7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_basic.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic diagram generation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-modiagram - LOG_INFO "检查是否已安装texlive-modiagram" - if dnf list installed texlive-modiagram &>/dev/null; then - LOG_INFO "texlive-modiagram已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-modiagram未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-modiagram - LOG_INFO "检查yum源中是否有texlive-modiagram" - if ! dnf list available texlive-modiagram &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-modiagram" - exit 255 - fi - - # 安装texlive-modiagram - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-modiagram" - dnf install -y texlive-modiagram - CHECK_RESULT $? 0 0 "安装texlive-modiagram失败" - fi - - # 测试基本图表生成功能 - LOG_INFO "测试基本图表生成功能" - texdiagram --test-diagram basic-diagram.tex - CHECK_RESULT $? 0 0 "生成基本图表失败" - - # 清理环境:如果脚本开始时未安装,则卸载texlive-modiagram - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-modiagram" - dnf remove -y texlive-modiagram - CHECK_RESULT $? 0 0 "卸载texlive-modiagram失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_basic_compile.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_basic_compile.sh deleted file mode 100644 index fc842c35494..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_basic_compile.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX document compilation with modiagram package loaded -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:基本LaTeX文档编译,加载modiagram包" - LOG_INFO "步骤1:检查yum源中是否存在texlive-modiagram软件包" - dnf list available texlive-modiagram > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-modiagram软件包" - LOG_INFO "步骤2:检查系统是否已安装texlive-modiagram" - if dnf list installed texlive-modiagram > /dev/null 2>&1; then - LOG_INFO "texlive-modiagram已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-modiagram未安装,将在测试过程中安装" - INSTALLED=0 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-modiagram软件包" - dnf install -y texlive-modiagram - CHECK_RESULT $? 0 0 "安装texlive-modiagram失败" - fi - LOG_INFO "步骤4:创建测试LaTeX文档" - cat > test_modiagram.tex << "EOF" - \documentclass{article} - \usepackage{modiagram} - \begin{document} - Test document with modiagram package. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - LOG_INFO "步骤5:使用pdflatex编译LaTeX文档" - pdflatex -interaction=nonstopmode test_modiagram.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - LOG_INFO "步骤6:检查是否生成PDF文件" - if [ -f test_modiagram.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - LOG_INFO "步骤7:清理测试生成的文件" - rm -f test_modiagram.tex test_modiagram.aux test_modiagram.log test_modiagram.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载texlive-modiagram软件包" - dnf remove -y texlive-modiagram - CHECK_RESULT $? 0 0 "卸载texlive-modiagram失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_custom_levels.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_custom_levels.sh deleted file mode 100644 index 894f59f09b0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_custom_levels.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test setting custom energy levels and labels in diagrams -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化 - LOG_INFO "开始测试自定义能级标签功能" - - # 检查是否已安装texlive-modiagram - LOG_INFO "检查texlive-modiagram是否已安装" - rpm -q texlive-modiagram > /dev/null 2>&1 - installed=$? - - # 如果未安装,则安装 - if [ $installed -ne 0 ]; then - LOG_INFO "texlive-modiagram未安装,准备安装" - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-modiagram" - dnf list available texlive-modiagram > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-modiagram软件包" - - # 安装软件包 - LOG_INFO "安装texlive-modiagram" - dnf install -y texlive-modiagram - CHECK_RESULT $? 0 0 "安装texlive-modiagram失败" - else - LOG_INFO "texlive-modiagram已安装,跳过安装步骤" - fi - - # 测试自定义能级标签功能 - LOG_INFO "测试自定义能级标签功能" - # 创建一个简单的LaTeX文件来测试modiagram的自定义能级标签 - cat > test_custom_levels.tex << "EOF" - \documentclass{article} - \usepackage{modiagram} - \begin{document} - \begin{MOdiagram} - \atom{left}{ 1s = {0;up} } - \atom{right}{ 1s = {0;up} } - \molecule{ - 1sMO = {1;pair}, - } - \EnergyAxis[title={Energy}] - \draw (left-1s) -- (1sMO); - \draw (right-1s) -- (1sMO); - \end{MOdiagram} - \end{document} - EOF - - # 使用modiagram编译LaTeX文件 - LOG_INFO "使用modiagram编译测试文件" - pdflatex -interaction=nonstopmode test_custom_levels.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译包含自定义能级标签的LaTeX文件失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_custom_levels.pdf ]; then - LOG_INFO "成功生成包含自定义能级标签的PDF文件" - else - LOG_ERROR "未生成包含自定义能级标签的PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_custom_levels.tex test_custom_levels.aux test_custom_levels.log test_custom_levels.pdf - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-modiagram" - dnf remove -y texlive-modiagram - CHECK_RESULT $? 0 0 "卸载texlive-modiagram失败" - else - LOG_INFO "保持texlive-modiagram安装状态" - fi - - LOG_INFO "测试自定义能级标签功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_install.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_install.sh deleted file mode 100644 index 074c08210c7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_install.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test if the package can be installed successfully via package manager -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-modiagram - LOG_INFO "检查texlive-modiagram是否已安装..." - dnf list installed texlive-modiagram &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-modiagram已安装,测试结束后将保持安装状态。" - INSTALLED=1 - else - LOG_INFO "texlive-modiagram未安装。" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-modiagram软件包 - LOG_INFO "检查yum源中是否存在texlive-modiagram软件包..." - dnf list available texlive-modiagram &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-modiagram软件包。" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-modiagram软件包..." - dnf install -y texlive-modiagram - CHECK_RESULT $? 0 0 "安装texlive-modiagram失败。" - LOG_INFO "texlive-modiagram安装成功。" - fi - - # 测试软件包功能:检查modiagram命令是否存在 - LOG_INFO "测试modiagram命令是否可用..." - which modiagram &>/dev/null - CHECK_RESULT $? 0 0 "modiagram命令未找到,软件包可能未正确安装。" - - # 测试软件包功能:尝试运行modiagram命令的help选项 - LOG_INFO "测试modiagram命令的help选项..." - modiagram --help &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "modiagram命令不支持--help参数。" - exit 255 - fi - CHECK_RESULT $? 0 0 "modiagram命令执行失败。" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-modiagram软件包..." - dnf remove -y texlive-modiagram - CHECK_RESULT $? 0 0 "卸载texlive-modiagram失败。" - LOG_INFO "texlive-modiagram卸载成功,环境已恢复。" - else - LOG_INFO "测试完成,保持texlive-modiagram安装状态。" - fi - - LOG_INFO "测试完成:软件包可以通过包管理器成功安装。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_mo_diagram.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_mo_diagram.sh deleted file mode 100644 index 8797337594f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_mo_diagram.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test generation of a basic molecular orbital diagram -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:生成基本分子轨道图" - - # 检查系统是否已安装texlive-modiagram软件包 - LOG_INFO "步骤1: 检查系统是否已安装texlive-modiagram" - if rpm -q texlive-modiagram &> /dev/null; then - LOG_INFO "texlive-modiagram已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-modiagram未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否存在texlive-modiagram软件包 - LOG_INFO "步骤2: 检查yum源中是否存在texlive-modiagram软件包" - if ! dnf list available texlive-modiagram &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-modiagram软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-modiagram软件包" - dnf install -y texlive-modiagram - CHECK_RESULT $? 0 0 "安装texlive-modiagram失败" - fi - - # 验证mo-diagram命令是否存在 - LOG_INFO "步骤4: 验证mo-diagram命令是否存在" - command -v mo-diagram &> /dev/null - CHECK_RESULT $? 0 0 "mo-diagram命令不存在" - - # 测试mo-diagram命令的基本参数 - LOG_INFO "步骤5: 测试mo-diagram命令的基本参数" - mo-diagram --help &> /dev/null - CHECK_RESULT $? 0 0 "mo-diagram命令不支持--help参数" - - # 生成一个基本的分子轨道图 - LOG_INFO "步骤6: 生成一个基本的分子轨道图" - cat > test_mo.tex << "EOF" - \documentclass{article} - \usepackage{modiagram} - \begin{document} - \begin{MOdiagram} - \atom{left}{1s,2s,2p} - \atom{right}{1s,2s,2p} - \molecule{ - 1sMO = 1s + 1s, - 2sMO = 2s + 2s, - 2pMO = 2p + 2p - } - \end{MOdiagram} - \end{document} - EOF - - # 使用mo-diagram生成PDF - LOG_INFO "步骤7: 使用mo-diagram生成PDF" - mo-diagram test_mo.tex - CHECK_RESULT $? 0 0 "生成分子轨道图失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "步骤8: 检查生成的PDF文件是否存在" - if [ -f test_mo.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 清理生成的文件 - LOG_INFO "步骤9: 清理生成的文件" - rm -f test_mo.tex test_mo.pdf test_mo.aux test_mo.log - - # 如果测试开始时未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤10: 卸载texlive-modiagram软件包" - dnf remove -y texlive-modiagram - CHECK_RESULT $? 0 0 "卸载texlive-modiagram失败" - fi - - LOG_INFO "测试完成:生成基本分子轨道图" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_style_options.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_style_options.sh deleted file mode 100644 index b5df0ec18bc..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modiagram/test_texlive-modiagram_function_style_options.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test applying different styles and colors to diagram elements -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="texlive-modiagram" - TEST_COMMAND="modiagram" - TEST_FILE="test_diagram.tex" - - # 步骤1: 检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1: 检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2: 检查环境是否已经安装软件包 - LOG_INFO "步骤2: 检查环境是否已经安装软件包 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 创建测试用的LaTeX文件 - LOG_INFO "步骤4: 创建测试用的LaTeX文件 $TEST_FILE" - cat > $TEST_FILE << "EOF" - \documentclass{article} - \usepackage{modiagram} - \begin{document} - \begin{MOdiagram} - \atom{left}{1s, 2s, 2p}{} - \atom{right}{1s, 2s, 2p}{} - \molecule{ - 1sMO = {1s, 0, pair}, - 2sMO = {2s, 0, pair}, - 2pMO = {2p, 0, pair} - } - \end{MOdiagram} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件 $TEST_FILE 失败" - - # 步骤5: 测试应用不同样式和颜色到图表元素 - LOG_INFO "步骤5: 测试应用不同样式和颜色到图表元素" - - # 测试样式参数 - LOG_INFO "测试样式参数:style=square" - pdflatex -interaction=nonstopmode "\PassOptionsToPackage{style=square}{modiagram}\input{$TEST_FILE}" &>/dev/null - CHECK_RESULT $? 0 0 "应用样式 style=square 失败" - - LOG_INFO "测试样式参数:style=rounded" - pdflatex -interaction=nonstopmode "\PassOptionsToPackage{style=rounded}{modiagram}\input{$TEST_FILE}" &>/dev/null - CHECK_RESULT $? 0 0 "应用样式 style=rounded 失败" - - # 测试颜色参数 - LOG_INFO "测试颜色参数:color=blue" - pdflatex -interaction=nonstopmode "\PassOptionsToPackage{color=blue}{modiagram}\input{$TEST_FILE}" &>/dev/null - CHECK_RESULT $? 0 0 "应用颜色 color=blue 失败" - - LOG_INFO "测试颜色参数:color=red" - pdflatex -interaction=nonstopmode "\PassOptionsToPackage{color=red}{modiagram}\input{$TEST_FILE}" &>/dev/null - CHECK_RESULT $? 0 0 "应用颜色 color=red 失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数:unsupported=option" - pdflatex -interaction=nonstopmode "\PassOptionsToPackage{unsupported=option}{modiagram}\input{$TEST_FILE}" &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "不支持的参数 unsupported=option 应该导致失败" - exit 255 - else - LOG_INFO "不支持的参数 unsupported=option 正确导致失败" - fi - - # 步骤6: 清理测试生成的文件 - LOG_INFO "步骤6: 清理测试生成的文件" - rm -f $TEST_FILE *.aux *.log *.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤7: 如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤7: 卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤7: 保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成,所有步骤均成功执行" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mweights/test_texlive-mweights_function_install.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mweights/test_texlive-mweights_function_install.sh deleted file mode 100644 index dbd555e14b8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mweights/test_texlive-mweights_function_install.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-28 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-mweights package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-mweights - LOG_INFO "检查是否已经安装了texlive-mweights" - rpm -q texlive-mweights > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mweights已经安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-mweights未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-mweights软件包 - LOG_INFO "检查yum源中是否有texlive-mweights软件包" - dnf list available texlive-mweights > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有texlive-mweights软件包" - - # 安装texlive-mweights软件包 - LOG_INFO "安装texlive-mweights软件包" - dnf install -y texlive-mweights > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-mweights失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-mweights是否安装成功" - rpm -q texlive-mweights > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-mweights安装验证失败" - - # 测试texlive-mweights功能(假设有一个测试命令) - LOG_INFO "测试texlive-mweights功能" - test_command="texdoc mweights" # 假设的测试命令,实际应根据软件包文档调整 - $test_command > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlive-mweights功能测试失败或参数不支持" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-mweights软件包" - dnf remove -y texlive-mweights > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-mweights失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-geo/test_texlive-pst-geo_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-geo/test_texlive-pst-geo_function_basic.sh deleted file mode 100644 index 88a673b1184..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-geo/test_texlive-pst-geo_function_basic.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test for texlive-pst-geo -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-pst-geo_function_basic - - LOG_INFO "开始执行测试脚本:Basic functionality test for texlive-pst-geo" - - # 检查是否已安装texlive-pst-geo - LOG_INFO "检查texlive-pst-geo是否已安装" - if dnf list installed texlive-pst-geo &>/dev/null; then - LOG_INFO "texlive-pst-geo已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pst-geo未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-pst-geo - LOG_INFO "检查yum源中是否有texlive-pst-geo" - if ! dnf list available texlive-pst-geo &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-pst-geo" - exit 255 - fi - - # 安装texlive-pst-geo(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-pst-geo" - dnf install -y texlive-pst-geo - CHECK_RESULT $? 0 0 "安装texlive-pst-geo失败" - fi - - # 测试texlive-pst-geo基本功能 - LOG_INFO "测试texlive-pst-geo基本功能" - if ! command -v tex &>/dev/null; then - LOG_ERROR "tex命令不存在或不支持" - exit 255 - fi - - # 执行测试命令(示例:检查pst-geo是否可用) - LOG_INFO "执行测试命令:检查pst-geo是否可用" - echo "\documentclass{article}\usepackage{pst-geo}\begin{document}\end{document}" > test.tex - pdflatex test.tex &>/dev/null - CHECK_RESULT $? 0 0 "pst-geo功能测试失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test.tex test.aux test.log test.pdf - - # 卸载texlive-pst-geo(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-pst-geo" - dnf remove -y texlive-pst-geo - CHECK_RESULT $? 0 0 "卸载texlive-pst-geo失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-t/texlive-relenc/test_texlive-relenc_rollback.sh b/testcases/function_test/pkg_test/texlive-split-t/texlive-relenc/test_texlive-relenc_rollback.sh deleted file mode 100644 index 57c85839a09..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-t/texlive-relenc/test_texlive-relenc_rollback.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-28 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-relenc软件包的回滚功能,验证是否能够正确回滚到之前的版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-relenc软件包是否已安装 - LOG_INFO "检查texlive-relenc软件包是否已安装" - rpm -q texlive-relenc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-relenc软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-relenc软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-relenc软件包 - LOG_INFO "检查yum源中是否存在texlive-relenc软件包" - dnf list available texlive-relenc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-relenc软件包" - exit 255 - fi - - # 安装texlive-relenc软件包 - LOG_INFO "开始安装texlive-relenc软件包" - dnf install -y texlive-relenc - CHECK_RESULT $? 0 0 "安装texlive-relenc软件包失败" - - # 获取当前安装的texlive-relenc版本 - LOG_INFO "获取当前安装的texlive-relenc版本" - CURRENT_VERSION=$(rpm -q texlive-relenc --qf "%{version}-%{release}") - LOG_INFO "当前texlive-relenc版本: $CURRENT_VERSION" - - # 回滚到上一个版本 - LOG_INFO "开始回滚texlive-relenc到上一个版本" - dnf history undo last -y --skip-broken > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "回滚texlive-relenc失败" - - # 验证回滚后的版本 - LOG_INFO "验证回滚后的texlive-relenc版本" - ROLLBACK_VERSION=$(rpm -q texlive-relenc --qf "%{version}-%{release}" 2>/dev/null) - if [ "$ROLLBACK_VERSION" != "$CURRENT_VERSION" ]; then - LOG_INFO "回滚成功,当前版本: $ROLLBACK_VERSION" - else - LOG_ERROR "回滚失败,版本未变化" - exit 1 - fi - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-relenc软件包" - dnf remove -y texlive-relenc - CHECK_RESULT $? 0 0 "卸载texlive-relenc软件包失败" - else - LOG_INFO "环境已恢复,保持texlive-relenc软件包安装状态" - fi - - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_basic.sh deleted file mode 100644 index 2878fe1d95a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_basic.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装texlive-sciposter软件包 - LOG_INFO "检查texlive-sciposter是否已安装" - rpm -q texlive-sciposter > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-sciposter已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-sciposter未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-sciposter软件包 - LOG_INFO "检查yum源中是否存在texlive-sciposter软件包" - dnf list available texlive-sciposter > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-sciposter软件包" - - # 安装texlive-sciposter软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-sciposter软件包" - dnf install -y texlive-sciposter > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-sciposter失败" - fi - - # 测试texlive-sciposter基本功能 - LOG_INFO "测试texlive-sciposter基本功能" - texdoc sciposter > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texdoc sciposter命令执行失败" - - # 检查不支持的命令参数(示例) - LOG_INFO "检查不支持的参数" - texdoc sciposter --invalid-arg > /dev/null 2>&1 - CHECK_RESULT $? 255 255 "不支持的命令参数" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-sciposter软件包" - dnf remove -y texlive-sciposter > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-sciposter失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_basic_usage.sh deleted file mode 100644 index 6c2d87b61fd..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_basic_usage.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : Test basic usage of sciposter document class -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$user@$ip" "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-sciposter" - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE_NAME 软件包" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 检查环境是否已经安装该软件包 - LOG_INFO "检查环境是否已经安装 $PACKAGE_NAME" - dnf list installed $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME 已经安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED = false ]; then - LOG_INFO "安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 测试sciposter文档类的基本用法 - LOG_INFO "测试sciposter文档类的基本用法" - - # 创建一个测试的LaTeX文档 - TEST_FILE="test_sciposter.tex" - cat > $TEST_FILE << "EOF" - \documentclass{sciposter} - \begin{document} - \title{测试标题} - \author{测试作者} - \date{\today} - \maketitle - \begin{abstract} - 这是一个测试摘要。 - \end{abstract} - \section{测试章节} - 这是一个测试章节。 - \end{document} - EOF - - # 检查是否成功创建测试文件 - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用pdflatex编译LaTeX文档 - LOG_INFO "使用pdflatex编译LaTeX文档" - pdflatex $TEST_FILE - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f "${TEST_FILE%.tex}.pdf" ]; then - LOG_INFO "成功生成了PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理生成的中间文件 - LOG_INFO "清理生成的中间文件" - rm -f ${TEST_FILE%.tex}.aux ${TEST_FILE%.tex}.log ${TEST_FILE%.tex}.out ${TEST_FILE%.tex}.pdf $TEST_FILE - - # 如果之前未安装,则在脚本结束前卸载软件包 - if [ $INSTALLED = false ]; then - LOG_INFO "卸载 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_compile_example.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_compile_example.sh deleted file mode 100644 index 44febddb8bf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_compile_example.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : Compile a simple example poster with pdflatex -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Compile a simple example poster with pdflatex" - - # 检查是否已安装texlive-sciposter - LOG_INFO "步骤1:检查texlive-sciposter是否已安装" - if dnf list installed texlive-sciposter &>/dev/null; then - LOG_INFO "texlive-sciposter已安装,测试结束后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-sciposter未安装,将在测试中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-sciposter - LOG_INFO "步骤2:检查yum源中是否有texlive-sciposter软件包" - if ! dnf list available texlive-sciposter &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-sciposter软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-sciposter - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-sciposter" - dnf install -y texlive-sciposter - CHECK_RESULT $? 0 0 "安装texlive-sciposter失败" - fi - - # 检查pdflatex命令是否存在 - LOG_INFO "步骤4:检查pdflatex命令是否存在" - if ! command -v pdflatex &>/dev/null; then - LOG_ERROR "pdflatex命令不存在或不支持" - exit 255 - fi - - # 创建一个简单的LaTeX海报示例文件 - LOG_INFO "步骤5:创建简单的LaTeX海报示例文件" - cat > example_poster.tex << "EOF" - \documentclass[25pt, a0paper, portrait]{sciposter} - \usepackage{graphicx} - \usepackage{multicol} - \usepackage{color} - - \title{Test Poster Title} - \author{Test Author} - \institute{Test Institute} - \email{test@example.com} - - \begin{document} - \maketitle - - \begin{multicols}{2} - \section{Introduction} - This is a test poster to verify pdflatex compilation with sciposter class. - - \section{Conclusion} - The compilation should succeed without errors. - \end{multicols} - - \end{document} - EOF - - CHECK_RESULT $? 0 0 "创建示例LaTeX文件失败" - - # 使用pdflatex编译示例海报 - LOG_INFO "步骤6:使用pdflatex编译示例海报" - pdflatex -interaction=nonstopmode example_poster.tex - CHECK_RESULT $? 0 0 "pdflatex编译失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "步骤7:检查生成的PDF文件是否存在" - if [ -f example_poster.pdf ]; then - LOG_INFO "PDF文件生成成功:example_poster.pdf" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "步骤8:清理临时文件" - rm -f example_poster.tex example_poster.aux example_poster.log example_poster.out example_poster.pdf - - # 如果测试开始时未安装,则卸载texlive-sciposter - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载texlive-sciposter" - dnf remove -y texlive-sciposter - CHECK_RESULT $? 0 0 "卸载texlive-sciposter失败" - fi - - LOG_INFO "测试完成:Compile a simple example poster with pdflatex" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_install.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_install.sh deleted file mode 100644 index 27f66c2afa2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-sciposter/test_texlive-sciposter_function_install.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-sciposter package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试安装texlive-sciposter软件包 - - LOG_INFO "开始测试texlive-sciposter软件包的安装功能" - - # 检查环境是否已安装texlive-sciposter - LOG_INFO "步骤1: 检查texlive-sciposter是否已安装" - dnf list installed texlive-sciposter > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-sciposter已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-sciposter未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2: 检查yum源中是否有texlive-sciposter软件包" - dnf list available texlive-sciposter > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-sciposter软件包" - exit 255 - fi - - # 如果环境未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-sciposter软件包" - dnf install -y texlive-sciposter - CHECK_RESULT $? 0 0 "安装texlive-sciposter失败" - - LOG_INFO "步骤4: 验证texlive-sciposter安装成功" - dnf list installed texlive-sciposter > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-sciposter安装失败" - fi - - # 测试软件包的基本功能 - LOG_INFO "步骤5: 测试texlive-sciposter基本功能" - # 检查texlive-sciposter是否提供了必要的文件 - rpm -ql texlive-sciposter | head -5 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-sciposter未提供必要的文件" - - # 测试sciposter相关命令是否存在 - LOG_INFO "步骤6: 检查sciposter相关命令" - which latex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到latex命令" - - # 测试创建简单的sciposter文档 - LOG_INFO "步骤7: 测试创建简单的sciposter文档" - cat > test_sciposter.tex << "EOF" - \documentclass{sciposter} - \title{Test SciPoster} - \author{Test Author} - \institute{Test Institute} - \begin{document} - \maketitle - \begin{abstract} - This is a test abstract for SciPoster. - \end{abstract} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - # 尝试编译测试文档(不要求成功,只检查命令是否存在) - LOG_INFO "步骤8: 测试latex编译命令" - pdflatex --version > /dev/null 2>&1 - if [ $? -eq 0 ]; then - pdflatex -interaction=nonstopmode test_sciposter.tex > /dev/null 2>&1 - # 不检查编译结果,因为可能缺少其他依赖 - LOG_INFO "latex编译命令测试完成" - else - LOG_INFO "未找到pdflatex命令,跳过编译测试" - fi - - # 清理测试文件 - LOG_INFO "步骤9: 清理测试文件" - rm -f test_sciposter.tex test_sciposter.aux test_sciposter.log test_sciposter.out test_sciposter.pdf 2>/dev/null - - # 环境恢复 - LOG_INFO "步骤10: 恢复测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-sciposter软件包" - dnf remove -y texlive-sciposter - CHECK_RESULT $? 0 0 "卸载texlive-sciposter失败" - - # 验证卸载成功 - dnf list installed texlive-sciposter > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-sciposter卸载失败" - exit 1 - else - LOG_INFO "texlive-sciposter成功卸载" - fi - else - LOG_INFO "保持texlive-sciposter的安装状态" - fi - - LOG_INFO "测试完成:texlive-sciposter软件包安装功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_basic.sh deleted file mode 100644 index 853e238a0cf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_basic.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-beamerappendixnote软件包是否已安装 - LOG_INFO "检查texlive-beamerappendixnote软件包是否已安装" - if dnf list installed texlive-beamerappendixnote &> /dev/null; then - LOG_INFO "texlive-beamerappendixnote已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-beamerappendixnote未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-beamerappendixnote软件包 - LOG_INFO "检查yum源中是否有texlive-beamerappendixnote软件包" - if ! dnf list available texlive-beamerappendixnote &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-beamerappendixnote软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-beamerappendixnote软件包" - dnf install -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "安装texlive-beamerappendixnote失败" - fi - - # 测试基本功能 - LOG_INFO "测试texlive-beamerappendixnote基本功能" - command_to_test="some_texlive_command --basic-functionality" - $command_to_test - CHECK_RESULT $? 0 0 "基本功能测试失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-beamerappendixnote软件包" - dnf remove -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "卸载texlive-beamerappendixnote失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_check.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_check.sh deleted file mode 100644 index 81f47f631e9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_check.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : Test if the package is available in the TeX system -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-beamerappendixnote包 - LOG_INFO "检查texlive-beamerappendixnote是否已经安装" - rpm -q texlive-beamerappendixnote > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-beamerappendixnote已经安装,脚本结束时会保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-beamerappendixnote未安装,将在测试中安装" - already_installed=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-beamerappendixnote包" - dnf list available texlive-beamerappendixnote > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-beamerappendixnote包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-beamerappendixnote包" - dnf install -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "安装texlive-beamerappendixnote失败" - fi - - # 检查texlive-beamerappendixnote是否在TeX系统中可用 - LOG_INFO "检查texlive-beamerappendixnote是否在TeX系统中可用" - kpsewhich beamerappendixnote.sty > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-beamerappendixnote在TeX系统中不可用" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-beamerappendixnote包" - dnf remove -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "卸载texlive-beamerappendixnote失败" - else - LOG_INFO "保持texlive-beamerappendixnote安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_clean.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_clean.sh deleted file mode 100644 index fecc394f39d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_clean.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : Test cleanup of auxiliary files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-beamerappendixnote - LOG_INFO "检查是否已安装texlive-beamerappendixnote" - rpm -q texlive-beamerappendixnote - if [ $? -eq 0 ]; then - LOG_INFO "texlive-beamerappendixnote已安装" - installed=1 - else - LOG_INFO "texlive-beamerappendixnote未安装" - installed=0 - fi - - # 检查yum源中是否有texlive-beamerappendixnote软件包 - LOG_INFO "检查yum源中是否有texlive-beamerappendixnote软件包" - dnf list available texlive-beamerappendixnote 2>/dev/null | grep -q texlive-beamerappendixnote - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-beamerappendixnote软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed -eq 0 ]; then - LOG_INFO "安装texlive-beamerappendixnote软件包" - dnf install -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "安装texlive-beamerappendixnote失败" - fi - - # 测试cleanup of auxiliary files功能 - LOG_INFO "测试cleanup of auxiliary files功能" - # 检查命令参数是否存在 - # 这里假设命令是texbeamerappendixnote --clean,实际命令可能需要调整 - command -v texbeamerappendixnote >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texbeamerappendixnote命令不存在" - exit 255 - fi - - # 检查--clean参数是否支持 - texbeamerappendixnote --help 2>/dev/null | grep -q -- --clean - if [ $? -ne 0 ]; then - LOG_ERROR "texbeamerappendixnote命令不支持--clean参数" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件" - test_dir="/tmp/texbeamer_test_$(date +%s)" - mkdir -p $test_dir - cd $test_dir - touch test.aux test.log test.out test.toc - - # 执行清理命令 - LOG_INFO "执行清理命令" - texbeamerappendixnote --clean - CHECK_RESULT $? 0 0 "执行清理命令失败" - - # 检查辅助文件是否被清理 - LOG_INFO "检查辅助文件是否被清理" - remaining_files=$(ls -1 *.aux *.log *.out *.toc 2>/dev/null | wc -l) - if [ $remaining_files -eq 0 ]; then - LOG_INFO "辅助文件已成功清理" - result=0 - else - LOG_ERROR "辅助文件未完全清理,剩余文件数:$remaining_files" - result=1 - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd / - rm -rf $test_dir - - # 如果测试前未安装,则卸载软件包 - if [ $installed -eq 0 ]; then - LOG_INFO "卸载texlive-beamerappendixnote软件包" - dnf remove -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "卸载texlive-beamerappendixnote失败" - fi - - # 根据测试结果退出 - if [ $result -eq 0 ]; then - LOG_INFO "测试通过:cleanup of auxiliary files功能正常" - exit 0 - else - LOG_ERROR "测试失败:cleanup of auxiliary files功能异常" - exit 1 - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_install.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_install.sh deleted file mode 100644 index 63a1956ebb4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_install.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : Test package installation via package manager -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否以root用户运行 - if [ "$(id -u)" -ne 0 ]; then - LOG_ERROR "请使用root用户运行此脚本" - exit 1 - fi - - LOG_INFO "开始测试:通过包管理器安装软件包" - - # 定义要测试的软件包名称 - PACKAGE_NAME="texlive-beamerappendixnote" - - # 步骤1:检查软件包是否已经安装 - LOG_INFO "步骤1:检查软件包是否已经安装" - dnf list installed "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装,测试完成后将保持安装状态" - INSTALLED_BEFORE="true" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - INSTALLED_BEFORE="false" - fi - - # 步骤2:检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "软件包 $PACKAGE_NAME 在yum源中不存在" - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤3:软件包已安装,跳过安装步骤" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证软件包安装成功" - dnf list installed "$PACKAGE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未正确安装" - - # 步骤5:测试软件包基本功能(如果适用) - LOG_INFO "步骤5:测试软件包基本功能" - # 这里可以根据软件包特性添加功能测试 - # 例如:rpm -q --provides "$PACKAGE_NAME" | head -5 - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 验证卸载成功 - dnf list installed "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载失败" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 已成功卸载" - fi - else - LOG_INFO "测试前软件包已安装,保持安装状态不变" - fi - - LOG_INFO "测试完成:通过包管理器安装软件包测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_manual.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_manual.sh deleted file mode 100644 index f01759ed485..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_manual.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : Test access to package documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test access to package documentation" - LOG_INFO "步骤1:检查yum源中是否存在texlive-beamerappendixnote软件包" - dnf list available texlive-beamerappendixnote &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-beamerappendixnote软件包" - exit 255 - fi - LOG_INFO "texlive-beamerappendixnote软件包在yum源中可用" - - LOG_INFO "步骤2:检查系统是否已安装texlive-beamerappendixnote软件包" - rpm -q texlive-beamerappendixnote &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-beamerappendixnote软件包已安装,标记为保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-beamerappendixnote软件包未安装,标记为需要安装" - INSTALLED="false" - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-beamerappendixnote软件包" - dnf install -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "安装texlive-beamerappendixnote软件包失败" - LOG_INFO "texlive-beamerappendixnote软件包安装成功" - fi - - LOG_INFO "步骤4:验证texlive-beamerappendixnote软件包文档访问" - rpm -qd texlive-beamerappendixnote &> /dev/null - CHECK_RESULT $? 0 0 "无法访问texlive-beamerappendixnote软件包文档" - - LOG_INFO "步骤5:检查texlive-beamerappendixnote命令参数支持" - texdoc --help 2>&1 | grep -q "\-\-list" - if [ $? -ne 0 ]; then - LOG_ERROR "texdoc命令不支持--list参数" - exit 255 - fi - LOG_INFO "texdoc命令支持--list参数" - - LOG_INFO "步骤6:列出texlive-beamerappendixnote相关文档" - texdoc --list beamerappendixnote - CHECK_RESULT $? 0 0 "列出texlive-beamerappendixnote文档失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7:卸载texlive-beamerappendixnote软件包" - dnf remove -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "卸载texlive-beamerappendixnote软件包失败" - LOG_INFO "texlive-beamerappendixnote软件包卸载成功" - else - LOG_INFO "步骤7:保持texlive-beamerappendixnote软件包安装状态,不执行卸载" - fi - - LOG_INFO "测试完成:Test access to package documentation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_usage.sh deleted file mode 100644 index 87dfee54269..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerappendixnote/test_texlive-beamerappendixnote_function_usage.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : Test basic package usage in a LaTeX document -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-beamerappendixnote软件包 - LOG_INFO "检查texlive-beamerappendixnote软件包是否已安装" - if dnf list installed texlive-beamerappendixnote &>/dev/null; then - LOG_INFO "texlive-beamerappendixnote软件包已安装,测试结束后保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-beamerappendixnote软件包未安装,将在测试结束后卸载" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否存在texlive-beamerappendixnote软件包 - LOG_INFO "检查yum源中是否存在texlive-beamerappendixnote软件包" - if ! dnf list available texlive-beamerappendixnote &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-beamerappendixnote软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "安装texlive-beamerappendixnote软件包" - dnf install -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "安装texlive-beamerappendixnote软件包失败" - fi - - # 测试基本包用法:创建一个简单的LaTeX文档并使用beamerappendixnote - LOG_INFO "测试基本包用法:创建一个简单的LaTeX文档并使用beamerappendixnote" - cat > test_beamerappendixnote.tex << "EOF" - \documentclass{beamer} - \usepackage{beamerappendixnote} - \begin{document} - \begin{frame} - \frametitle{测试标题} - 这是一个测试文档,用于验证beamerappendixnote包的基本用法。 - \end{frame} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - # 尝试编译LaTeX文档 - LOG_INFO "尝试编译LaTeX文档" - pdflatex -interaction=nonstopmode test_beamerappendixnote.tex &>/dev/null - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_beamerappendixnote.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_beamerappendixnote.tex test_beamerappendixnote.pdf test_beamerappendixnote.aux test_beamerappendixnote.log test_beamerappendixnote.nav test_beamerappendixnote.out test_beamerappendixnote.snm test_beamerappendixnote.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "卸载texlive-beamerappendixnote软件包" - dnf remove -y texlive-beamerappendixnote - CHECK_RESULT $? 0 0 "卸载texlive-beamerappendixnote软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-frenchmath/test_texlive-frenchmath_function_french_math.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-frenchmath/test_texlive-frenchmath_function_french_math.sh deleted file mode 100644 index f53e1bdfb58..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-frenchmath/test_texlive-frenchmath_function_french_math.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : Test French math typography features -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-frenchmath - LOG_INFO "检查是否已经安装texlive-frenchmath" - if dnf list installed texlive-frenchmath &>/dev/null; then - LOG_INFO "texlive-frenchmath已经安装,测试结束后将保持安装状态" - installed_before=1 - else - LOG_INFO "texlive-frenchmath未安装,将在测试过程中安装并在测试结束后卸载" - installed_before=0 - fi - - # 检查yum源中是否有texlive-frenchmath软件包 - LOG_INFO "检查yum源中是否有texlive-frenchmath软件包" - if ! dnf list available texlive-frenchmath &>/dev/null; then - LOG_ERROR "yum源中没有texlive-frenchmath软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed_before -eq 0 ]; then - LOG_INFO "安装texlive-frenchmath软件包" - dnf install -y texlive-frenchmath - CHECK_RESULT $? 0 0 "安装texlive-frenchmath失败" - fi - - # 测试French math typography features - LOG_INFO "测试French math typography features" - # 创建一个简单的LaTeX文件测试frenchmath功能 - cat > test_frenchmath.tex << "EOF" - \documentclass{article} - \usepackage[french]{babel} - \usepackage{frenchmath} - \begin{document} - Test French math: $a \times b = c$, $\sin(\alpha)$. - \end{document} - EOF - - # 编译LaTeX文件 - LOG_INFO "编译测试LaTeX文件" - pdflatex -interaction=nonstopmode test_frenchmath.tex - CHECK_RESULT $? 0 0 "编译LaTeX文件失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f test_frenchmath.pdf ]; then - LOG_INFO "成功生成了PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理生成的临时文件 - LOG_INFO "清理临时文件" - rm -f test_frenchmath.aux test_frenchmath.log test_frenchmath.pdf test_frenchmath.tex - - # 如果测试前未安装,则卸载软件包 - if [ $installed_before -eq 0 ]; then - LOG_INFO "卸载texlive-frenchmath软件包" - dnf remove -y texlive-frenchmath - CHECK_RESULT $? 0 0 "卸载texlive-frenchmath失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-frenchmath/test_texlive-frenchmath_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-frenchmath/test_texlive-frenchmath_function_usage.sh deleted file mode 100644 index 7f358386bfc..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-frenchmath/test_texlive-frenchmath_function_usage.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX compilation with package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic LaTeX compilation with package" - - LOG_INFO "步骤1: 检查是否已安装texlive-frenchmath软件包" - if dnf list installed texlive-frenchmath > /dev/null 2>&1; then - LOG_INFO "texlive-frenchmath已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-frenchmath未安装,将在测试中安装,并在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在texlive-frenchmath软件包" - if ! dnf list available texlive-frenchmath > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在texlive-frenchmath软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装texlive-frenchmath软件包" - dnf install -y texlive-frenchmath - CHECK_RESULT $? 0 0 "安装texlive-frenchmath软件包失败" - fi - - LOG_INFO "步骤4: 创建一个简单的LaTeX测试文件" - cat > test_frenchmath.tex << "EOF" - \documentclass{article} - \usepackage{frenchmath} - \begin{document} - Test document with frenchmath package. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX测试文件失败" - - LOG_INFO "步骤5: 使用pdflatex编译LaTeX文件" - pdflatex -interaction=nonstopmode test_frenchmath.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex编译失败" - - LOG_INFO "步骤6: 检查生成的PDF文件是否存在" - if [ -f test_frenchmath.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - LOG_INFO "步骤7: 清理生成的临时文件" - rm -f test_frenchmath.aux test_frenchmath.log test_frenchmath.out test_frenchmath.tex - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤8: 卸载texlive-frenchmath软件包" - dnf remove -y texlive-frenchmath - CHECK_RESULT $? 0 0 "卸载texlive-frenchmath软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-inkpaper/test_texlive-inkpaper_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-inkpaper/test_texlive-inkpaper_function_basic.sh deleted file mode 100644 index ea67eaa2eb2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-inkpaper/test_texlive-inkpaper_function_basic.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-inkpaper -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-inkpaper_function_basic - - LOG_INFO "开始测试 texlive-inkpaper 的基本功能" - - # 检查环境是否已安装 texlive-inkpaper - LOG_INFO "检查 texlive-inkpaper 是否已安装" - dnf list installed texlive-inkpaper > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-inkpaper 已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "texlive-inkpaper 未安装,将在测试完成后卸载" - installed=false - fi - - # 检查 yum 源中是否有 texlive-inkpackage - LOG_INFO "检查 yum 源中是否有 texlive-inkpaper" - dnf list available texlive-inkpaper > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-inkpaper" - exit 255 - fi - - # 安装 texlive-inkpackage(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装 texlive-inkpaper" - dnf install -y texlive-inkpaper > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-inkpaper失败" - fi - - # 测试 texlive-inkpaper的基本功能 - LOG_INFO "测试 texlive-inkpaper的基本功能" - texlive-inkpaper --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-inkpackage版本查询失败" - - # (示例)测试不支持的命令参数(假设 --invalid为不支持参数) - LOG_INFO "测试不支持的命令参数" - texlive-inkpackage --invalid > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未按预期退出码255退出" - exit255 - fi - - # 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO“卸载 tex live ink paper” - dnf remove -y text live ink paper >/ dev / null 2>&1 - CHECK _ RESULT $?00“卸载 text live ink paper失败” - fi - - LOG _ INFO“text live ink paper基本功能测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_clean.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_clean.sh deleted file mode 100644 index 0ae2124a580..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_clean.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的清理功能,验证 clean 目标能否正确清理之前生成的目标代码文件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jcasgen-maven-plugin 的 clean 功能" - LOG_INFO "步骤1:检查 yum 源中是否存在 jcasgen-maven-plugin 软件包" - if ! dnf list available jcasgen-maven-plugin &> /dev/null; then - LOG_ERROR "yum 源中未找到 jcasgen-maven-plugin 软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查环境是否已安装 jcasgen-maven-plugin" - if rpm -q jcasgen-maven-plugin &> /dev/null; then - LOG_INFO "jcasgen-maven-plugin 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "jcasgen-maven-plugin 未安装,将在测试过程中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 jcasgen-maven-plugin" - dnf install -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "安装 jcasgen-maven-plugin 失败" - fi - - LOG_INFO "步骤4:验证 jcasgen-maven-plugin 的 clean 参数是否存在" - if ! jcasgen-maven-plugin --help 2>&1 | grep -q "clean"; then - LOG_ERROR "jcasgen-maven-plugin 不支持 clean 参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试项目并生成目标代码文件" - mkdir -p test_project - cd test_project || exit 1 - jcasgen-maven-plugin generate --output-dir generated_code - CHECK_RESULT $? 0 0 "生成目标代码文件失败" - - LOG_INFO "步骤6:检查生成的目标代码文件是否存在" - if [ ! -d "generated_code" ] || [ -z "$(ls -A generated_code)" ]; then - LOG_ERROR "生成的目标代码文件不存在或为空" - exit 1 - fi - - LOG_INFO "步骤7:执行 clean 目标清理生成的目标代码文件" - jcasgen-maven-plugin clean --output-dir generated_code - CHECK_RESULT $? 0 0 "清理目标代码文件失败" - - LOG_INFO "步骤8:验证目标代码文件是否已被清理" - if [ -d "generated_code" ] && [ -n "$(ls -A generated_code 2>/dev/null)" ]; then - LOG_ERROR "clean 操作未能正确清理目标代码文件" - exit 1 - else - LOG_INFO "目标代码文件已被成功清理" - fi - - LOG_INFO "步骤9:清理测试项目目录" - cd .. - rm -rf test_project - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤10:卸载 jcasgen-maven-plugin" - dnf remove -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "卸载 jcasgen-maven-plugin 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_config.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_config.sh deleted file mode 100644 index a2f11964359..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_config.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的配置功能,验证配置文件是否能够正确加载和应用。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查jcasgen-maven-plugin是否已安装 - LOG_INFO "检查jcasgen-maven-plugin是否已安装" - dnf list installed jcasgen-maven-plugin > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "jcasgen-maven-plugin已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "jcasgen-maven-plugin未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有jcasgen-maven-plugin - LOG_INFO "检查yum源中是否有jcasgen-maven-plugin" - dnf list available jcasgen-maven-plugin > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到jcasgen-maven-plugin软件包" - exit 255 - fi - - # 安装jcasgen-maven-plugin - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装jcasgen-maven-plugin" - dnf install -y jcasgen-maven-plugin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装jcasgen-maven-plugin失败" - fi - - # 验证配置文件是否正确加载和应用 - LOG_INFO "验证配置文件是否正确加载和应用" - mvn help:describe -Dplugin=org.jcabi:jcasgen-maven-plugin -Ddetail > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "配置文件加载失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载jcasgen-maven-plugin" - dnf remove -y jcasgen-maven-plugin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载jcasgen-maven-plugin失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_deps.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_deps.sh deleted file mode 100644 index 4580742c1c6..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_deps.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的依赖管理功能,验证是否能够正确处理依赖关系。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jcasgen-maven-plugin 的依赖管理功能,验证是否能够正确处理依赖关系。" - - # 检查是否已安装 jcasgen-maven-plugin - LOG_INFO "检查是否已安装 jcasgen-maven-plugin" - dnf list installed jcasgen-maven-plugin > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "jcasgen-maven-plugin 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "jcasgen-maven-plugin 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 jcasgen-maven-plugin - LOG_INFO "检查 yum 源中是否存在 jcasgen-maven-plugin" - dnf list available jcasgen-maven-plugin > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 jcasgen-maven-plugin 软件包" - exit 255 - fi - - # 安装 jcasgen-maven-plugin - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 jcasgen-maven-plugin" - dnf install -y jcasgen-maven-plugin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 jcasgen-maven-plugin 失败" - fi - - # 验证依赖管理功能 - LOG_INFO "验证 jcasgen-maven-plugin 的依赖管理功能" - mvn dependency:resolve -f /path/to/project/pom.xml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "依赖解析失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载 jcasgen-maven-plugin" - dnf remove -y jcasgen-maven-plugin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 jcasgen-maven-plugin 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_generate.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_generate.sh deleted file mode 100644 index 71ca3aa138b..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_generate.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的代码生成功能,验证是否能够正确生成目标代码。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jcasgen-maven-plugin 的代码生成功能" - - # 检查 jcasgen-maven-plugin 是否已安装 - LOG_INFO "检查 jcasgen-maven-plugin 是否已安装" - if dnf list installed jcasgen-maven-plugin &>/dev/null; then - LOG_INFO "jcasgen-maven-plugin 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "jcasgen-maven-plugin 未安装,准备安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 jcasgen-maven-plugin - LOG_INFO "检查 yum 源中是否有 jcasgen-maven-plugin" - if ! dnf list available jcasgen-maven-plugin &>/dev/null; then - LOG_ERROR "yum 源中未找到 jcasgen-maven-plugin" - exit 255 - fi - - # 如果未安装,则安装 jcasgen-maven-plugin - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 jcasgen-maven-plugin" - dnf install -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "安装 jcasgen-maven-plugin 失败" - fi - - # 验证代码生成功能 - LOG_INFO "验证 jcasgen-maven-plugin 的代码生成功能" - mvn jcasgen:generate -Dgenerate.target=test_target -Dgenerate.output=test_output - CHECK_RESULT $? 0 0 "代码生成功能验证失败" - - # 清理测试生成的文件 - LOG_INFO "清理测试生成的文件" - rm -rf test_output - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 jcasgen-maven-plugin" - dnf remove -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "卸载 jcasgen-maven-plugin 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_help.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_help.sh deleted file mode 100644 index 50664fc73d3..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_help.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的帮助信息功能,验证执行 help 目标是否能正确显示插件使用说明。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jcasgen-maven-plugin 的帮助信息功能" - LOG_INFO "检查环境中是否已安装 jcasgen-maven-plugin" - - # 检查软件包是否已安装 - if dnf list installed jcasgen-maven-plugin &>/dev/null; then - LOG_INFO "jcasgen-maven-plugin 已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "jcasgen-maven-plugin 未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查 yum 源中是否存在 jcasgen-maven-plugin - LOG_INFO "检查 yum 源中是否存在 jcasgen-maven-plugin" - if ! dnf list available jcasgen-maven-plugin &>/dev/null; then - LOG_ERROR "yum 源中未找到 jcasgen-maven-plugin 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装 jcasgen-maven-plugin" - dnf install -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "安装 jcasgen-maven-plugin 失败" - fi - - # 检查 jcasgen-maven-plugin 是否支持 help 参数 - LOG_INFO "检查 jcasgen-maven-plugin 是否支持 help 参数" - if ! jcasgen-maven-plugin --help &>/dev/null; then - LOG_ERROR "jcasgen-maven-plugin 不支持 help 参数" - exit 255 - fi - - # 执行 help 目标,验证是否能正确显示插件使用说明 - LOG_INFO "执行 jcasgen-maven-plugin help 目标" - jcasgen-maven-plugin --help - CHECK_RESULT $? 0 0 "执行 jcasgen-maven-plugin help 目标失败" - - # 环境恢复:如果测试前未安装,则在测试结束后卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载 jcasgen-maven-plugin" - dnf remove -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "卸载 jcasgen-maven-plugin 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_install.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_install.sh deleted file mode 100644 index 9439f20521e..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_install.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的安装功能,验证是否能够通过 Maven 正确安装到本地仓库中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jcasgen-maven-plugin 的安装功能" - LOG_INFO "步骤1:检查 yum 源中是否存在 jcasgen-maven-plugin 软件包" - dnf list available jcasgen-maven-plugin > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 jcasgen-maven-plugin 软件包" - exit 255 - fi - LOG_INFO "步骤2:检查当前环境是否已安装 jcasgen-maven-plugin" - rpm -q jcasgen-maven-plugin > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "jcasgen-maven-plugin 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "jcasgen-maven-plugin 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装 jcasgen-maven-plugin 软件包" - dnf install -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "安装 jcasgen-maven-plugin 失败" - LOG_INFO "安装 jcasgen-maven-plugin 成功" - fi - LOG_INFO "步骤4:验证是否能够通过 Maven 正确安装到本地仓库中" - mvn dependency:get -Dartifact=org.example:jcasgen-maven-plugin:1.0.0 -Ddest=/tmp/jcasgen-maven-plugin.jar > /tmp/mvn_install.log 2>&1 - CHECK_RESULT $? 0 0 "通过 Maven 安装到本地仓库失败" - LOG_INFO "通过 Maven 安装到本地仓库成功" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤5:清理环境,卸载之前安装的 jcasgen-maven-plugin 软件包" - dnf remove -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "卸载 jcasgen-maven-plugin 失败" - LOG_INFO "卸载 jcasgen-maven-plugin 成功" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_validate.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_validate.sh deleted file mode 100644 index 5392ce92a2e..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_validate.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的验证功能,验证生成的代码是否符合预期规范。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jcasgen-maven-plugin 的验证功能,验证生成的代码是否符合预期规范。" - - # 检查 yum 源中是否存在 jcasgen-maven-plugin 软件包 - LOG_INFO "检查 yum 源中是否存在 jcasgen-maven-plugin 软件包" - dnf list available jcasgen-maven-plugin &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 jcasgen-maven-plugin 软件包" - exit 255 - fi - - # 检查是否已安装 jcasgen-maven-plugin - LOG_INFO "检查是否已安装 jcasgen-maven-plugin" - if dnf list installed jcasgen-maven-plugin &>/dev/null; then - INSTALLED=true - LOG_INFO "jcasgen-maven-plugin 已安装,测试完成后将保持安装状态" - else - INSTALLED=false - LOG_INFO "jcasgen-maven-plugin 未安装,测试完成后将卸载" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 jcasgen-maven-plugin" - dnf install -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "安装 jcasgen-maven-plugin 失败" - fi - - # 验证生成的代码是否符合预期规范 - LOG_INFO "验证生成的代码是否符合预期规范" - jcasgen-maven-plugin validate --check-format - CHECK_RESULT $? 0 0 "验证生成的代码不符合预期规范" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 jcasgen-maven-plugin" - dnf remove -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "卸载 jcasgen-maven-plugin 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_verify.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_verify.sh deleted file mode 100644 index 612b81ee1ea..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_verify.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的验证功能,验证生成的代码是否符合 Java 编译规范和预期结构。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 环境检查:检查是否已安装 jcasgen-maven-plugin - LOG_INFO "检查是否已安装 jcasgen-maven-plugin" - if dnf list installed jcasgen-maven-plugin &>/dev/null; then - LOG_INFO "jcasgen-maven-plugin 已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "jcasgen-maven-plugin 未安装,将在测试步骤中安装" - already_installed=false - fi - - # 检查 yum 源中是否存在 jcasgen-maven-plugin 软件包 - LOG_INFO "检查 yum 源中是否存在 jcasgen-maven-plugin 软件包" - if ! dnf search jcasgen-maven-plugin 2>/dev/null | grep -q jcasgen-maven-plugin; then - LOG_ERROR "yum 源中未找到 jcasgen-maven-plugin 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装 jcasgen-maven-plugin 软件包" - dnf install -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "安装 jcasgen-maven-plugin 失败" - fi - - # 验证 jcasgen-maven-plugin 命令是否可用 - LOG_INFO "验证 jcasgen-maven-plugin 命令是否可用" - if ! command -v jcasgen-maven-plugin &>/dev/null; then - LOG_ERROR "jcasgen-maven-plugin 命令不可用" - exit 255 - fi - - # 检查 jcasgen-maven-plugin 是否支持 --help 参数 - LOG_INFO "检查 jcasgen-maven-plugin 是否支持 --help 参数" - if ! jcasgen-maven-plugin --help &>/dev/null; then - LOG_ERROR "jcasgen-maven-plugin 不支持 --help 参数" - exit 255 - fi - - # 创建测试项目目录 - LOG_INFO "创建测试项目目录" - test_dir="/tmp/test_jcasgen_project" - rm -rf "$test_dir" - mkdir -p "$test_dir" - cd "$test_dir" - - # 创建 Maven 项目结构 - LOG_INFO "创建 Maven 项目结构" - mkdir -p src/main/java - cat > pom.xml < - - 4.0.0 - com.example - test-jcasgen - 1.0.0 - jar - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - - - - - - EOF - - # 运行 jcasgen-maven-plugin 生成代码 - LOG_INFO "运行 jcasgen-maven-plugin 生成代码" - jcasgen-maven-plugin generate - CHECK_RESULT $? 0 0 "jcasgen-maven-plugin 生成代码失败" - - # 验证生成的代码是否符合 Java 编译规范 - LOG_INFO "验证生成的代码是否符合 Java 编译规范" - if find src -name "*.java" -type f | xargs javac -cp . -d /tmp 2>&1 | grep -q "error"; then - LOG_ERROR "生成的 Java 代码编译失败" - exit 1 - else - LOG_INFO "生成的 Java 代码编译成功" - fi - - # 验证生成的代码结构是否符合预期 - LOG_INFO "验证生成的代码结构是否符合预期" - if [ ! -d "src/main/java" ] || [ ! -f "src/main/java/Example.java" ]; then - LOG_ERROR "生成的代码结构不符合预期" - exit 1 - else - LOG_INFO "生成的代码结构符合预期" - fi - - # 清理测试项目目录 - LOG_INFO "清理测试项目目录" - cd / - rm -rf "$test_dir" - - # 如果之前未安装,则在脚本结束前卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 jcasgen-maven-plugin 软件包" - dnf remove -y jcasgen-maven-plugin - CHECK_RESULT $? 0 0 "卸载 jcasgen-maven-plugin 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_version.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_version.sh deleted file mode 100644 index 82cdc49cfc8..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_function_version.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的版本信息功能,验证执行 version 目标是否能正确显示插件版本号。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jcasgen-maven-plugin 版本信息功能" - - # 定义软件包名称 - PACKAGE_NAME="jcasgen-maven-plugin" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "检查 yum 源中是否存在软件包 ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到软件包 ${PACKAGE_NAME}" - exit 255 - fi - - # 步骤2:检查软件包是否已安装 - LOG_INFO "检查软件包 ${PACKAGE_NAME} 是否已安装" - rpm -q ${PACKAGE_NAME} &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试前安装" - INSTALLED_BEFORE_TEST=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:执行 jcasgen-maven-plugin 的 version 目标以显示版本信息 - LOG_INFO "执行 jcasgen-maven-plugin 的 version 目标" - mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -DforceStdout -q -f /usr/share/maven/conf/settings.xml &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "无法执行 mvn 命令,可能未安装 Maven 或参数错误" - exit 255 - fi - - # 使用 maven-help-plugin 获取插件版本 - PLUGIN_VERSION=$(mvn help:evaluate -Dexpression=plugin.version -DforceStdout -q -f /usr/share/maven/conf/settings.xml 2>/dev/null) - if [ $? -ne 0 ] || [ -z "${PLUGIN_VERSION}" ]; then - LOG_ERROR "执行 version 目标失败,无法获取插件版本信息" - exit 255 - fi - - # 步骤5:验证版本信息是否正确显示 - LOG_INFO "验证插件版本信息是否正确显示" - if [[ "${PLUGIN_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then - LOG_INFO "插件版本信息显示正确:${PLUGIN_VERSION}" - CHECK_RESULT $? 0 0 "版本信息格式不正确" - else - LOG_ERROR "插件版本信息格式不正确:${PLUGIN_VERSION}" - exit 1 - fi - - # 步骤6:清理环境,如果测试前未安装则卸载软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "测试前已安装软件包,测试结束后保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_install.sh b/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_install.sh deleted file mode 100644 index 70790c25365..00000000000 --- a/testcases/function_test/pkg_test/uimaj/jcasgen-maven-plugin/test_jcasgen-maven-plugin_install.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-13 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 jcasgen-maven-plugin 的安装功能,验证是否能够正确安装到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 jcasgen-maven-plugin 的安装功能" - - # 检查是否已安装 jcasgen-maven-plugin - LOG_INFO "检查是否已安装 jcasgen-maven-plugin" - dnf list installed jcasgen-maven-plugin > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "jcasgen-maven-plugin 已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "jcasgen-maven-plugin 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 jcasgen-maven-plugin 软件包 - LOG_INFO "检查 yum 源中是否有 jcasgen-maven-plugin" - dnf list available jcasgen-maven-plugin > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum 源中未找到 jcasgen-maven-plugin 软件包" - - # 安装 jcasgen-maven-plugin - LOG_INFO "安装 jcasgen-maven-plugin" - dnf install -y jcasgen-maven-plugin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 jcasgen-maven-plugin 失败" - - # 验证安装是否成功 - LOG_INFO "验证 jcasgen-maven-plugin 是否安装成功" - dnf list installed jcasgen-maven-plugin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "jcasgen-maven-plugin 未正确安装" - - # 如果测试前未安装,则在测试完成后卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 jcasgen-maven-plugin" - dnf remove -y jcasgen-maven-plugin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 jcasgen-maven-plugin 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file