SlideShare uma empresa Scribd logo
1 de 29
Kyua and Jenkins
Testing Framework for BSD
BAFUG, October 2014
by Craig Rodrigues
rodrigc@FreeBSD.org
Kyua
What is Kyua?
● It's a pun on “Q.A.”, but pronounced “kyoo-ah”
● It provides a framework for defining tests, and
running them
● Actual tests can be implemented in C, C++,
Shell, Python, etc.
History of Kyua
● Automated Testing Framework (ATF) started as
a NetBSD Google Summer of Code project in
2007 by Julio Merino (jmmv@)
● ATF was targeted to testing NetBSD with a
consistent framework
● Imported into NetBSD, and later FreeBSD
History of Kyua
● ATF was later refactored into two parts
– ATF: libraries and API's for writing tests in C, C++,
shell
– Kyua: run-time engine for running the tests, and
generating reports
Who uses Kyua?
● Open Source projects:
– NetBSD: ATF has been imported into base system
– FreeBSD: ATF has been imported into base system
● Companies building BSD based products
Trying out Kyua under FreeBSD
Build tests included with FreeBSD
● In FreeBSD-10 and lower, put in /etc/make.conf
WITH_TESTS=”yes”
● make buildworld; make installworld
● Tests will be in /usr/tests
Install kyua
● pkg install devel/kyua
List the tests
● cd /usr/tests
● kyua list
Run the tests
● cd /usr/tests
● kyua test
Generate reports
● Plain text report
– kyua report
● HTML report
– kyua report-html
● Junit XML report
– kyua report-junit
Writing your own tests
What do you need?
● Kyuafile
– kyua binary reads this to figure out what tests to run
● Tests, can be one or more of:
– plain test
– ATF test
– TAP test
Kyuafile
-- Comments in Kyuafiles must start with two hyphens
-- Need this boilerplate:
syntax(2)
-- The name of the test suite must be defined.
test_suite('mytests')
-- Specify test programs, must be in same dir as Kyuafile
plain_test_program{name='test1.sh'}
plain_test_program{name='test2.sh'}
atf_test_program{name='test3.sh'}
tap_test_program{name="legacy_test"}
-- Include another Kyuafile, to get more tests in different dir
include(“otherdir/Kyuafile”)
Plain test program
● exit status 0, means test succeeded
● exit status non-zero means test failed
● One test case per program
ATF test program
● Must use the ATF libraries
● Available only for C, C++, Bourne shell
programs
● API allows you to specify pass, fail, skipped
● Single program can contain multiple test cases
ATF shell example
#!/usr/local/bin/atf-sh
atf_test_case test1
test1_head()
{
atf_set "descr" "Test 1, remove file"
}
test1_body()
{
rm /something
}
atf_init_test_cases()
{
atf_add_test_case test1
}
ATF shell hints
● Always do “kyua list” to make sure test cases
are properly integrated
● Never explicitly exit or return in your test cases.
This will mess things up.
● Look at libatf-sh.subr to see the shell routines
used for executing testss
TAP test program
● Program generates output which follows the
“Test Anything Protocol” http://testanything.org
● “kyua list” does not work for TAP, need to run
the tests to figure out how many there are
TAP test sample output
1..4
ok 1 - Input file opened
not ok 2 - First line of the input valid
ok 3 - Read the rest of the file
not ok 4 – Other failure
Jenkins
Jenkins and Continuous Integration
● Jenkins can be used for Continuous Integration
– monitor SCM (git, svn) to see new checkins
– build the code
– run tests
– produce test reports
Jenkins and Testing
● Jenkins does not have a native test execution
engine, but can run external ones like JUnit
● Jenkins can take JUnit XML formatted test
result output and import it natively.
Jenkins and Kyua
● To integrate Jenkins and Kyua, create a
Jenkins job which runs these commands:
– kyua test
– kyua report-junit
● Configure Jenkins job to Publish JUnit test
result report
Further references
● Links:
– http://github.com/jmmv/kyua
– https://github.com/rodrigc/kyua/wiki/Quickstart-Guide
● Mailing lists:
– freebsd-testing@FreeBSD.org
– kyua-discuss@googlegroups.com

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 
Containerd Project Update: FOSDEM 2018
Containerd Project Update: FOSDEM 2018Containerd Project Update: FOSDEM 2018
Containerd Project Update: FOSDEM 2018
 
Kubernetes CRI containerd integration by Lantao Liu (Google)
Kubernetes CRI containerd integration by Lantao Liu (Google)Kubernetes CRI containerd integration by Lantao Liu (Google)
Kubernetes CRI containerd integration by Lantao Liu (Google)
 
OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)
 
Dokku
DokkuDokku
Dokku
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
LinuxKit Deep Dive
LinuxKit Deep DiveLinuxKit Deep Dive
LinuxKit Deep Dive
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a Dockerfile
 
