SlideShare a Scribd company logo
1 of 78
Assurer – A server testing/monitoring framework Gosuke Miyashita http://mizzy.org/
Myself ,[object Object],[object Object],[object Object],[object Object],[object Object]
 
What’s Assurer ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Where the name Assurer derived from ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],MISS
Image of exec Assurer #0
Image of exec Assurer #1
Image of Asura Baster
Image of the real Asura
Image of fake Asura
Execution phases of Assurer
Execution phases of Assurer  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Relation of each phases Test Publish Format Nofity
Details of each phases
Test phase
Test phase ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Config of test phase ,[object Object],[object Object],[object Object],[object Object],[object Object]
Notify phase
Notify  フェーズ ,[object Object],[object Object],[object Object]
Config of notify phase ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Notify::IRC example
Format phase
Format phase ,[object Object],[object Object],[object Object],[object Object]
Config of format phase ,[object Object],[object Object],[object Object],[object Object]
Publish phase
Publish phase ,[object Object],[object Object],[object Object],[object Object],[object Object]
Config of publish phase ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],publish: -  module:  Mail config: subject:  Test results from Assurer to:  someone@example.com from:  root@example.com
Format::Text + Publish::Term
Format::HTML + Publish::File
Format::Text + Publish::Mail
Summary for now ,[object Object],[object Object],[object Object]
Extra functions
Hosts and Roles
Hosts and roles ,[object Object]
Config without hosts and roles test: - module: HTTP config: host: www0.mizzy.org - module: HTTP config: host: www1.mizzy.org
Config with hosts and roles test: - module: HTTP role: web hosts: web: - www0.mizzy.org - www1.mizzy.org
Filter
Filter ,[object Object],[object Object]
Filter on format phase ,[object Object],format: - module: Text filter: module:  Status status:  ok
Filter on notify phase ,[object Object],notify: - module: IRC filter: module:  Status status:  not ok
Filter on publish phase ,[object Object],format: - module: Text - module: HTML pusblish: - module: Term filter: module:  Type type:  text/plain - module: Mail filter: module:  Type type:  text/html
Config validation
Config validation ,[object Object],[object Object],[object Object],[object Object]
Mistake on common config test s :  # test is right - module: Test::HTTP  $ ./assurer.pl -c config.yaml Assurer::ConfigLoader [fatal] - [/]  Expected required key  `test‘ - [/tests]  Unexpected key  `tests'  at line 46
Mistake on plugin config test: - module: HTTP config: content s : XXX  # content is right $ ./assurer.pl -c config.yaml Assurer::ConfigLoader [fatal] Config error in  Test::HTTP - [/contents]  Unexpected key  `contents'  at line 66
Shell mode
Shell mode ,[object Object]
Shell mode $ ./assurer.pl --shell assurer>   uptime [www.mizzy.org]  21:48:24 up 5 days, 23:08, 2 users, load average: 0.24, 0.16, 0.17 [svn.mizzy.org]  21:48:24 up 5 days, 23:08, 2 users, load average: 0.24, 0.16, 0.17 [ftp.mizzy.org]  21:48:24 up 5 days, 23:08, 2 users, load average: 0.24, 0.16, 0.17
Exec on hosts belong to specified role $ ./assurer.pl --shell  --role=web assurer>   uptime [www.mizzy.org]  21:48:24 up 5 days, 23:08, 2 users, load average: 0.24, 0.16, 0.17
Special command !on assurer>   !on   app1.foo.com    app2.foo.com   do  uptime # Exec on app1.foo.com and app2.foo.com only assurer>   !on   /.*foocom/   do   uptime # Exec on hosts matched .*foocom only
Special command !with assurer>   !with   web db   do  uptime # exec on hosts belong to web role and db role assurer>   !with   /web|mail/   do  uptime # exec on hosts belong to role match web or mail
Special command !test assurer>   !test  HTTP Assurer::Plugin::Test::HTTP [info] Testing HTTP on www0.mizzy.org ...  ok 1 - HTTP status code of http://mizzy.org:80 is 200 not ok 2 – Content of http://mizzy.org:80 matches 'It works!‘ assurer>
Special command !test assurer>   !test  HTTP  on  app1.foo.com  # test http on app1.foo.com assurer>   !test  HTTP  on  /.*.foo.com/  # can use regexp assurer>   !test  HTTP  with  web  # test http on hosts belong to web role assurer>   !test  HTTP  with  /web|mail/ # can use regexp
Parallel testing
Pallarel testing ,[object Object],[object Object],[object Object],$ assurer.pl  --para=20
Distributed testing
Distributed testing localhost test0.mizzy.org www0.mizzy.org www1.mizzy.org www2.mizzy.org test1.mizzy.org test2.mizzy.org 1. ssh assurer_test.pl 3. Return result 2. Exec test
Config for distributed testing exec_on: -  host:  test0.mizzy.org priority:  3 -  host:  test1.mizzy.org priority:  2  -  host:  test2.mizzy.org priority:  1
Auto config generation
Auto config generation ,[object Object],[object Object],[object Object],# assurer.pl  --discover   -c template.yaml
Integragte Test::WWW::Mechanize
Integrate Test::WWW::Mechanize ,[object Object],[object Object],[object Object]
asset file for Test::WWW::Mechanize # $host and $mech are set by Assure core $mech ->get_ok("http:// $host ", "got htttp:// $host "); $mech ->content_contains('It works!', "Content matches 'It works!'");
Inside Assurer
Assurer::Test module
Assurer::Test module ,[object Object],[object Object],[object Object]
Inside test plugins
Inside test plugins package Assurer::Plugin::Test::HTTP; use base qw( Assurer::Plugin::Test ); use Assurer::Test; sub register { my $self = shift; $self->register_tests( qw/  status  content server / ); } sub status { my ( $self, $context, $args ) = @_; ...  中略 is( $res->code, '200', 'HTTP status code of $self->{url} is 200' ); }
Internal mechanism in test phase
Internal mechanism in test phase assurer.pl Assurer::bootstrap() Assurer::Dispatch::run() call exec directly or  by ssh exec tests return test results call generate result objects next phase assurer_test.pl assurer_test.pl assurer_test.pl assurer_test.pl assurer_test.pl Assurer::Result Assurer::Result Assurer::Result Assurer::Result Assurer::Result
Assurer::Dispatch::run() ,[object Object],[object Object],[object Object],[object Object]
assurer_test.pl assurer_test.pl   -– config = LS0tCmNvbmZpZzoKICBjb250ZW50OiBJ dCB3b3JrcyEKICBob3N0OiB3d3cubWl6enkub3JnCm1vZHVsZTogSFRUUApuYW1lOiBIVFRQIHRlc3QKcm9sZTogd2ViCg== - - context =LS0tICEhcGVybC9oYXNoOkFzc3VyZXIKYmFzZV9kaXI6IC9 ob21lL21peWEvc3ZrL0Fzc3VyZXIKY29uZmlnOgogIGZvcm1hdDoKICAgIC0gY29uZmlnOiAmMSB7fQogICAgICBtb2R1bGU6IFRleHQKICBnbG9iYWw6CiAgICBob3N0OiB+CiAgICBpbnRlcnZhbDogMwogICAgbG9nOgogICAgICBsZXZlbDogZGVidWcKICAgIG5vX2RpYWc6IDAKICAgIHJldHJ5OiAzCiAgaG9zdHM6CiAgICBmdHA6CiAgICAgIC0gZnRwLm1penp5Lm9yZwogICAgc3ZuOgogICAgICAtIHN2bi5taXp6eS5vcmcKICAgIHdlYjoKICAgICAgLSB3d3cubWl6enkub3JnCiAgICAgIC0gc3ZuLm1penp5Lm9yZwogICAgICAtIHRyYWMubWl6enkub3JnCiAgbm90aWZ5OgogICAgLSBjb25maWc6CiAgICAgICAgYW5ub3VuY2U6IG5vdGljZQogICAgICAgIGNoYXJzZXQ6IGlzby0yMDIyLWpwCiAgICAgICAgZGFlbW9uX3BvcnQ6IDk5OTEKICAgICAgICBuaWNrbmFtZTogYXNzdXJlcmJvdAog  ... cont ...
Why POE::Wheel::Run ? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Roadmap
Roadmap ,[object Object],[object Object],[object Object],[object Object],[object Object]
Web site and IRC channels
Web sites and IRC channels ,[object Object],[object Object],[object Object],[object Object]
Thanks

