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

Add mac80211_hwsim test #3303

Merged
merged 2 commits into from
Jul 18, 2017
Merged

Conversation

nicksinger
Copy link
Member

@nicksinger nicksinger commented Jul 17, 2017

This test is supposed to test the WPA2 enterprise capabilities of hostapd and NetworkManager.
It makes use of the mac80211_hwsim kernel module to simulate real radio hardware.
Right now it is very based on Gnome on Tumbleweed for a first start but should be compatible with all our products after some needle changes.

It does the testing like described here:
https://progress.opensuse.org/issues/20306

A first impression how this looks can be found on my local machine:
http://openqa.glados.qa.suse.de/tests/257

This is how this module looks like in action:
http://openqa.glados.qa.suse.de/tests/282#step/consoletest_setup/29

Required needles: os-autoinst/os-autoinst-needles-opensuse#236

Feedback and critique heavily welcome!

# notice and this notice are preserved. This file is offered as-is,
# without any warranty.

# Summary: mac80211 hw test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some more here, I know you can do :-) Describe the purpose of the test, limitations, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do so

# Tags: poo#20306

use base 'x11test';
use y2x11test qw(launch_yast2_module_x11);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use single ticks, probably perlcritic will also tell this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use single ticks

send_key 'tab';
type_string 'nots3cr3t';

# aat 'connect'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aat?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover comments

y2x11test::launch_yast2_module_x11;
$self->yast_search('Network Settings');

# assert_and_click 'yast2-networksettings'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of these comments are a bit to verbose and don't add information. Looks like left-overs from initial pseudo code? Better delete some comments now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, definitely leftovers from pseudocode

# softfail yast2 error
# aac 'ok'
if (check_screen 'yast2_network-error_dialog') {
record_soft_failure 'bsc#TODO';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you don't have a bugref better just make it a die with a hint what to report a but about.

# assert 'saving-is-running'
# softfail yast2 error
# aac 'ok'
if (check_screen 'yast2_network-error_dialog') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't use check_screen with default timeout or higher as this would waste time in case everything is ok. Better use a multi-tag assert_screen in combination with match_has_tag

}
}
type_string $name if $name;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case you just copied this from the yast2_control_center test better extract it into a common base class

$self->generate_certs;
$self->configure_hostapd;
$self->reload_services;
type_string "exit\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't log out of the root console. You can call utils::clear_console if you prefer

@okurz
Copy link
Member

okurz commented Jul 18, 2017

It's not done when you don't update the PR, the PR message still states WIP and checks fail

@nicksinger
Copy link
Member Author

nicksinger commented Jul 18, 2017

Therefore commit 1dafa48 a177e40. I tried to address most of your mentioned improvements and made the test to complete. A run with the recent changes can be seen here: http://openqa.glados.qa.suse.de/tests/282

I'm not 100% sure how to handle this recommendation from you about the assert_screen but will ask you in person. The failing test (and tidy) I want to address in the next commit.

Anything to improve about the current code base?

@okurz
Copy link
Member

okurz commented Jul 18, 2017

update PR message, remove the WIP part

# Tags: poo#20306

use base 'x11test';
use y2x11test qw(launch_yast2_module_x11);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use single ticks


## we have to change the networkmanager form wicked to NetworkManager
#y2x11test::launch_yast2_module_x11;
#$self->yast_search('Network Settings');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why disabled?

Copy link
Member Author

@nicksinger nicksinger Jul 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y2x11test::launch_yast2_module_x11 is able to open yast modules directly. This results in less duplicate code (e.g. the yast2 search function is not needed anymore). The comment is mainly for me to not check in these needles


## open the 'Network Settings'
#assert_and_click 'yast2_control-center_network-check';
#assert_screen 'yast2_control-center_network-opened';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why disabled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment above

@nicksinger nicksinger changed the title [WIP] Add mac80211_hwsim test Add mac80211_hwsim test Jul 18, 2017
@okurz
Copy link
Member

okurz commented Jul 18, 2017

LGTM, I will enable the test in the test plan

@okurz okurz merged commit 272f597 into os-autoinst:master Jul 18, 2017
okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Jul 18, 2017
okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Jul 18, 2017
okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Jul 18, 2017
okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Jul 19, 2017
okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Jul 20, 2017
nicksinger pushed a commit to nicksinger/os-autoinst-distri-opensuse that referenced this pull request Jul 20, 2017
okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Sep 22, 2017
okurz added a commit that referenced this pull request Sep 29, 2017
Enable the new mac80211_hwsim wifi simulation test added by #3303
rwx788 pushed a commit to rwx788/os-autoinst-distri-opensuse that referenced this pull request Oct 5, 2017
yxususe pushed a commit to yxususe/os-autoinst-distri-opensuse that referenced this pull request Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants