-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy pathy2_mm_common.pm
37 lines (27 loc) · 971 Bytes
/
y2_mm_common.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
=head1 y2_mm_common.pm
Configure a static network.
=cut
package y2_mm_common;
use strict;
use warnings;
use Exporter 'import';
use testapi;
use mm_tests 'configure_static_network';
use x11utils 'turn_off_gnome_screensaver';
our @EXPORT = qw(prepare_xterm_and_setup_static_network);
=head2 prepare_xterm_and_setup_static_network
prepare_xterm_and_setup_static_network();
Use C<x11_start_program('xterm')> to open a xterm.
Then setup a static network by C<configure_static_network(%args{ip})>.
C<%args> is a list with possible keys like {message} or {ip}.
=cut
sub prepare_xterm_and_setup_static_network {
my %args = @_;
die "Static network configuration failed, no IP specified!\n" unless defined($args{ip});
x11_start_program('xterm -geometry 160x45+5+5', target_match => 'xterm');
turn_off_gnome_screensaver;
become_root;
record_info 'Network', $args{message} if defined($args{message});
configure_static_network($args{ip});
}
1;