Oleksandr Tarasenko "Using Kafka in your python applications"
Oleksandr Tarasenko "Using Kafka in your python applications"Oleksandr Tarasenko "Using Kafka in your python applications"
Oleksandr Tarasenko "Using Kafka in your python applications"
 
Using Kafka in your python application - Python fwdays 2020
Using Kafka in your python application - Python fwdays 2020Using Kafka in your python application - Python fwdays 2020
Using Kafka in your python application - Python fwdays 2020
 
Ropython-windbg-python-extensions
Ropython-windbg-python-extensionsRopython-windbg-python-extensions
Ropython-windbg-python-extensions
 
Docker at Digital Ocean
Docker at Digital OceanDocker at Digital Ocean
Docker at Digital Ocean
 
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington MeetupScaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
 
Go 1.8 'new' networking features
Go 1.8 'new' networking featuresGo 1.8 'new' networking features
Go 1.8 'new' networking features
 
OpenStack for Telco Cloud
OpenStack for Telco CloudOpenStack for Telco Cloud
OpenStack for Telco Cloud
 
An Open Source Story: Open Containers & Open Communities
An Open Source Story: Open Containers & Open CommunitiesAn Open Source Story: Open Containers & Open Communities
An Open Source Story: Open Containers & Open Communities
 
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
 
App container rkt
App container rktApp container rkt
App container rkt
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 
Scaling i/o bound Microservices
Scaling i/o bound MicroservicesScaling i/o bound Microservices
Scaling i/o bound Microservices
 

Destaque

WebCamp 2016: Python. Михаил Бегерский: Использование asyncio-стека для разра...
WebCamp 2016: Python. Михаил Бегерский: Использование asyncio-стека для разра...WebCamp 2016: Python. Михаил Бегерский: Использование asyncio-стека для разра...
WebCamp 2016: Python. Михаил Бегерский: Использование asyncio-стека для разра...
WebCamp
 

Destaque (15)

The Onward Journey: Porting Twisted to Python 3
The Onward Journey: Porting Twisted to Python 3The Onward Journey: Porting Twisted to Python 3
The Onward Journey: Porting Twisted to Python 3
 
Python twisted
Python twistedPython twisted
Python twisted
 
Обзор фреймворка Twisted
Обзор фреймворка TwistedОбзор фреймворка Twisted
Обзор фреймворка Twisted
 
Asynchronous Python with Twisted
Asynchronous Python with TwistedAsynchronous Python with Twisted
Asynchronous Python with Twisted
 
WebCamp 2016.PHP.Боднарчук Михаил.BDD на практике с Codeception
WebCamp 2016.PHP.Боднарчук Михаил.BDD на практике с CodeceptionWebCamp 2016.PHP.Боднарчук Михаил.BDD на практике с Codeception
WebCamp 2016.PHP.Боднарчук Михаил.BDD на практике с Codeception
 
WebCamp 2016: Python. Михаил Бегерский: Использование asyncio-стека для разра...
WebCamp 2016: Python. Михаил Бегерский: Использование asyncio-стека для разра...WebCamp 2016: Python. Михаил Бегерский: Использование asyncio-стека для разра...
WebCamp 2016: Python. Михаил Бегерский: Использование asyncio-стека для разра...
 
WebCamp 2016: Python. Вячеслав Каковский: Real-time мессенджер на Python. Осо...
WebCamp 2016: Python. Вячеслав Каковский: Real-time мессенджер на Python. Осо...WebCamp 2016: Python. Вячеслав Каковский: Real-time мессенджер на Python. Осо...
WebCamp 2016: Python. Вячеслав Каковский: Real-time мессенджер на Python. Осо...
 
Libvirt and bhyve under FreeBSD
Libvirt and bhyve under FreeBSDLibvirt and bhyve under FreeBSD
Libvirt and bhyve under FreeBSD
 
Implementing microservices tracing with spring cloud and zipkin (spring one)
Implementing microservices tracing with spring cloud and zipkin (spring one)Implementing microservices tracing with spring cloud and zipkin (spring one)
Implementing microservices tracing with spring cloud and zipkin (spring one)
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Semelhante a Kyua and Jenkins: Testing Framework for BSD

Semelhante a Kyua and Jenkins: Testing Framework for BSD (20)

Continuous testing
Continuous testingContinuous testing
Continuous testing
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone Civetta
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Fundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDFundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CD
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
 
Autotools
AutotoolsAutotools
Autotools
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Linux Kernel Selftest Framework - Quality Control for New Releases
Linux Kernel Selftest Framework - Quality Control for New ReleasesLinux Kernel Selftest Framework - Quality Control for New Releases
Linux Kernel Selftest Framework - Quality Control for New Releases
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
 
The Popper Experimentation Protocol and CLI tool
The Popper Experimentation Protocol and CLI toolThe Popper Experimentation Protocol and CLI tool
The Popper Experimentation Protocol and CLI tool
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 
Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0
 
Leveraging the Cloud for HDF Software Testing
Leveraging the Cloud for HDF Software TestingLeveraging the Cloud for HDF Software Testing
Leveraging the Cloud for HDF Software Testing
 
