forked from os-autoinst/os-autoinst-distri-opensuse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RMT automatic testing code for import and export
- Loading branch information
1 parent
4c0a267
commit ef1d211
Showing
5 changed files
with
180 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ description: > | |
schedule: | ||
- boot/boot_to_desktop | ||
- network/setup_multimachine | ||
- x11/rmt | ||
- x11/rmt/rmt_import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2020 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
# | ||
# Summary: setup one RMT server, sync, enable, mirror and list | ||
# products. Then export RMT data to one folder. Wait another RMT | ||
# Server to import those data | ||
# Maintainer: Yutao Wang <yuwang@suse.com> | ||
|
||
use strict; | ||
use warnings; | ||
use testapi; | ||
use base 'x11test'; | ||
use repo_tools; | ||
use utils; | ||
use x11utils 'turn_off_gnome_screensaver'; | ||
use lockapi 'mutex_create'; | ||
use mmapi 'wait_for_children'; | ||
|
||
sub run { | ||
x11_start_program('xterm -geometry 150x35+5+5', target_match => 'xterm'); | ||
# Avoid blank screen since smt sync needs time | ||
turn_off_gnome_screensaver; | ||
become_root; | ||
rmt_wizard(); | ||
# sync, enable, mirror and list products | ||
rmt_sync(); | ||
rmt_enable_pro(); | ||
rmt_mirror_repo(); | ||
rmt_list_pro(); | ||
# export data and repos | ||
rmt_export_data(); | ||
mutex_create("FINISH_EXPORT_DATA"); | ||
wait_for_children; | ||
type_string "killall xterm\n"; | ||
} | ||
|
||
sub test_flags { | ||
return {fatal => 1}; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2019 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: Add rmt configuration test and basic configuration via | ||
# rmt-wizard, import RMT data and repos from one folder which | ||
# stored RMT export data, then verify the imported data can list | ||
# Maintainer: Yutao wang <yuwang@suse.com> | ||
|
||
use strict; | ||
use warnings; | ||
use testapi; | ||
use base 'x11test'; | ||
use repo_tools; | ||
use utils; | ||
use x11utils 'turn_off_gnome_screensaver'; | ||
use lockapi qw(mutex_create mutex_wait); | ||
|
||
sub run { | ||
x11_start_program('xterm -geometry 150x35+5+5', target_match => 'xterm'); | ||
# Avoid blank screen since smt sync needs time | ||
turn_off_gnome_screensaver; | ||
become_root; | ||
rmt_wizard(); | ||
# sync from SCC | ||
rmt_sync; | ||
# import data and repos from an existing RMT server | ||
my $datapath = "/rmtdata/"; | ||
mutex_wait("FINISH_EXPORT_DATA"); | ||
exec_and_insert_password("scp -o StrictHostKeyChecking=no -r root\@10.0.2.101:$datapath /"); | ||
assert_script_run("chown -R _rmt:nginx $datapath"); | ||
rmt_import_data($datapath); | ||
# check the imported products correct | ||
rmt_enable_pro; | ||
rmt_list_pro; | ||
my $pro_ls = get_var('RMT_PRO') || 'sle-module-legacy/15/x86_64'; | ||
assert_script_run("rmt-cli product list | grep $pro_ls"); | ||
type_string "killall xterm\n"; | ||
} | ||
|
||
sub test_flags { | ||
return {fatal => 1}; | ||
} | ||
|
||
1; |