SlideShare a Scribd company logo
1 of 20
Download to read offline
CQ5
HealthCheck
Automated self-testing
and health check
of live CQ instances
Bertrand Delacrétaz
Senior R&D Developer, Adobe Basel
@bdelacretaz, grep.codeconsult.ch
CQCon, Basel, June 2013
slides revision 2013-06-17
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
picture: anitapeppers on morguefile.com
Themore
configurable,the
morebreakable....let's
testitlive!
Agile software
needs
TESTING
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Apache Sling Health Check
Webconsole plugin
Rules configured in content
Tagged rules
Webconsole and servlets
RuleBuilder OSGi services
ApacheSling
module,runsin
CQ5.5and
later
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
JSON output selectors map to tags
no news (log) is good news!
Rule uses a Logger to complain
rule 1
rule 2
rules
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Rule defined in content
$ curl -u admin:admin
http://localhost:4502/apps/hc/demo/inactive-bundles.tidy.json
{
"sling:resourceType": "sling/healthcheck/rules",
"namespace": "osgi",
"ruleName": "inactive.bundles.count",
"expression": "<= 3",
"tags": [
"bundles",
"osgi",
"sling"
],
"jcr:primaryType": "nt:unstructured"
}
Execute the osgi:inactive.bundles.count rule
and verify that its output is <= 3
The rules engine executes a tree of such definitions, optionally taking tags into account.
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
HTTP rule execution
$ curl -u admin:admin
http://localhost:4502/apps/hc/demo/inactive-bundles.healthcheck.json
{
"results": [{
"rule": "Rule: InactiveBundlesCount <= 3",
"info": [{
"sling.resource.path": "/apps/hc/demo/inactive-bundles"
}
],
"tags": [
"sling",
"bundles",
"osgi"
]
}
]
}
Rule path with .healthcheck selector
Works with single rules or trees
no news (log) is good news!
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Rule scripts
$ curl -u admin:admin
http://localhost:4502/apps/hc/demo/script-that-passes.esp
# A rule script must output only TEST_PASSED,
# comments like this one and white space.
# Anything else is considered failure
#(as with the Sling testing tools)
TEST_PASSED
Currently executable only from a
sling/healthcheck/rules container resource.
#thesky
isthelimit
outof the
box
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Out of the box rulesas of revision 1490454
JMX
beans attributes
jmxbeans:
org.apache.sling:
type=engine,
service=RequestProcessor
RequestsCount < 20
JUnit
tests
junit:
org.apache.sling.hc.demo.tests.ResourcesExistTest
(can use @TestReference for services)
OSGi
bundle
state
osgi:
bundle.state
org.apache.sling.startupfilter.disabler
= active
OSGi
inactive
bundles
osgi:
inactive.bundles.count < 3
Sling default
logins fail
sling:
loginfails
admin#admin
picture:mconnorsonmorguefile.com
Sling
scripts
/apps/hc/demo/somescript.esp
BYOR!
extensibili t y
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Rule evaluates a SystemAttribute
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
RuleBuilder service builds Rules
check namespace
map ruleName to
SystemAttribute
build Rule
test:constant:5 = 5
namespace:ruleName:qualifier expr
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
DefaultEvaluator expressionscan use custom Evaluator as well
“Some string”
< 5
> 5
<= 5
>= 5
between 5 and 12
public interface Evaluator {
void evaluate(
SystemAttribute a,
String expression,
Logger logger);
}
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Extensibility summary
Implement a SystemAttribute
getValue(Logger)
Register a RuleBuilder service
check names
build SystemAttribute + Rule
That’s it.
(optionally supply custom Evaluator)
similar
ideas
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Joerg Hoh’s cq5-healthcheck
https://github.com/joerghoh/cq5-healthcheck
PID = de.joerghoh.cq5.healthcheck.MBeanStatusProvider.b9cb0c91-972b
mbean.name = com.adobe.granite.replication:type=agent,id="publish"
mbean.property = QueueNumEntries.warn.>.100
mbean.providerHint = Warn Queue length
MBean attribute value
ranges or custom
StatusProvider services
CQ:Page for status
Based on OSGi configs:
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Davide Giannella’s sanitycheck
Adobe Internal github for now: dgiannel/sanitycheck
Servlets as sanity
check services.
CQ page components
for options, forms.
Checks remote CQ
instances via HTTP.
CQ pages to assemble
sanity check pages.
future
CQ5
HealthCheck
Future?
Implement CQ security checklist rules
Execute rules via JMX?
Scheduling of rules execution + reporting
Scheduling and time-based range checks, sampling
periods (thx Radu Cotescu)
Whatareyour
usecases?
Execute rules tagged “startup” at startup
and report or lock instance if WARN.
http://sling.apache.org/documentation/bundles/sling-health-check-tool.html
I’m @bdelacretaz - thanks for attending!
<YOUR IDEA HERE> or on the Apache Sling mailing lists

