Skip to content

Commit

Permalink
Test for firewalld container in ALP product
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmanzo committed Nov 15, 2023
1 parent 51247a8 commit fc5fd42
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
15 changes: 15 additions & 0 deletions schedule/alp/firewalld_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
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
- network/setup_multimachine.pm
- '{{firewalld_container}}'
38 changes: 38 additions & 0 deletions tests/microos/workloads/firewalld-container/firewalld_client.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 server_port_is_open {
record_info("CLIENT DEBUG", "test if port is open");
return 1;
}

sub server_port_is_closed {
record_info("CLIENT DEBUG", "test if port is closed");
return 1;
}


sub run {
my ($self) = @_;
select_serial_terminal;
mutex_wait 'server';
record_info("1 client ip a", script_output("ip a"));
#die unless server_port_is_open();
#die unless server_port_is_closed();
}

1;

41 changes: 41 additions & 0 deletions tests/microos/workloads/firewalld-container/firewalld_server.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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 install_firewalld_container {
record_info("SERVER DEBUG", "installing firewalld container");
}

sub close_firewall_port {
record_info("SERVER DEBUG", "closing firewall port");
}


sub run {
my ($self) = @_;
mutex_create 'server';

This comment has been minimized.

Copy link
@foursixnine

foursixnine Nov 15, 2023

This tells the children/dependencies: "I am already done, you can start working"

#select_serial_terminal;
# select_console 'root-console';
my $hostname = get_var('HOSTNAME');
record_info("1 server ip a", script_output("ip a"));
# install_firewalld_container();
# close_firewall_port();
# mutex_unlock 'server';
# mutex_wait 'client';
record_info("2 server ip a", script_output("ip a"));

This comment has been minimized.

Copy link
@foursixnine

foursixnine Nov 15, 2023

without a mmapi::wait_for_children call, the server will finish, and the mutex will be removed from the locking API, making the children wait forever

}

1;

0 comments on commit fc5fd42

Please sign in to comment.