More Related Content

What's hot

Design patterns as power of programing
Design patterns as power of programingDesign patterns as power of programing
Design patterns as power of programing
Lukas Lesniewski
 
Ruby HTTP clients comparison
Ruby HTTP clients comparisonRuby HTTP clients comparison
Ruby HTTP clients comparison
Hiroshi Nakamura
 

What's hot (20)

Design patterns as power of programing
Design patterns as power of programingDesign patterns as power of programing
Design patterns as power of programing
 
"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy
 
Ruby HTTP clients comparison
Ruby HTTP clients comparisonRuby HTTP clients comparison
Ruby HTTP clients comparison
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with Capistrano
 
Implement server push in flask framework
Implement server push in flask frameworkImplement server push in flask framework
Implement server push in flask framework
 
Designing net-aws-glacier
Designing net-aws-glacierDesigning net-aws-glacier
Designing net-aws-glacier
 
Capistrano - automate all the things
Capistrano - automate all the thingsCapistrano - automate all the things
Capistrano - automate all the things
 
Capistrano
CapistranoCapistrano
Capistrano
 
Effective Benchmarks
Effective BenchmarksEffective Benchmarks
Effective Benchmarks
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 
Getting testy with Perl
Getting testy with PerlGetting testy with Perl
Getting testy with Perl
 
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018) Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
PowerShell: Automation for everyone
PowerShell: Automation for everyonePowerShell: Automation for everyone
PowerShell: Automation for everyone
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of Python
 