More Related Content

What's hot

Unit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSUnit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSKnoldus Inc.
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmineTimothy Oxley
 
Testing javascript in the frontend
Testing javascript in the frontendTesting javascript in the frontend
Testing javascript in the frontendFrederic CABASSUT
 
Sergey Puzankov "How to see a bug the size of 1px"
Sergey Puzankov "How to see a bug the size of 1px"Sergey Puzankov "How to see a bug the size of 1px"
Sergey Puzankov "How to see a bug the size of 1px"Fwdays
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaUnit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaAndrey Kolodnitsky
 
Java Microservices with DropWizard
Java Microservices with DropWizardJava Microservices with DropWizard
Java Microservices with DropWizardBruno Buger
 
AngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and JasmineAngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and Jasminefoxp2code
 
Testing JS with Jasmine
Testing JS with JasmineTesting JS with Jasmine
Testing JS with JasmineEvgeny Gurin
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Anton Arhipov
 
Testing the Grails Spring Security Plugins
Testing the Grails Spring Security PluginsTesting the Grails Spring Security Plugins
Testing the Grails Spring Security PluginsBurt Beckwith
 
Alfresco study presentation 38th customize How-To WebDAV
Alfresco study presentation 38th customize How-To WebDAVAlfresco study presentation 38th customize How-To WebDAV
Alfresco study presentation 38th customize How-To WebDAVTakeshi Totani
 
Azure arm template ia c security
Azure arm template ia c securityAzure arm template ia c security
Azure arm template ia c securityPrancer Io
 
Practical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectivePractical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectiveRajniHatti
 
It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016Przemek Jakubczyk
 
Intro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJSIntro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJSJim Lynch
 
Testing React Applications
Testing React ApplicationsTesting React Applications
Testing React Applicationsstbaechler
 
Mozilla Web QA - Evolution of our Python WebDriver framework
Mozilla Web QA - Evolution of our Python WebDriver frameworkMozilla Web QA - Evolution of our Python WebDriver framework
Mozilla Web QA - Evolution of our Python WebDriver frameworkdavehunt82
 

What's hot (20)

Unit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSUnit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJS
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
 
Testing javascript in the frontend
Testing javascript in the frontendTesting javascript in the frontend
Testing javascript in the frontend
 
Sergey Puzankov "How to see a bug the size of 1px"
Sergey Puzankov "How to see a bug the size of 1px"Sergey Puzankov "How to see a bug the size of 1px"
Sergey Puzankov "How to see a bug the size of 1px"
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaUnit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and Karma
 
Java Microservices with DropWizard
Java Microservices with DropWizardJava Microservices with DropWizard
Java Microservices with DropWizard
 
Jasmine BDD for Javascript
Jasmine BDD for JavascriptJasmine BDD for Javascript
Jasmine BDD for Javascript
 
AngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and JasmineAngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and Jasmine
 
Testing JS with Jasmine
Testing JS with JasmineTesting JS with Jasmine
Testing JS with Jasmine
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
 
Testing the Grails Spring Security Plugins
Testing the Grails Spring Security PluginsTesting the Grails Spring Security Plugins
Testing the Grails Spring Security Plugins
 
Alfresco study presentation 38th customize How-To WebDAV
Alfresco study presentation 38th customize How-To WebDAVAlfresco study presentation 38th customize How-To WebDAV
Alfresco study presentation 38th customize How-To WebDAV
 
PL/SQL Unit Testing Can Be Fun
PL/SQL Unit Testing Can Be FunPL/SQL Unit Testing Can Be Fun
PL/SQL Unit Testing Can Be Fun
 
Build r
Build rBuild r
Build r
 
Azure arm template ia c security
Azure arm template ia c securityAzure arm template ia c security
Azure arm template ia c security
 
Practical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectivePractical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's Perspective
 
It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016
 
Intro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJSIntro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJS
 
Testing React Applications
Testing React ApplicationsTesting React Applications
Testing React Applications
 
Mozilla Web QA - Evolution of our Python WebDriver framework
Mozilla Web QA - Evolution of our Python WebDriver frameworkMozilla Web QA - Evolution of our Python WebDriver framework
Mozilla Web QA - Evolution of our Python WebDriver framework
 

Viewers also liked

Parceria Para A Inovacao
Parceria Para A InovacaoParceria Para A Inovacao
Parceria Para A Inovacaominasinvest
 
Aqsanews44
Aqsanews44Aqsanews44
Aqsanews44Al-Quds
 
Mf Group Rev03
Mf Group Rev03Mf Group Rev03
Mf Group Rev03usagus
 
Social Media Measurement
Social Media MeasurementSocial Media Measurement
Social Media MeasurementLars Bredahl
 
Tuulimittaukset ja tuotannon ennustaminen, YRJ-Technology, Rejlersin Tuulivo...
 Tuulimittaukset ja tuotannon ennustaminen, YRJ-Technology, Rejlersin Tuulivo... Tuulimittaukset ja tuotannon ennustaminen, YRJ-Technology, Rejlersin Tuulivo...
Tuulimittaukset ja tuotannon ennustaminen, YRJ-Technology, Rejlersin Tuulivo...Marja Konsti
 

Viewers also liked (6)

Parceria Para A Inovacao
Parceria Para A InovacaoParceria Para A Inovacao
Parceria Para A Inovacao
 
Aqsanews44
Aqsanews44Aqsanews44
Aqsanews44
 
Comunicação
ComunicaçãoComunicação
Comunicação
 
Mf Group Rev03
Mf Group Rev03Mf Group Rev03
Mf Group Rev03
 
Social Media Measurement
Social Media MeasurementSocial Media Measurement
Social Media Measurement
 
Tuulimittaukset ja tuotannon ennustaminen, YRJ-Technology, Rejlersin Tuulivo...
 Tuulimittaukset ja tuotannon ennustaminen, YRJ-Technology, Rejlersin Tuulivo... Tuulimittaukset ja tuotannon ennustaminen, YRJ-Technology, Rejlersin Tuulivo...
Tuulimittaukset ja tuotannon ennustaminen, YRJ-Technology, Rejlersin Tuulivo...
 

Similar to Auto-testing production CQ instances with Muppet

Spring batch for large enterprises operations
Spring batch for large enterprises operations Spring batch for large enterprises operations
Spring batch for large enterprises operations Ignasi González
 
Why so continuous
Why so continuousWhy so continuous
Why so continuousMax Lobur
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9Ivan Krylov
 
Test automation introduction training at Polteq
Test automation   introduction training at PolteqTest automation   introduction training at Polteq
Test automation introduction training at PolteqMartijn de Vrieze
 
WebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsWebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsChris Bailey
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Matt Fuller
 
Continuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsContinuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsEvgeniy Kuzmin
 
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...apidays
 
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...Andrea Dottor
 
Unit testing with Spock Framework
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock FrameworkEugene Dvorkin
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravelConfiz
 
Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeCybera Inc.
 
Automated DevOps Workflows with Chef on AWS
Automated DevOps Workflows with Chef on AWSAutomated DevOps Workflows with Chef on AWS
Automated DevOps Workflows with Chef on AWSAmazon Web Services
 
Continuous integration / continuous delivery
Continuous integration / continuous deliveryContinuous integration / continuous delivery
Continuous integration / continuous deliveryEatDog
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?Srijan Technologies
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Ontico
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIAndrey Karpov
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Elixir Club
 

Similar to Auto-testing production CQ instances with Muppet (20)

Spring batch for large enterprises operations
Spring batch for large enterprises operations Spring batch for large enterprises operations
Spring batch for large enterprises operations
 
Why so continuous
Why so continuousWhy so continuous
Why so continuous
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
 
Test automation introduction training at Polteq
Test automation   introduction training at PolteqTest automation   introduction training at Polteq
Test automation introduction training at Polteq
 
WebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsWebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic Tools
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
 
Maximizing Oracle RAC Uptime
Maximizing Oracle RAC UptimeMaximizing Oracle RAC Uptime
Maximizing Oracle RAC Uptime
 
Continuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsContinuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applications
 
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
 
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
 
Unit testing with Spock Framework
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock Framework
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravel
 
Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as Code
 
Automated DevOps Workflows with Chef on AWS
Automated DevOps Workflows with Chef on AWSAutomated DevOps Workflows with Chef on AWS
Automated DevOps Workflows with Chef on AWS
 
Continuous integration / continuous delivery
Continuous integration / continuous deliveryContinuous integration / continuous delivery
Continuous integration / continuous delivery
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCI
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
 

More from connectwebex

Jackrabbit OCM in practice
Jackrabbit OCM in practiceJackrabbit OCM in practice
Jackrabbit OCM in practiceconnectwebex
 
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience ManagerBuilding Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Managerconnectwebex
 
