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 privileged mode in podman and docker. The command mount -t tmpfs none /mnt only works in privileged mode because the read-only protection in the default mode https://progress.opensuse.org/issues/135518
- Loading branch information
Showing
2 changed files
with
64 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright 2023 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
|
||
# Package: podman | ||
# Summary: Test podman with systemd | ||
# Maintainer: [email protected] | ||
|
||
use Mojo::Base 'containers::basetest'; | ||
use testapi; | ||
use serial_terminal 'select_serial_terminal'; | ||
use utils qw(validate_script_output_retry); | ||
|
||
sub run { | ||
my ($self, $args) = @_; | ||
select_serial_terminal; | ||
|
||
my $runtime = "podman"; | ||
my $engine = $self->containers_factory($runtime); | ||
reset_container_network_if_needed($runtime); | ||
|
||
my $image = get_var("CONTAINER_IMAGE_TO_TEST", "registry.suse.com/bci/bci-base:latest"); | ||
|
||
record_info('Test', 'Launch a container with privileged mode'); | ||
assert_script_run("$runtime run -ti --rm --privileged $image mount -t tmpfs none /mnt"); | ||
} | ||
|
||
sub cleanup { | ||
my ($self) = @_; | ||
$self->{podman}->cleanup_system_host(); | ||
} | ||
|
||
sub post_run_hook { | ||
my ($self) = @_; | ||
$self->cleanup(); | ||
} | ||
|
||
sub post_fail_hook { | ||
my ($self) = @_; | ||
$self->cleanup(); | ||
} | ||
|
||
1; |