Perl web app 테스트전략
Perl web app 테스트전략Perl web app 테스트전략
Perl web app 테스트전략
 
Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)
 
Ruby HTTP clients
Ruby HTTP clientsRuby HTTP clients
Ruby HTTP clients
 
Asynchronous programming done right - Node.js
Asynchronous programming done right - Node.jsAsynchronous programming done right - Node.js
Asynchronous programming done right - Node.js
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python Meetup
 

Viewers also liked

Viewers also liked (6)

Server specのご紹介
Server specのご紹介Server specのご紹介
Server specのご紹介
 
Serverspecの本気をみるのです
Serverspecの本気をみるのですServerspecの本気をみるのです
Serverspecの本気をみるのです
 
serverspecでサーバ環境のテストを書いてみよう
serverspecでサーバ環境のテストを書いてみようserverspecでサーバ環境のテストを書いてみよう
serverspecでサーバ環境のテストを書いてみよう
 
Serverspecを自分好みにアレンジ スクリーンショットで証跡保存を撲滅-
Serverspecを自分好みにアレンジ スクリーンショットで証跡保存を撲滅- Serverspecを自分好みにアレンジ スクリーンショットで証跡保存を撲滅-
Serverspecを自分好みにアレンジ スクリーンショットで証跡保存を撲滅-
 
Serverspecの活用tips紹介
Serverspecの活用tips紹介Serverspecの活用tips紹介
Serverspecの活用tips紹介
 
Serverspecを使ってサーバ5000台のBaculaクライアントをテスト
Serverspecを使ってサーバ5000台のBaculaクライアントをテストServerspecを使ってサーバ5000台のBaculaクライアントをテスト
Serverspecを使ってサーバ5000台のBaculaクライアントをテスト
 

Similar to Assurer - a pluggable server testing/monitoring framework

