Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wicked: test dummy interfaces #20186

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/wicked/ifcfg/dummy1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
STARTMODE='auto'
BOOTPROTO='static'
4 changes: 4 additions & 0 deletions data/wicked/ifcfg/foo0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BOOTPROTO='none'
STARTMODE='auto'

INTERFACETYPE='dummy'
4 changes: 4 additions & 0 deletions data/wicked/ifcfg/foo1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BOOTPROTO='none'
STARTMODE='auto'

DUMMY='yes'
36 changes: 36 additions & 0 deletions tests/wicked/basic/sut/t23_dummy_ifup_ifreload.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2024 SUSE LLC
# Copyright 2024 Georg Pfuetzenreuter
# SPDX-License-Identifier: GPL-2.0-or-later

# Package: wicked
# Summary: Dummy - ifup, ifreload

use base 'wickedbase';
use strict;
use warnings;
use testapi;

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

my $config_base = '/etc/sysconfig/network/';
my @interfaces = qw( dummy1 foo0 foo1 );

foreach (@interfaces) {
my $interface = $_;
$self->get_from_data("wicked/ifcfg/$interface", "$config_base/$interface");

$self->wicked_command('ifup', "$interface");
$self->wicked_command('ifreload', "$interface");
}

foreach (@interfaces) {
die if ($self->get_test_result($_) eq 'FAILED');
}
}

sub test_flags {
return {always_rollback => 1};
}

1;