AEM 6 DAM - Integrations, Integrations, Integrations
AEM 6 DAM - Integrations, Integrations, IntegrationsAEM 6 DAM - Integrations, Integrations, Integrations
AEM 6 DAM - Integrations, Integrations, Integrationsconnectwebex
 
JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?connectwebex
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMconnectwebex
 
Presentation daniel takai
Presentation daniel takaiPresentation daniel takai
Presentation daniel takaiconnectwebex
 
Presentation thomas simlinger
Presentation thomas simlingerPresentation thomas simlinger
Presentation thomas simlingerconnectwebex
 
five Sling features you should know
five Sling features you should knowfive Sling features you should know
five Sling features you should knowconnectwebex
 
Efficient content structures and queries in CRX/CQ
Efficient content structures and queries in CRX/CQEfficient content structures and queries in CRX/CQ
Efficient content structures and queries in CRX/CQconnectwebex
 
Web, Mobile, App and Back!
Web, Mobile, App and Back!Web, Mobile, App and Back!
Web, Mobile, App and Back!connectwebex
 
Tighten your Security and Privacy
Tighten your Security and PrivacyTighten your Security and Privacy
Tighten your Security and Privacyconnectwebex
 
THE BREAK-UP - A user interface love story
THE BREAK-UP - A user interface love storyTHE BREAK-UP - A user interface love story
THE BREAK-UP - A user interface love storyconnectwebex
 
Configuring CQ Security
Configuring CQ SecurityConfiguring CQ Security
Configuring CQ Securityconnectwebex
 
Integration Testing in AEM
Integration Testing in AEMIntegration Testing in AEM
Integration Testing in AEMconnectwebex
 
Sling Component Filters in CQ5
Sling Component Filters in CQ5 Sling Component Filters in CQ5
Sling Component Filters in CQ5 connectwebex
 
Integrating Backend Systems
Integrating Backend SystemsIntegrating Backend Systems
Integrating Backend Systemsconnectwebex
 

More from connectwebex (19)

Jackrabbit OCM in practice
Jackrabbit OCM in practiceJackrabbit OCM in practice
Jackrabbit OCM in practice
 
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience ManagerBuilding Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Manager
 
AEM 6 DAM - Integrations, Integrations, Integrations
AEM 6 DAM - Integrations, Integrations, IntegrationsAEM 6 DAM - Integrations, Integrations, Integrations
AEM 6 DAM - Integrations, Integrations, Integrations
 
JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
 
SonarQube for AEM
SonarQube for AEMSonarQube for AEM
SonarQube for AEM
 
Presentation daniel takai
Presentation daniel takaiPresentation daniel takai
Presentation daniel takai
 
Presentation thomas simlinger
Presentation thomas simlingerPresentation thomas simlinger
Presentation thomas simlinger
 
five Sling features you should know
five Sling features you should knowfive Sling features you should know
five Sling features you should know
 
Efficient content structures and queries in CRX/CQ
Efficient content structures and queries in CRX/CQEfficient content structures and queries in CRX/CQ
Efficient content structures and queries in CRX/CQ
 
Web, Mobile, App and Back!
Web, Mobile, App and Back!Web, Mobile, App and Back!
Web, Mobile, App and Back!
 
Tighten your Security and Privacy
Tighten your Security and PrivacyTighten your Security and Privacy
Tighten your Security and Privacy
 
THE BREAK-UP - A user interface love story
THE BREAK-UP - A user interface love storyTHE BREAK-UP - A user interface love story
THE BREAK-UP - A user interface love story
 
Configuring CQ Security
Configuring CQ SecurityConfiguring CQ Security
Configuring CQ Security
 
Integration Testing in AEM
Integration Testing in AEMIntegration Testing in AEM
Integration Testing in AEM
 
Sling Component Filters in CQ5
Sling Component Filters in CQ5 Sling Component Filters in CQ5
Sling Component Filters in CQ5
 
Integrating Backend Systems
Integrating Backend SystemsIntegrating Backend Systems
Integrating Backend Systems
 
Scaling CQ5
Scaling CQ5Scaling CQ5
Scaling CQ5
 
CQ Maven Methods
CQ Maven MethodsCQ Maven Methods
CQ Maven Methods
 

Recently uploaded

How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityEric T. Tung
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMANIlamathiKannappan
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...Paul Menig
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Lviv Startup Club
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxAndy Lambert
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsMichael W. Hawkins
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...rajveerescorts2022
 

Recently uploaded (20)

How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael Hawkins
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 

