I'm interesting in SLEnkins project and I want to learn it a bit. I will try it and know how it works and how to use it.
/join #slenkins-hackweek
Looking for hackers with the skills:
Nothing? Add some keywords!
This project is part of:
Hack Week 13
Activity
Comments
-
almost 9 years ago by cachen | Reply
Calen Chen cachen@suse.com QA APACII Team Beijing
What is Slenkins?
An QA automation toolchain set!
Components: | +-----OBS (build system: tools, testsuites) | +-----Jenkins (test job scheduler) | +-----SUSE Cloud||KVM (test resources) | +-----Scripts and utilities (test setup and executing)
Sources
- gitlab: https://gitlab.suse.de/groups/SLEnkins
- IBS: https://build.suse.de/project/show/Devel:SLEnkins:testsuites
- repo: http://download.suse.de/ibs/Devel:/SLEnkins/
- vm images: http://147.2.207.1/slenkins/images/ (Auto sync from http://slenkins.suse.de/images)
Packages
Test Package layout:
tests-helloworld | +------- (main) (empty) | +------- tests-control for control server (in Jenkins) | +------- tests-sut for "sut" VM (in cloud) Or tests-helloworld | +------- (main) (empty) | +------- tests-control for control server (in Jenkins) | +------- tests-client for "client" VM (in cloud) | +------- tests-server for "server" VM (in cloud)
Control server package:
tests-control same as binary subpackage name | +- nodes "nodes file" | +- bin/ tests directory | +- 01basictest.sh first test control script | +- 02_options.sh second test control script
One node example: node sut repository ${CHANNELSLENKINSSUT} install ${PROJECT_NAME}
Two nodes example: # First node node client install tests-scp-tests-client
# Second node node server install tests-scp-tests-server
SUT nodes package:
tests-sut same as binary subpackage name | +- data/ data directory (options) | | | +- somedata.txt some test data file | +- bin/ tests directory | +- testcase1.sh first test | +- testcase2.sh second test
Server Controller Scripts
slenkins-engine-vms slenkins
/usr/lib/slenkins/ ├── init-jail │ ├── bashrc │ ├── etcgroup │ ├── etcosrelease │ ├── etcpasswd │ ├── etcsudoers │ ├── init-jail.sh │ └── sshidrsa ├── lib │ ├── slenkins-basic-functions.sh │ ├── slenkins-functions.sh │ └── tojunit └── vms ├── do-tests-in-vms.sh ├── local.repo ├── run-tests-in-vms.sh ├── test-net.xml ├── test-net.xslt ├── test-vm.xml └── test-vm.xslt
Executing example:
slenkins-vms.sh [-i|--image <node>=<image-name>]... [ <optional parameters> ] [ <nodes file overrides> ] <project-name>
Workflow
linux-ojr1:~/.ssh # slenkins-vms.sh -i sut=SLE12SP1-x86_64-default tests-helloworld
1)####Creating workspace in /var/tmp/slenkins/workspace/tests-helloworld
2)####Installing control RPM tests-helloworld-tests-control-0.0.5-1.2.noarch
3)####Saving to: ‘/var/tmp/slenkins/workspace/tests-helloworld/images.list’
4)####Configurations Defined variable SYSTEMSUT with value "SLE12SP1" Defined variable FAMILYSUT with value "SLE12SP1" Defined variable ARCHSUT with value "x8664" Defined variable VARIANTSUT with value "default" Defined variable CHANNELSLENKINSSUT with value "http://download.suse.de/ibs/Devel:/SLEnkins:/testsuites/SLE12SP1/Devel:SLEnkins:testsuites.repo" Defined variable CHANNELUPDATESSUT with value "http://download.suse.de/ibs/SUSE:/SLE-12-SP1:/Update/standard/SUSE:SLE-12-SP1:Update.repo http://download.suse.de/ibs/SUSE:/SLE-12:/Update/standard/SUSE:SLE-12:Update.repo" Defined variable CHANNELQASUT with value "http://download.suse.de/ibs/QA:/Head/SLE-12-SP1/QA:Head.repo" Defined variable CHANNELHAFACTORYSUT with value "http://download.opensuse.org/repositories/network:/ha-clustering:/Factory/SUSESLE-12-SP1Updatestandard/network:ha-clustering:Factory.repo"
Parsing nodes file: /var/lib/slenkins/tests-helloworld/tests-control/nodes
node SUT repository ${CHANNELSLENKINSSUT}
install ${PROJECT_NAME}
Variable REPORT has value "/var/tmp/slenkins/workspace/tests-helloworld/junit-results.xml" Variable VIRSHDEFAULTCONNECTURI has value "qemu:///system" Variable VMMODEL has value "m1.smaller"
5)####Cleanup for node SUT Trying to remove previous instance of test machine for node SUT Stop Undefine
6)####Network fixed enabled linux-ojr1:~/.ssh # cat /var/lib/libvirt/dnsmasq/fixed.conf
dnsmasq conf file created by libvirt
strict-order pid-file=/var/run/libvirt/network/fixed.pid except-interface=lo bind-dynamic interface=fixedbr0 dhcp-range=192.168.15.2,192.168.15.254 dhcp-no-override dhcp-lease-max=253 dhcp-hostsfile=/var/lib/libvirt/dnsmasq/fixed.hostsfile addn-hosts=/var/lib/libvirt/dnsmasq/fixed.addnhosts
7)####Preparations for node SUT Trying to get image for system SLE12SP1: http://147.2.207.1/slenkins/images//SLE12SP1-x86_64-default.qcow2 Image downloaded in /var/tmp/slenkins/images
8)####Trying to spawn new virtual machine for node SUT VM Instance defined VM Instance started
9)####Determining internal IP address for network fixed Internal IP address is 192.168.15.46 Waiting for SSH to become available
10)####Trying to install the requested repositories Installed repositories http://download.suse.de/ibs/Devel:/SLEnkins:/testsuites/SLE12SP1/Devel:SLEnkins:testsuites.repo Installed packages tests-helloworld Setting environment variables for the node SUT Defined variable TARGETSUT with value "ssh:192.168.15.46" Defined variable INTERNALIPSUT with value "192.168.15.46" Defined variable EXTERNALIPSUT with value "192.168.15.46" Defined variable IP6SUT with value "N/A" Defined variable INTERNALIPSUTETH0 with value "192.168.15.46" Defined variable EXTERNALIPSUTETH0 with value "192.168.15.46" Defined variable IP6SUTETH0 with value "N/A" Defined variable NETWORKSUTETH0 with value "fixed"
11)####Trying to read tests table ======== Tests to be run ======== 01_helloworld.sh
02helloworldoptions.sh
/var/lib/slenkins/tests-helloworld/tests-control/bin ├── 01helloworld.sh └── 02helloworld_options.sh
Testcase wrapper, excute by twopence_command
12)####Preparing logs files failed.txt junit-results.log
13)####Trying to run test 01_helloworld.sh
junit testsuite time="2015-12-10T12:04:12.555" text="helloworld"
junit testcase time="2015-12-10T12:04:12.559" id="helloworld.helloworld" text="helloworld"
Return code from the test server: 0 Return code of tested command: 0
junit success time="2015-12-10T12:04:12.701"
junit endsuite time="2015-12-10T12:04:12.705"
Copying JUnit XML results for test 01_helloworld.sh
Trying to run test 02helloworldoptions.sh
junit testsuite time="2015-12-10T12:04:12.712" text="helloworld with options"
junit testcase time="2015-12-10T12:04:12.716" id="helloworld.options.help" text="Help option"
Return code from the test server: 0 Return code of tested command: 0
junit success time="2015-12-10T12:04:12.853"
junit testcase time="2015-12-10T12:04:12.856" id="helloworld.options.unknown" text="Unknown options"
Return code from the test server: 0 Return code of tested command: 1
junit success time="2015-12-10T12:04:13.000"
junit endsuite time="2015-12-10T12:04:13.004"
Copying JUnit XML results for test 02helloworldoptions.sh
Finishing log files Post-processing log file junit-results.log
14)####Checking for failed tests
15)####Stopping virtual machine tests-helloworld-SUT
Run a test package from local build
1) cd /var/tmp/build-root/ 2) osc -A https://api.suse.de co Devel:SLEnkins:testsuites tests-helloworld 3) cd /var/tmp/build-root/Devel:SLEnkins:testsuites/tests-helloworld 4) osc build SLE12SP1 --no-verify 5) slenkins-vms.sh -l -i sut=SLE12SP1-x86_64-default tests-helloworld
Note
1) keep vm instance after test use "-K"
2) Internal IP address unknown linux-ojr1:/usr/lib/slenkins/vms # virsh net-dhcp-leases fixed
Expiry Time MAC address Protocol IP address Hostname Client ID or DUID
rcapparmor stop
TODO
1) twopence
2) Run from Jenkins against SUSE Cloud
Similar Projects
This project is one of its kind!