diff --git a/data/aistack/open-webui-sanity-tests.tar.gz b/data/aistack/open-webui-sanity-tests.tar.gz new file mode 100644 index 000000000000..7e65a3798c22 Binary files /dev/null and b/data/aistack/open-webui-sanity-tests.tar.gz differ diff --git a/lib/main_micro_alp.pm b/lib/main_micro_alp.pm index e5518c80d69e..8b2f886f3cff 100644 --- a/lib/main_micro_alp.pm +++ b/lib/main_micro_alp.pm @@ -324,8 +324,8 @@ sub load_slem_on_pc_tests { loadtest("publiccloud/ssh_interactive_start", run_args => $args); loadtest("publiccloud/create_aistack_env", run_args => $args); loadtest("publiccloud/aistack_rbac_run", run_args => $args); + loadtest("publiccloud/aistack_sanity_run", run_args => $args); loadtest("publiccloud/ssh_interactive_end", run_args => $args); - #loadtest("publiccloud/", run_args => $args); } elsif (is_container_test) { loadtest("publiccloud/ssh_interactive_start", run_args => $args); loadtest("publiccloud/instance_overview", run_args => $args); diff --git a/tests/publiccloud/aistack_sanity_run.pm b/tests/publiccloud/aistack_sanity_run.pm new file mode 100644 index 000000000000..5f8149a51695 --- /dev/null +++ b/tests/publiccloud/aistack_sanity_run.pm @@ -0,0 +1,48 @@ +# SUSE's openQA tests +# +# Copyright 2024 SUSE LLC +# SPDX-License-Identifier: FSFAP + +# Basic aistack test + +# Summary: This test performs the following actions +# - Calls AI Stack sanity tests +# Maintainer: Rhuan Queiroz +# + +use Mojo::Base 'publiccloud::basetest'; +use strict; +use warnings; +use testapi; +use utils; +use publiccloud::utils; +use version_utils; +use transactional qw(process_reboot trup_install trup_shell trup_call); + +sub test_flags { + return {fatal => 1, publiccloud_multi_module => 1}; +} + +sub run { + my ($self, $args) = @_; + + my $instance = $self->{my_instance}; + my $provider = $self->{provider}; + + my $test_archive = get_required_var('OPENWEBUI_SANITY_TESTS_ARCHIVE'); + my $sanity_tests_url = data_url("aistack/" . $test_archive); + + my $test_folder = $test_archive; + $test_folder =~ s/\.tar(\.gz)?$//; + + assert_script_run("curl -O " . $sanity_tests_url); + assert_script_run("mkdir " . $test_folder); + assert_script_run("tar -xzvf " . $test_archive . " -C " . $test_folder); + assert_script_run("python3.11 -m venv " . $test_folder . "/venv"); + assert_script_run("source " . $test_folder . "/venv/bin/activate"); + assert_script_run("pip3 install -r ./" . $test_folder . "/requirements.txt"); + assert_script_run("cp " . $test_folder . "/env.example " . $test_folder . "/.env"); + assert_script_run("pytest $test_folder/tests/"); +} + +1;