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.
Test for firewalld container in ALP product
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
name: Firewalld in a Container | ||
description: > | ||
Install and test firewalld container | ||
conditional_schedule: | ||
firewalld_container: | ||
HOSTNAME: | ||
'client': | ||
- microos/workloads/firewalld-container/firewalld_client | ||
'server': | ||
- microos/workloads/firewalld-container/firewalld_server | ||
schedule: | ||
- microos/disk_boot | ||
- '{{firewalld_container}}' |
33 changes: 33 additions & 0 deletions
33
tests/microos/workloads/firewalld-container/firewalld_client.pm
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,33 @@ | ||
# SUSE"s openQA tests | ||
# | ||
# Copyright 2023 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
# | ||
# Package: podman firewalld-container | ||
# Summary: install and verify firewalld container. | ||
# Maintainer: QE Core <[email protected]> | ||
|
||
use base "consoletest"; | ||
use warnings; | ||
use strict; | ||
use testapi; | ||
use serial_terminal 'select_serial_terminal'; | ||
use lockapi; | ||
|
||
sub run { | ||
my ($self) = @_; | ||
select_serial_terminal; | ||
record_info("1 client ip a", script_output("ip a")); | ||
#setup MM networking | ||
barrier_wait 'FIREWALLD_SERVER_READY'; | ||
record_info("2 client ip a", script_output("ip a")); | ||
# server port should be reachable | ||
# die unless server_port_reachable(); | ||
# barrier_wait 'FIREWALLD_SERVER_PORT_CLOSED'; | ||
# # server port should not be reachable | ||
# die if server_port_reachable(); | ||
# barrier_wait 'FIREWALLD_SERVER_FINISHED'; | ||
} | ||
|
||
1; | ||
|
46 changes: 46 additions & 0 deletions
46
tests/microos/workloads/firewalld-container/firewalld_server.pm
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,46 @@ | ||
# SUSE"s openQA tests | ||
# | ||
# Copyright 2023 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
# | ||
# Package: podman firewalld-container | ||
# Summary: install and verify firewalld container. | ||
# Maintainer: QE Core <[email protected]> | ||
|
||
use base "consoletest"; | ||
use warnings; | ||
use strict; | ||
use testapi; | ||
use serial_terminal 'select_serial_terminal'; | ||
use lockapi; | ||
|
||
sub run { | ||
my ($self) = @_; | ||
select_serial_terminal; | ||
barrier_create('FIREWALLD_SERVER_READY', 2); | ||
my $hostname = get_var('HOSTNAME'); | ||
record_info("1 server ip a", script_output("ip a")); | ||
# setup MM networking | ||
# install software | ||
barrier_wait 'FIREWALLD_SERVER_READY'; | ||
# close port on firewall, client will test port | ||
# barrier_wait 'FIREWALLD_SERVER_PORT_CLOSED'; | ||
# end operations, cleanup | ||
# barrier_wait 'FIREWALLD_SERVER_FINISHED'; | ||
record_info("2 server ip a", script_output("ip a")); | ||
} | ||
|
||
sub post_fail_hook { | ||
barrier_destroy('FIREWALLD_SERVER_READY'); | ||
select_serial_terminal; | ||
} | ||
|
||
sub post_run_hook { | ||
barrier_destroy('FIREWALLD_SERVER_READY'); | ||
select_serial_terminal; | ||
} | ||
|
||
|
||
|
||
1; | ||
|