Auto-testing production CQ instances with Muppet

  • 1. CQ5 HealthCheck Automated self-testing and health check of live CQ instances Bertrand Delacrétaz Senior R&D Developer, Adobe Basel @bdelacretaz, grep.codeconsult.ch CQCon, Basel, June 2013 slides revision 2013-06-17
  • 2. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel picture: anitapeppers on morguefile.com Themore configurable,the morebreakable....let's testitlive! Agile software needs TESTING
  • 3. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Apache Sling Health Check Webconsole plugin Rules configured in content Tagged rules Webconsole and servlets RuleBuilder OSGi services ApacheSling module,runsin CQ5.5and later
  • 4. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel JSON output selectors map to tags no news (log) is good news! Rule uses a Logger to complain rule 1 rule 2
  • 6. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Rule defined in content $ curl -u admin:admin http://localhost:4502/apps/hc/demo/inactive-bundles.tidy.json { "sling:resourceType": "sling/healthcheck/rules", "namespace": "osgi", "ruleName": "inactive.bundles.count", "expression": "<= 3", "tags": [ "bundles", "osgi", "sling" ], "jcr:primaryType": "nt:unstructured" } Execute the osgi:inactive.bundles.count rule and verify that its output is <= 3 The rules engine executes a tree of such definitions, optionally taking tags into account.
  • 7. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel HTTP rule execution $ curl -u admin:admin http://localhost:4502/apps/hc/demo/inactive-bundles.healthcheck.json { "results": [{ "rule": "Rule: InactiveBundlesCount <= 3", "info": [{ "sling.resource.path": "/apps/hc/demo/inactive-bundles" } ], "tags": [ "sling", "bundles", "osgi" ] } ] } Rule path with .healthcheck selector Works with single rules or trees no news (log) is good news!
  • 8. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Rule scripts $ curl -u admin:admin http://localhost:4502/apps/hc/demo/script-that-passes.esp # A rule script must output only TEST_PASSED, # comments like this one and white space. # Anything else is considered failure #(as with the Sling testing tools) TEST_PASSED Currently executable only from a sling/healthcheck/rules container resource. #thesky isthelimit
  • 10. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Out of the box rulesas of revision 1490454 JMX beans attributes jmxbeans: org.apache.sling: type=engine, service=RequestProcessor RequestsCount < 20 JUnit tests junit: org.apache.sling.hc.demo.tests.ResourcesExistTest (can use @TestReference for services) OSGi bundle state osgi: bundle.state org.apache.sling.startupfilter.disabler = active OSGi inactive bundles osgi: inactive.bundles.count < 3 Sling default logins fail sling: loginfails admin#admin picture:mconnorsonmorguefile.com Sling scripts /apps/hc/demo/somescript.esp BYOR!
  • 12. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Rule evaluates a SystemAttribute
  • 13. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel RuleBuilder service builds Rules check namespace map ruleName to SystemAttribute build Rule test:constant:5 = 5 namespace:ruleName:qualifier expr
  • 14. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel DefaultEvaluator expressionscan use custom Evaluator as well “Some string” < 5 > 5 <= 5 >= 5 between 5 and 12 public interface Evaluator { void evaluate( SystemAttribute a, String expression, Logger logger); }
  • 15. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Extensibility summary Implement a SystemAttribute getValue(Logger) Register a RuleBuilder service check names build SystemAttribute + Rule That’s it. (optionally supply custom Evaluator)
  • 17. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Joerg Hoh’s cq5-healthcheck https://github.com/joerghoh/cq5-healthcheck PID = de.joerghoh.cq5.healthcheck.MBeanStatusProvider.b9cb0c91-972b mbean.name = com.adobe.granite.replication:type=agent,id="publish" mbean.property = QueueNumEntries.warn.>.100 mbean.providerHint = Warn Queue length MBean attribute value ranges or custom StatusProvider services CQ:Page for status Based on OSGi configs:
  • 18. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Davide Giannella’s sanitycheck Adobe Internal github for now: dgiannel/sanitycheck Servlets as sanity check services. CQ page components for options, forms. Checks remote CQ instances via HTTP. CQ pages to assemble sanity check pages.
  • 20. CQ5 HealthCheck Future? Implement CQ security checklist rules Execute rules via JMX? Scheduling of rules execution + reporting Scheduling and time-based range checks, sampling periods (thx Radu Cotescu) Whatareyour usecases? Execute rules tagged “startup” at startup and report or lock instance if WARN. http://sling.apache.org/documentation/bundles/sling-health-check-tool.html I’m @bdelacretaz - thanks for attending! <YOUR IDEA HERE> or on the Apache Sling mailing lists