Project

General

Profile

yast2_hostnames.pm

test module from /var/lib/openqa - agraul, 2018-11-28 16:21

 
1
# SUSE's openQA tests
2
#
3
# Copyright © 2009-2013 Bernhard M. Wiedemann
4
# Copyright © 2012-2017 SUSE LLC
5
#
6
# Copying and distribution of this file, with or without modification,
7
# are permitted in any medium without royalty provided the copyright
8
# notice and this notice are preserved.  This file is offered as-is,
9
# without any warranty.
10

    
11
# Summary: yast2_hostnames check hostnames and add/delete hostsnames
12
#    Make sure those yast2 modules can opened properly. We can add more
13
#    feature test against each module later, it is ensure it will not crashed
14
#    while launching atm.
15
# Maintainer: Zaoliang Luo <zluo@suse.com>
16

    
17
use base "y2x11test";
18
use strict;
19
use testapi;
20
use utils 'type_string_slow';
21

    
22

    
23
sub run {
24
    my $self   = shift;
25
    my $module = "host";
26

    
27
    select_console 'root-console';
28
    #	add 1 entry to /etc/hosts and edit it later
29
    script_run "echo '80.92.65.53    n-tv.de ntv' >> /etc/hosts";
30
    select_console 'x11', await_console => 0;
31
    $self->launch_yast2_module_x11('host', match_timeout => 90);
32
    assert_and_click "yast2_hostnames_added";
33
    wait_still_screen 1;
34
    wait_screen_change { send_key 'alt-i'; };
35
    send_key 'alt-t';
36
    type_string 'download-srv';
37
    wait_still_screen 1;
38
    send_key 'alt-h';
39
    type_string 'download.opensuse.org';
40
    wait_still_screen 1;
41
    send_key 'alt-i';
42
    type_string_slow '195.135.221.134';
43
    assert_and_click 'yast2_hostnames_changed_ok';
44
    assert_screen "yast2-$module-ui", 30;
45
    #	OK => Exit
46
    wait_screen_change { send_key "alt-o"; };
47
    select_console 'root-console';
48
    assert_script_run "grep 127.0.0.1 /etc/hosts"
49
}
50

    
51
# override for base class to allow a longer timeout for package installation
52
# before returning to desktop
53
sub post_run_hook {
54
    assert_screen 'generic-desktop', 600;
55
}
56

    
57
1;