Skip to content

Commit

Permalink
test new stunnel config
Browse files Browse the repository at this point in the history
  • Loading branch information
paolostivanin committed Feb 6, 2025
1 parent df2c50e commit e662703
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/fips/stunnel.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ use version_utils 'package_version_cmp';
my $hostname = get_var('HOSTNAME');
# Set vnc password
my $message = 'Hello from the server';
# Set stunnel dir
my $stunnel_chroot_dir = "/var/run/stunnel";

sub conf_stunnel_netcat {
my $stunnel_config = <<EOF;
chroot = $stunnel_chroot_dir
pid = /stunnel.pid
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
client = no
cert = /etc/stunnel/stunnel.pem
Expand All @@ -37,10 +44,11 @@ EOF
assert_script_run q(sed -i 's/^client = no/client = yes/' /etc/stunnel/stunnel.conf);
assert_script_run q(sed -i 's/^connect = 5905/connect = 10.0.2.101:15905/' /etc/stunnel/stunnel.conf);
}
assert_script_run('chown -R stunnel:nogroup /var/lib/stunnel');
assert_script_run("mkdir -p $stunnel_chroot_dir");
assert_script_run("chown -R stunnel:nogroup $stunnel_chroot_dir");
systemctl('start stunnel');
systemctl('is-active stunnel');
assert_script_run q(grep 'stunnel:.*FIPS mode enabled' /var/log/messages);
assert_script_run q(systemctl status stunnel | grep "FIPS mode enabled");
}

sub run {
Expand Down

0 comments on commit e662703

Please sign in to comment.