Top Banner
40

openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Jan 16, 2017

Download

Software

Ben Chou
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 2: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Agenda• Introduction of openQA

‒ System Architecture and Workflow

‒ Include Items : openQA, OS-autoinst, Needles ...etc.

‒ What is openQA-Worker doing for

‒ How is the Image Matching in openQA

‒ Contribute to Upstream in GitHub

• WORKSHOP

‒ Installation of openQA framework in openSUSE Leap 42.1

‒ How to run a test job and configure the settings on openQA WEBUI

‒ How to create/compose your own test case for openQA

Page 3: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 4: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 5: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 6: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

System Architecture

Page 7: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Layout of openQA WebUI

Page 8: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Test Flow of openQA

Page 9: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 10: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

os-autoinst backends

• QEMU/KVM (default)• IPMI (real HW)• X86_64,PowerPC, s390, PowerVM...etc.

• Refer to backend docs ‒ (https://github.com/os-autoinst/os-

autoinst/blob/master/doc/backend_vars.asciidoc)

Page 11: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 12: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 13: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

"tags": [ "inst-welcome", "languagepicked" ],

"area": [ { "width": 339, "height": 55, "xpos": 0, "type"0: "match", "ypos": 178 },

{ "ypos": 223, "type": "match", "height": 49, "width": 175, "xpos": 351 }

Welcome.png

Welcome.json

Tags

Match Area 1 Match Area 2

Page 14: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 15: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Test Modules Integration

Page 16: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 17: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

OpenQA-Worker

• Workers are processes running virtual machines to perform the actual testing. They are distributed as a separate package and can be installed on multiple machines but still using only one WebUI.

Page 18: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Test Running via openQA-worker

Page 19: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Test Architecture

• Test loader ‒ main.pm

• Test cases‒ tests/*

• Test needles‒ screenshot + metadata

Page 20: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 21: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Resources• openQA

‒ (https://github.com/os-autoinst/openQA)

• os-autoinst ‒ (https://github.com/os-autoinst/os-autoinst)

• openSUSE tests ‒ (https://github.com/os-autoinst/os-autoinst-distri-opensuse)

• openSUSE needles ‒ (https://github.com/os-autoinst/os-autoinst-needles-opensuse)

Page 22: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 23: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 24: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #1: Installation

• Add repo for openSUSE Leap 42.1

# zypper in openQA

• Installation of openQA

# zypper ar -f obs://devel:openQA/openSUSE_Leap_42.1 openQA

# zypper ar -f obs://devel:openQA:Leap:42.1/openSUSE_Leap_42.1 openQA-perl-modules

Refer to :https://github.com/os-autoinst/openQA/blob/master/docs/Installing.asciidoc

Page 25: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #2: Basic Configuration

• Apache proxy configuration

• SSL/TLS‒ If you don’t have a TLS/SSL certificate for your host you must

turn HTTPS off. You can do that in /etc/openqa/openqa.ini

# a2enmod headers

# a2enmod proxy

# a2enmod proxy_http

# a2enmod proxy_wstunnel

Page 26: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #3: Start openQA WebUI

• Use systemd command to enable openQA services

• The openQA web UI should be available on http://localhost/ now.

• To ensure openQA runs on each boot, you should also systemctl enable the same services.

# systemctl start openqa-scheduler

# systemctl start openqa-gru

# systemctl start openqa-websockets

# systemctl start openqa-webui

# systemctl restart apache2

Page 27: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #4: Run openQA-Worker

• Workers are processes running virtual machines to perform the actual testing. They are distributed as a separate package and can be installed on multiple machines but still using only one WebUI.

• Installation

# zypper in openQA-worker

• Start

# systemctl start [email protected] (You can start as many workers as you dare, you just need to supply different worker id (number after @).)

Page 28: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #5: Manage API Key

• To allow workers to access your instance, you need to log into openQA as operator and create a pair of API key and secret.

• OpenQA WEBUI → Manage API keys → CREATE

‒ Use the API and fill in your installed worker machine

• Modify /etc/openqa/client.conf

[localhost]

key = 0123456789ABCDEF (replace into your key)

secret = 0123456789ABCDEF (replace into your key)

Page 29: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #6: User Authentication

• OpenQA supports three different authentication methods - OpenID (default), iChain and Fake. See auth section in /etc/openqa/openqa.ini

[auth]

• # method name is case sensitive!

• method = OpenID|iChain|Fake

• For Testing purposes only! Fake authentication bypass any authentication and automatically allow any login requests as Demo user with administrator privileges and without password.

Page 30: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 31: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #7: Test Configuration-1

• Medium types

• Distri → opensuse

• Version → 42.1

• Flavor → Desktop-DVD

• Arch → x86_64

• Settings → ISO_MAXSIZE=4700372992

SHUTDOWN_NEEDS_AUTH=1

Page 32: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #8: Test Configuration-2

• Machines

• Name → 64bit

• Backend → qemu

• Settings → HDDSIZEGB=20

QEMUCPU=qemu64

WORKER_CLASS=qemu_x86_64

Page 33: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #9: Test Configuration-3

• Job Group

• Name → openSUSE_42.1_installation

• Settings → DESKTOP = gnome

INSTALLONLY = 1

• Test suites

• Create a openSUSE 42.1 job group

• Add the test suite into the test group

Page 34: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 35: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #10: Test ISO,Cases,Needles

• Test Needles

• Get → Download openSUSE-Leap-42.1-DVD-x86_64.iso file from official website

• Locate → /var/lib/openqa/factory/iso

• Test ISO

• Get → $git clone https://github.com/os-autoinst/os-autoinst-distri-opensuse

• Action → Rename os-autoinst-distri-opensuse folder as opensuse

• Locate → /var/lib/openqa/tests/opensuse

• Test Cases

• Get → $git clone https://github.com/os-autoinst/os-autoinst-needles-opensuse

• Action → Rename os-autoinst-needles-opensuse folder as needles

• Locate → /var/lib/openqa/tests/opensuse/products/opensuse/needles

Page 36: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 37: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Workshop #11: Run openQA test

Test for openSUSE 42.1 GM ISO:

# /usr/share/openqa/script/client isos post ISO=openSUSE-Leap-42.1-DVD-x86_64.iso DISTRI=opensuse VERSION=42.1 FLAVOR=Desktop-DVD ARCH=x86_64 BUILD=GM

• Launch openQA test via script

Page 38: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016
Page 39: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016

Have a Lot of Fun, and Join Us At:

Page 40: openQA hands on with openSUSE Leap 42.1 - openSUSE.Asia Summit ID 2016