Similar to Assurer - a pluggable server testing/monitoring framework (20)

Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Performance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-MechanizePerformance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-Mechanize
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile Devices
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 
Revoke-Obfuscation
Revoke-ObfuscationRevoke-Obfuscation
Revoke-Obfuscation
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentation
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
Unit Testing from Setup to Deployment
Unit Testing from Setup to DeploymentUnit Testing from Setup to Deployment
Unit Testing from Setup to Deployment
 
Beyond AEM Curl Commands
Beyond AEM Curl CommandsBeyond AEM Curl Commands
Beyond AEM Curl Commands
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
 

More from Gosuke Miyashita

Serverspec at July Tech Festa 2013
Serverspec at July Tech Festa 2013Serverspec at July Tech Festa 2013
Serverspec at July Tech Festa 2013
Gosuke Miyashita
 
NoSQLに関するまとめ
NoSQLに関するまとめNoSQLに関するまとめ
NoSQLに関するまとめ
Gosuke Miyashita
 
Maglica - A Simple Internal Cloud Tool at #techkayac
Maglica - A Simple Internal Cloud Tool at #techkayacMaglica - A Simple Internal Cloud Tool at #techkayac
Maglica - A Simple Internal Cloud Tool at #techkayac
Gosuke Miyashita
 
Inside Sqale's Backend at RubyConf Taiwan 2012
Inside Sqale's Backend at RubyConf Taiwan 2012Inside Sqale's Backend at RubyConf Taiwan 2012
Inside Sqale's Backend at RubyConf Taiwan 2012
Gosuke Miyashita
 
Ia型超新星とチャンドラセカール限界
Ia型超新星とチャンドラセカール限界Ia型超新星とチャンドラセカール限界
Ia型超新星とチャンドラセカール限界
Gosuke Miyashita
 
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at YAPC::Asia Tokyo 2012Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Gosuke Miyashita
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Gosuke Miyashita
 
Open Source System Administration Framework - Func
Open Source System Administration Framework - FuncOpen Source System Administration Framework - Func
Open Source System Administration Framework - Func
Gosuke Miyashita
 
Puppet Best Practices? at COOKPAD
Puppet Best Practices? at COOKPADPuppet Best Practices? at COOKPAD
Puppet Best Practices? at COOKPAD
Gosuke Miyashita
 
How Danga::Socket handles asynchronous processing and how to write asynchrono...
How Danga::Socket handles asynchronous processing and how to write asynchrono...How Danga::Socket handles asynchronous processing and how to write asynchrono...
How Danga::Socket handles asynchronous processing and how to write asynchrono...
Gosuke Miyashita
 
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Gosuke Miyashita
 

More from Gosuke Miyashita (20)

Walter ファミリーの紹介 at Shibuya.go#1
Walter ファミリーの紹介 at Shibuya.go#1Walter ファミリーの紹介 at Shibuya.go#1
Walter ファミリーの紹介 at Shibuya.go#1
 
Serverspec at Testing Framework Meeting
Serverspec at Testing Framework MeetingServerspec at Testing Framework Meeting
Serverspec at Testing Framework Meeting
 
Serverspec at July Tech Festa 2013
Serverspec at July Tech Festa 2013Serverspec at July Tech Festa 2013
Serverspec at July Tech Festa 2013
 
Serverspec at hbstudy #45
Serverspec at hbstudy #45Serverspec at hbstudy #45
Serverspec at hbstudy #45
 
NoSQLに関するまとめ
NoSQLに関するまとめNoSQLに関するまとめ
NoSQLに関するまとめ
 
イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化
 
Maglica - A Simple Internal Cloud Tool at #techkayac
Maglica - A Simple Internal Cloud Tool at #techkayacMaglica - A Simple Internal Cloud Tool at #techkayac
Maglica - A Simple Internal Cloud Tool at #techkayac
 
DevOps とは何か 何であるべきか
DevOps とは何か 何であるべきかDevOps とは何か 何であるべきか
DevOps とは何か 何であるべきか
 
Inside Sqale's Backend at RubyConf Taiwan 2012
Inside Sqale's Backend at RubyConf Taiwan 2012Inside Sqale's Backend at RubyConf Taiwan 2012
Inside Sqale's Backend at RubyConf Taiwan 2012
 
