Slide 1

Slide 1 text

Testing Fedora in openQA ..or how to start testing anything in openQA in less than 24 hours Richard Brown – openSUSE Chairman [email protected]

Slide 2

Slide 2 text

What is openQA?

Slide 3

Slide 3 text

4 openQA • Open Source distribution testing framework • Started in 2009 • Tests Operating Systems and their applications • GUI & Console Testing • Used by the openSUSE ® distribution, Tumbleweed, and now SUSE ®

Slide 4

Slide 4 text

5 The Magic Behind Tumbleweed • openQA is an integral part of openSUSE development • Incoming changes are 'Staged' and tested in isolation atop of the last 'known good' build • In depth testing is then carried out on the whole distribution before release • openSUSE Tumbleweed snapshots released after successful testing • New Tumbleweed release every 2-3 days, sometimes faster.

Slide 5

Slide 5 text

6 Installation Testing

Slide 6

Slide 6 text

7 Graphical Application Testing

Slide 7

Slide 7 text

8 Console Testing

Slide 8

Slide 8 text

9 PROPER Console Testing << type_string(string='\'curl ­f ­v http://10.0.2.2:20063/current_script > /tmp/scriptrPOv.sh && echo "curl­0" > /dev/ttyS0 \'' , max_interval='\'250\'' ) [Fri Apr 10 14:07:01 2015] [debug] GET "/current_script". [Fri Apr 10 14:07:01 2015] [debug] Routing to a callback. [Fri Apr 10 14:07:01 2015] [debug] Request from 127.0.0.1. [Fri Apr 10 14:07:01 2015] [debug] Routing to a callback. [Fri Apr 10 14:07:01 2015] [debug] 200 OK (0.001168s, 856.164/s). Debug: /var/lib/openqa/share/tests/sle­11­SP4­ Alpha/tests/console/curl_https.pm:8 called testapi::validate_script_output <<< wait_serial(regex='curl­0' , timeout=2 ) >>> wait_serial: curl­0: ok

Slide 9

Slide 9 text

10 The Team • Ancor Gonzalez Sosa • Anja Stock • Dinar Valeev • Dominik Heidler • Dominique Leuenberger • Howard Guo • Jozef Pupava • Ludwig Nussel • Marita Werner • Max Lin • Ondřej Holeček • Pavel Sladek • Razvan Gherlea • Richard Brown • Stephan Kulow • Susanne Oberhauser-Hirschof • Vladimir Nadvornik • Wei Jiang

Slide 10

Slide 10 text

11 The Team • Ancor Gonzalez Sosa • Anja Stock • Dinar Valeev • Dominik Heidler • Dominique Leuenberger • Howard Guo • Jozef Pupava • Ludwig Nussel • Marita Werner and Red Hat! • Max Lin • Ondřej Holeček • Pavel Sladek • Razvan Gherlea • Richard Brown • Stephan Kulow • Susanne Oberhauser-Hirschof • Vladimir Nadvornik • Wei Jiang

Slide 11

Slide 11 text

12 Red Hat? • Using openQA to test Fedora 22 and Rawhide • Dockerised openQA • Contributing Patches, Ideas, and New Tooling • Public Instance https://openqa.happyassassin.net/

Slide 12

Slide 12 text

openQA in Action

Slide 13

Slide 13 text

14 Contributing to openQA • Main Website http://os-autoinst.github.io/openQA • Documentation http://os-autoinst.github.io/openQA/documentation/

Slide 14

Slide 14 text

15 Contributing to openQA • Repositories ‒ openSUSE/SLE Tests https://github.com/os-autoinst/os-autoinst-distri-opensuse ‒ Fedora Tests https://bitbucket.org/rajcze/openqa_fedora ‒ Backend https://github.com/os-autoinst/os-autoinst ‒ Frontend/WebUI https://github.com/os-autoinst/openQA

Slide 15

Slide 15 text

16 To Learn More Overview of openQA Ludwig Nussel Tomorrow 13:30 Second Room

Slide 16

Slide 16 text

Writing openQA tests for Fedora

Slide 17

Slide 17 text

18 You need one of these...

Slide 18

Slide 18 text

19 ...and one of these

Slide 19

Slide 19 text

20 Best way to start • Fire up a VM of Fedora • Install as usual ‒ Keyboard Shortcuts are easier to write ‒ Mark when would be a good place to 'needle' (Take a screenshot and check the screen) • Write down screens/stages, keypresses and needle points

Slide 20

Slide 20 text

21 Writing good test notes • One 'test' (screen, stage, function) per page • One line per keypress • One line per needle point

Slide 21

Slide 21 text

22 Example Notes

Slide 22

Slide 22 text

23 The 'driver' – main.pm • For each distribution/test suite the main.pm decides which test modules run in which order • For a simple test suite, this is straight forward ‒ One page of notes = one 'loadtest “$filename.pm”' line in main.pm

Slide 23

Slide 23 text

24 Making Test Files • Test modules go in a /tests folder • Subfolders help with organisation (installation, console, $application, etc) • One page of notes = one $filename.pm in the tests folder

Slide 24

Slide 24 text

25 From notes, to code Check Needle assert_screen (FATAL) check_screen (NON-FATAL) Keypress send_key Type String type_string

Slide 25

Slide 25 text

26 Example Notes

Slide 26

Slide 26 text

27 Example Code assert_screen "inst-welcome", 120; send_key 'right'; send_key 'ret'; assert_screen "inst-langselection", 60; send_key 'alt-c'; if (get_var("BETA")) { assert_screen "inst-betawarning", 30; send_key "tab"; assert_screen "inst-fateaccept", 5; send_key "ret"; } assert_screen "inst-summary", 5;

Slide 27

Slide 27 text

Rinse, Repeat… then…

Slide 28

Slide 28 text

Questions?

Slide 29

Slide 29 text

30 Have a Lot of Fun, and Join Us At: www.opensuse.org

Slide 30

Slide 30 text

General Disclaimer This document is not to be construed as a promise by any participating organisation to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. openSUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for openSUSE products remains at the sole discretion of openSUSE. Further, openSUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All openSUSE marks referenced in this presentation are trademarks or registered trademarks of SUSE LLC, in the United States and other countries. All third-party trademarks are the property of their respective owners. License This slide deck is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license. It can be shared and adapted for any purpose (even commercially) as long as Attribution is given and any derivative work is distributed under the same license. Details can be found at https://creativecommons.org/licenses/by-sa/4.0/ Credits Template Richard Brown [email protected] Design & Inspiration openSUSE Design Team http://opensuse.github.io/branding- guidelines/