oSSN19 - openSUSE on ARM
oSSN19 - openSUSE on ARMoSSN19 - openSUSE on ARM
oSSN19 - openSUSE on ARM
 
3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API - 3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API -
 
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API
 
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with SpinnakerSpinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
 
Kali Linux-Operating System Presentation.pptx
Kali Linux-Operating System Presentation.pptxKali Linux-Operating System Presentation.pptx
Kali Linux-Operating System Presentation.pptx
 
OpenCV Workshop
OpenCV WorkshopOpenCV Workshop
OpenCV Workshop
 
30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPAN
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Último (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Kyua and Jenkins: Testing Framework for BSD

  • 1. Kyua and Jenkins Testing Framework for BSD BAFUG, October 2014 by Craig Rodrigues rodrigc@FreeBSD.org
  • 3. What is Kyua? ● It's a pun on “Q.A.”, but pronounced “kyoo-ah” ● It provides a framework for defining tests, and running them ● Actual tests can be implemented in C, C++, Shell, Python, etc.
  • 4. History of Kyua ● Automated Testing Framework (ATF) started as a NetBSD Google Summer of Code project in 2007 by Julio Merino (jmmv@) ● ATF was targeted to testing NetBSD with a consistent framework ● Imported into NetBSD, and later FreeBSD
  • 5. History of Kyua ● ATF was later refactored into two parts – ATF: libraries and API's for writing tests in C, C++, shell – Kyua: run-time engine for running the tests, and generating reports
  • 6. Who uses Kyua? ● Open Source projects: – NetBSD: ATF has been imported into base system – FreeBSD: ATF has been imported into base system ● Companies building BSD based products
  • 7. Trying out Kyua under FreeBSD
  • 8. Build tests included with FreeBSD ● In FreeBSD-10 and lower, put in /etc/make.conf WITH_TESTS=”yes” ● make buildworld; make installworld ● Tests will be in /usr/tests
  • 9. Install kyua ● pkg install devel/kyua
  • 10. List the tests ● cd /usr/tests ● kyua list
  • 11. Run the tests ● cd /usr/tests ● kyua test
  • 12. Generate reports ● Plain text report – kyua report ● HTML report – kyua report-html ● Junit XML report – kyua report-junit
  • 14. What do you need? ● Kyuafile – kyua binary reads this to figure out what tests to run ● Tests, can be one or more of: – plain test – ATF test – TAP test
  • 15. Kyuafile -- Comments in Kyuafiles must start with two hyphens -- Need this boilerplate: syntax(2) -- The name of the test suite must be defined. test_suite('mytests') -- Specify test programs, must be in same dir as Kyuafile plain_test_program{name='test1.sh'} plain_test_program{name='test2.sh'} atf_test_program{name='test3.sh'} tap_test_program{name="legacy_test"} -- Include another Kyuafile, to get more tests in different dir include(“otherdir/Kyuafile”)
  • 16. Plain test program ● exit status 0, means test succeeded ● exit status non-zero means test failed ● One test case per program
  • 17. ATF test program ● Must use the ATF libraries ● Available only for C, C++, Bourne shell programs ● API allows you to specify pass, fail, skipped ● Single program can contain multiple test cases
  • 18. ATF shell example #!/usr/local/bin/atf-sh atf_test_case test1 test1_head() { atf_set "descr" "Test 1, remove file" } test1_body() { rm /something } atf_init_test_cases() { atf_add_test_case test1 }
  • 19. ATF shell hints ● Always do “kyua list” to make sure test cases are properly integrated ● Never explicitly exit or return in your test cases. This will mess things up. ● Look at libatf-sh.subr to see the shell routines used for executing testss
  • 20. TAP test program ● Program generates output which follows the “Test Anything Protocol” http://testanything.org ● “kyua list” does not work for TAP, need to run the tests to figure out how many there are
  • 21. TAP test sample output 1..4 ok 1 - Input file opened not ok 2 - First line of the input valid ok 3 - Read the rest of the file not ok 4 – Other failure
  • 23. Jenkins and Continuous Integration ● Jenkins can be used for Continuous Integration – monitor SCM (git, svn) to see new checkins – build the code – run tests – produce test reports
  • 24. Jenkins and Testing ● Jenkins does not have a native test execution engine, but can run external ones like JUnit ● Jenkins can take JUnit XML formatted test result output and import it natively.
  • 25. Jenkins and Kyua ● To integrate Jenkins and Kyua, create a Jenkins job which runs these commands: – kyua test – kyua report-junit ● Configure Jenkins job to Publish JUnit test result report
  • 26.
  • 27.
  • 28.
  • 29. Further references ● Links: – http://github.com/jmmv/kyua – https://github.com/rodrigc/kyua/wiki/Quickstart-Guide ● Mailing lists: – freebsd-testing@FreeBSD.org – kyua-discuss@googlegroups.com