Ia型超新星とチャンドラセカール限界
Ia型超新星とチャンドラセカール限界Ia型超新星とチャンドラセカール限界
Ia型超新星とチャンドラセカール限界
 
How Perl Changed My Life
How Perl Changed My LifeHow Perl Changed My Life
How Perl Changed My Life
 
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at YAPC::Asia Tokyo 2012Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
 
Open Source System Administration Framework - Func
Open Source System Administration Framework - FuncOpen Source System Administration Framework - Func
Open Source System Administration Framework - Func
 
10分でわかるDevOps
10分でわかるDevOps10分でわかるDevOps
10分でわかるDevOps
 
DevOpsって何?
DevOpsって何?DevOpsって何?
DevOpsって何?
 
Puppetのススメ
PuppetのススメPuppetのススメ
Puppetのススメ
 
Puppet Best Practices? at COOKPAD
Puppet Best Practices? at COOKPADPuppet Best Practices? at COOKPAD
Puppet Best Practices? at COOKPAD
 
How Danga::Socket handles asynchronous processing and how to write asynchrono...
How Danga::Socket handles asynchronous processing and how to write asynchrono...How Danga::Socket handles asynchronous processing and how to write asynchrono...
How Danga::Socket handles asynchronous processing and how to write asynchrono...
 
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Assurer - a pluggable server testing/monitoring framework

  • 1. Assurer – A server testing/monitoring framework Gosuke Miyashita http://mizzy.org/
  • 2.
  • 3.  
  • 4.
  • 5.
  • 6. Image of exec Assurer #0
  • 7. Image of exec Assurer #1
  • 8. Image of Asura Baster
  • 9. Image of the real Asura
  • 10. Image of fake Asura
  • 12.
  • 13. Relation of each phases Test Publish Format Nofity
  • 14. Details of each phases
  • 16.
  • 17.
  • 19.
  • 20.
  • 23.
  • 24.
  • 26.
  • 27.
  • 31.
  • 34.
  • 35. Config without hosts and roles test: - module: HTTP config: host: www0.mizzy.org - module: HTTP config: host: www1.mizzy.org
  • 36. Config with hosts and roles test: - module: HTTP role: web hosts: web: - www0.mizzy.org - www1.mizzy.org
  • 38.
  • 39.
  • 40.
  • 41.
  • 43.
  • 44. Mistake on common config test s : # test is right - module: Test::HTTP $ ./assurer.pl -c config.yaml Assurer::ConfigLoader [fatal] - [/] Expected required key `test‘ - [/tests] Unexpected key `tests' at line 46
  • 45. Mistake on plugin config test: - module: HTTP config: content s : XXX # content is right $ ./assurer.pl -c config.yaml Assurer::ConfigLoader [fatal] Config error in Test::HTTP - [/contents] Unexpected key `contents' at line 66
  • 47.
  • 48. Shell mode $ ./assurer.pl --shell assurer> uptime [www.mizzy.org] 21:48:24 up 5 days, 23:08, 2 users, load average: 0.24, 0.16, 0.17 [svn.mizzy.org] 21:48:24 up 5 days, 23:08, 2 users, load average: 0.24, 0.16, 0.17 [ftp.mizzy.org] 21:48:24 up 5 days, 23:08, 2 users, load average: 0.24, 0.16, 0.17
  • 49. Exec on hosts belong to specified role $ ./assurer.pl --shell --role=web assurer> uptime [www.mizzy.org] 21:48:24 up 5 days, 23:08, 2 users, load average: 0.24, 0.16, 0.17
  • 50. Special command !on assurer> !on app1.foo.com app2.foo.com do uptime # Exec on app1.foo.com and app2.foo.com only assurer> !on /.*foocom/ do uptime # Exec on hosts matched .*foocom only
  • 51. Special command !with assurer> !with web db do uptime # exec on hosts belong to web role and db role assurer> !with /web|mail/ do uptime # exec on hosts belong to role match web or mail
  • 52. Special command !test assurer> !test HTTP Assurer::Plugin::Test::HTTP [info] Testing HTTP on www0.mizzy.org ... ok 1 - HTTP status code of http://mizzy.org:80 is 200 not ok 2 – Content of http://mizzy.org:80 matches 'It works!‘ assurer>
  • 53. Special command !test assurer> !test HTTP on app1.foo.com # test http on app1.foo.com assurer> !test HTTP on /.*.foo.com/ # can use regexp assurer> !test HTTP with web # test http on hosts belong to web role assurer> !test HTTP with /web|mail/ # can use regexp
  • 55.
  • 57. Distributed testing localhost test0.mizzy.org www0.mizzy.org www1.mizzy.org www2.mizzy.org test1.mizzy.org test2.mizzy.org 1. ssh assurer_test.pl 3. Return result 2. Exec test
  • 58. Config for distributed testing exec_on: - host: test0.mizzy.org priority: 3 - host: test1.mizzy.org priority: 2 - host: test2.mizzy.org priority: 1
  • 60.
  • 62.
  • 63. asset file for Test::WWW::Mechanize # $host and $mech are set by Assure core $mech ->get_ok("http:// $host ", "got htttp:// $host "); $mech ->content_contains('It works!', "Content matches 'It works!'");
  • 66.
  • 68. Inside test plugins package Assurer::Plugin::Test::HTTP; use base qw( Assurer::Plugin::Test ); use Assurer::Test; sub register { my $self = shift; $self->register_tests( qw/ status content server / ); } sub status { my ( $self, $context, $args ) = @_; ... 中略 is( $res->code, '200', 'HTTP status code of $self->{url} is 200' ); }
  • 69. Internal mechanism in test phase
  • 70. Internal mechanism in test phase assurer.pl Assurer::bootstrap() Assurer::Dispatch::run() call exec directly or by ssh exec tests return test results call generate result objects next phase assurer_test.pl assurer_test.pl assurer_test.pl assurer_test.pl assurer_test.pl Assurer::Result Assurer::Result Assurer::Result Assurer::Result Assurer::Result
  • 71.
  • 72. assurer_test.pl assurer_test.pl -– config = LS0tCmNvbmZpZzoKICBjb250ZW50OiBJ dCB3b3JrcyEKICBob3N0OiB3d3cubWl6enkub3JnCm1vZHVsZTogSFRUUApuYW1lOiBIVFRQIHRlc3QKcm9sZTogd2ViCg== - - context =LS0tICEhcGVybC9oYXNoOkFzc3VyZXIKYmFzZV9kaXI6IC9 ob21lL21peWEvc3ZrL0Fzc3VyZXIKY29uZmlnOgogIGZvcm1hdDoKICAgIC0gY29uZmlnOiAmMSB7fQogICAgICBtb2R1bGU6IFRleHQKICBnbG9iYWw6CiAgICBob3N0OiB+CiAgICBpbnRlcnZhbDogMwogICAgbG9nOgogICAgICBsZXZlbDogZGVidWcKICAgIG5vX2RpYWc6IDAKICAgIHJldHJ5OiAzCiAgaG9zdHM6CiAgICBmdHA6CiAgICAgIC0gZnRwLm1penp5Lm9yZwogICAgc3ZuOgogICAgICAtIHN2bi5taXp6eS5vcmcKICAgIHdlYjoKICAgICAgLSB3d3cubWl6enkub3JnCiAgICAgIC0gc3ZuLm1penp5Lm9yZwogICAgICAtIHRyYWMubWl6enkub3JnCiAgbm90aWZ5OgogICAgLSBjb25maWc6CiAgICAgICAgYW5ub3VuY2U6IG5vdGljZQogICAgICAgIGNoYXJzZXQ6IGlzby0yMDIyLWpwCiAgICAgICAgZGFlbW9uX3BvcnQ6IDk5OTEKICAgICAgICBuaWNrbmFtZTogYXNzdXJlcmJvdAog ... cont ...
  • 73.
  • 75.
  • 76. Web site and IRC channels
  • 77.