This document provides an introduction to testing Salt states. It discusses why testing is important for infrastructure code and outlines approaches for testing at different levels, from basic syntax checking to integration and acceptance tests. Methods covered include using salt-call to test individual states, writing tests that run in isolated Docker containers to prevent interference, and automating testing with scripts to run multiple permutations and aggregate results. Part 2 will provide code examples for automation and discuss additional testing techniques.
Trust, but verify | Testing with Docker ContainersNan Liu
This presentation will dive into testing with Docker Containers
* Building Docker containers and testing with Serverspec
* Testing Docker Compose with Serverspec
* Taking advantage of Docker sibling containers to run serverspec in a container
* Running large test matrix with Serverspec
* Demonstrate using pry/pry-rescue to debug large test
The lab is available at: https://github.com/nanliu/docker-serverspec
Automated testing on steroids – Trick for managing test data using Docker sna...Lucas Jellema
Automated testing is important. We all know that we should do it. We also know that this can be painful, for many reasons. One of the most agonizing aspects of automated testing is the handling of the data. In order to run even the simplest of tests against the user interface, a service or API or even a PL/SQL unit typically requires that a proper starting point needs to be established in the database with respect to the data. Complex set up steps need to prepare various records to ensure the test can even start and afterwards in similarly complex tear down scripts we have to clean up after the test.
This session demonstrates how this hardship can be a thing of the past. Using snapshots of a test database in a Docker container with a managed test data set that supports all tests, we can create automated tests without any set up or tear down effort. These tests can run very fast, concurrently, and whenever and wherever you like them to run. This way of working opens up much higher test coverage and much increased productivity for developers and testers.
This quickie demonstrates a new approach to [managing the data required for] test automation. Using Docker Containers with databases including a shared test data set and starting a fresh container for each automated test, the individual test cases become much simpler. With this approach, achieving a much higher coverage with automated testing comes within reach. Additionally, tests can be much more sophisticated - as a much richer data set is guaranteed to be available. Developing the test cases is much more productive and much more focused on the actual test, rather than the setup and tear down actions.
Through the use of the experimental checkoint mechanism in Docker, restarting a database can be done in mere seconds.
In this presentation, I covered how I've migrated Android project from old Jenkins (Freestyle jobs, 1st Jenkins instance) to new Jenkins (Multibranch pipeline, 2nd Jenkins instance).
Also, it covers a Jenkins Shared Library usage and integration tests on pipeline code.
At the end, I'm covering pros/cons of final result and what difficulties I faced during migration.
Jenkins is a Continuous Integration (CI) server or tool which is written in Java. It provides Continuous Integration services for software development, which can be started via command line or web application server. Jenkins Pipeline is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins.
Slides from my presentation to the Sydney Jenkins Meetup on Declarative Pipeline. Video of the presentation available at https://www.youtube.com/watch?v=3R5xh4oeDg0&feature=youtu.be
Trust, but verify | Testing with Docker ContainersNan Liu
This presentation will dive into testing with Docker Containers
* Building Docker containers and testing with Serverspec
* Testing Docker Compose with Serverspec
* Taking advantage of Docker sibling containers to run serverspec in a container
* Running large test matrix with Serverspec
* Demonstrate using pry/pry-rescue to debug large test
The lab is available at: https://github.com/nanliu/docker-serverspec
Automated testing on steroids – Trick for managing test data using Docker sna...Lucas Jellema
Automated testing is important. We all know that we should do it. We also know that this can be painful, for many reasons. One of the most agonizing aspects of automated testing is the handling of the data. In order to run even the simplest of tests against the user interface, a service or API or even a PL/SQL unit typically requires that a proper starting point needs to be established in the database with respect to the data. Complex set up steps need to prepare various records to ensure the test can even start and afterwards in similarly complex tear down scripts we have to clean up after the test.
This session demonstrates how this hardship can be a thing of the past. Using snapshots of a test database in a Docker container with a managed test data set that supports all tests, we can create automated tests without any set up or tear down effort. These tests can run very fast, concurrently, and whenever and wherever you like them to run. This way of working opens up much higher test coverage and much increased productivity for developers and testers.
This quickie demonstrates a new approach to [managing the data required for] test automation. Using Docker Containers with databases including a shared test data set and starting a fresh container for each automated test, the individual test cases become much simpler. With this approach, achieving a much higher coverage with automated testing comes within reach. Additionally, tests can be much more sophisticated - as a much richer data set is guaranteed to be available. Developing the test cases is much more productive and much more focused on the actual test, rather than the setup and tear down actions.
Through the use of the experimental checkoint mechanism in Docker, restarting a database can be done in mere seconds.
In this presentation, I covered how I've migrated Android project from old Jenkins (Freestyle jobs, 1st Jenkins instance) to new Jenkins (Multibranch pipeline, 2nd Jenkins instance).
Also, it covers a Jenkins Shared Library usage and integration tests on pipeline code.
At the end, I'm covering pros/cons of final result and what difficulties I faced during migration.
Jenkins is a Continuous Integration (CI) server or tool which is written in Java. It provides Continuous Integration services for software development, which can be started via command line or web application server. Jenkins Pipeline is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins.
Slides from my presentation to the Sydney Jenkins Meetup on Declarative Pipeline. Video of the presentation available at https://www.youtube.com/watch?v=3R5xh4oeDg0&feature=youtu.be
Are you planning to start working with open source and are overwhelmed by all the new tools you have to learn ? Here you can find a quick overview about Subversion, Git and Maven.
Pipeline as code - new feature in Jenkins 2Michal Ziarnik
What is pipeline as code in continuous delivery/continuous deployment environment.
How to set up Multibranch pipeline to fully benefit from pipeline features.
Jenkins master-node concept in Kubernetes cluster.
Do you know how Continuous Delivery of Java Open Source libraries looks? How big is your release overhead? Do you update release notes and include contributors manually? How do you handle versioning? Do you use semantic versioning?
During this workshop, you will learn how to set up Continuous Delivery for your library. You’ll never have to manually release new versions again. We will use the following tools: GitHub, TravisCI, Bintray, Maven Central. We will glue everything using Shipkit.org - a project born from Mockito (and still used there). You’ll additionally learn SerVer.
This workshop is mostly for Java open source and Gradle plugins developers. We will use a library prepared especially for this training, so no worries if you don’t have your own open source project (yet).
Prerequisites: GitHub account, Java & Gradle basics.
A compare and contrast of Continuous Integration testing tools that can be used for Perl projects and where they all fall short. Also looking at what an ideal solution could look like.
Github - Git Training Slides: FoundationsLee Hanxue
Slide deck with detailed step breakdown that explains how git works, together with simple examples that you can try out yourself. Slides originated from http://teach.github.com/articles/course-slides/
Author: https://twitter.com/matthewmccull
Using Docker to build and test in your laptop and JenkinsMicael Gallego
Docker is changing the way we create and deploy software. This presentation is a hands-on introduction to how to use docker to build and test software, in your laptop and in your Jenkins CI server
Are you planning to start working with open source and are overwhelmed by all the new tools you have to learn ? Here you can find a quick overview about Subversion, Git and Maven.
Pipeline as code - new feature in Jenkins 2Michal Ziarnik
What is pipeline as code in continuous delivery/continuous deployment environment.
How to set up Multibranch pipeline to fully benefit from pipeline features.
Jenkins master-node concept in Kubernetes cluster.
Do you know how Continuous Delivery of Java Open Source libraries looks? How big is your release overhead? Do you update release notes and include contributors manually? How do you handle versioning? Do you use semantic versioning?
During this workshop, you will learn how to set up Continuous Delivery for your library. You’ll never have to manually release new versions again. We will use the following tools: GitHub, TravisCI, Bintray, Maven Central. We will glue everything using Shipkit.org - a project born from Mockito (and still used there). You’ll additionally learn SerVer.
This workshop is mostly for Java open source and Gradle plugins developers. We will use a library prepared especially for this training, so no worries if you don’t have your own open source project (yet).
Prerequisites: GitHub account, Java & Gradle basics.
A compare and contrast of Continuous Integration testing tools that can be used for Perl projects and where they all fall short. Also looking at what an ideal solution could look like.
Github - Git Training Slides: FoundationsLee Hanxue
Slide deck with detailed step breakdown that explains how git works, together with simple examples that you can try out yourself. Slides originated from http://teach.github.com/articles/course-slides/
Author: https://twitter.com/matthewmccull
Using Docker to build and test in your laptop and JenkinsMicael Gallego
Docker is changing the way we create and deploy software. This presentation is a hands-on introduction to how to use docker to build and test software, in your laptop and in your Jenkins CI server
Continous Delivering a PHP applicationJavier López
For the last few months we've been implementing a Continuous Delivery pipeline for the redesign of Time Out. In this talk I will demonstrate a real life example of what our pipeline looks like, the different tools we've used to get it done (phing, github, jenkins, ansible, AWS S3, ...), and peculiarities for PHP and Symfony2 projects. Most importantly, I'll be looking at things we've struggled with along the way and the lessons we've learnt.
In this advanced session, we will investigate all the ways that you can automate your testing processes with TestBox and many CI and automation tools. From Jenkins integration, Travis CI, Node runners, Grunt watchers and much more. This session will show you the value of continuous integration and how to apply it with modern tools and technologies.
Main Points
Why we want to automate
Continuous Integration
ANT/CommandBox Test Runner
Setup of a Jenkins CI server
Travis CI integration
Pipelines CI integration
Node TestBox Runners
Grunt Watchers and Browser Live Reloads
Inaugural Meetup for the Swift Austin group. Introduction and how-to presentation on getting the latest (or recent) version of Swift running in a Docker or Vagrant VM under MacOS or Windows.
Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...Badoo
What does it usually look like when people do Mobile Web Test Automation? They write a couple of tests, run them on different desktop browsers, and then only after that, try to run on emulators/simulators. The final step is adapting and fixing the tests for browsers on real devices.
Luckily, we developed our tests for Mobile Web on real devices. But some time ago we decided to run on Desktop as well.
Why? What were the benefits for us? How do we have both Appium and Selenium tests in one repository? And what challenges did we face? I'll discuss this, as well as many other things, in my talk.
Adrian Otto from Rackspace will present "Docker 102", This includes a summary of Docker 101 as a refresher from the August session, and builds upon that by discussing who should use a registry, and what options are available for keeping them private. We will discuss best practices for keeping your production environments evergreen with updated operating system environments, library dependencies, and maintaining an immutable infrastructure.
A user's perspective on SaltStack and other configuration management toolsSaltStack
Aurelien Geron uses SaltStack to manage a few VMs running Django web apps based on a sharded mongodb cluster. He had struggled with another configuration management tool for months but then read about Saltstack and decided to try it out. For Aurelien SaltStack just works, it's plain and simple, powerful, configurable and ultra-fast. This is his presentation.
One commit, one release. Continuously delivering a Symfony project.Javier López
For the last few months we've been implementing a Continuous Delivery pipeline for the redesign of Time Out. In this talk I will demonstrate a real life example of what our pipeline looks like, the different tools we've used to get it done (phing, github, jenkins, ansible, AWS S3, ...), and peculiarities for PHP and Symfony2 projects. Most importantly, I'll be looking at things we've struggled with along the way and the lessons we've learnt.
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerNETWAYS
Everything is better with salt – even Foreman.
This presentation discusses the use of Salt as a configuration management tool in Foreman. New features of the Salt plugin will also be demonstrated, such as Salt Variables and the Remote Execution Salt Provider.
In recent years there has been a tremendous amount of progress and innovation around tools and applications available to web developers that improve the quality, efficiency and speed of our applications, and it is hard to keep up with all of it.
Small presentation I've made for Wire team about testing process in iOS Sync Engine Team. You can read more in depth here - http://www.objc.io/issues/15-testing/xctest/
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
2. About Me (Jason Denning)
• DevOps Engineer
• SaltStack user for ~ 3 years
• SaltStack Certified Engineer #2
• AWS Certified Architect
• OSS Advocate (first Linux install ~ 1998)
• Pythonista
• jasondenning on GitHub / @jason_denning on Twitter
3. ● Provide analytics and
marketing/segmentation tools for
mobile app developers
● Hosted backend APIs available world-
wide
● Lots of traffic
● Big fans of SaltStack
● upsight.com
4. WARNING: Work In Progress
● Testing infrastructure is not a common practice
● These slides are rough
● Your Mileage May Vary!
● We should work (together) on improving this
5. Why Test?
● DevOps: Infrastructure is code
● Code should be tested
● ⇒ Infrastructure should be tested
7. What to Test
● Basic Syntax (linting)
● Individual States
● State Relationships
● Different Environments
● As much as possible (within reason)
8. Testing Basics
● Tests should run quickly (and automatically)
● Tests should be isolated - know what you’re testing!
● Unit Tests: Test a single ‘unit’ of code
● Integration Tests: Test interactions between units
● Acceptance Tests: Test that code does what we want
9. Minimal Testing
$ salt-call state.highstate test=True
● Better than blindly applying
states
● Still not what we’re looking for
○ Manual
○ Slow
○ No isolation
○ Error-prone (“Oops, I
didn’t see the red line!”)
10. First Improvement
Test states individually:
$ salt-call state.sls foo test=True
● Slight improvement
○ More isolation
○ Faster than highstate
● Still not what we want
11. Testing Basic Syntax of SLS Files
● First Attempt: Verify SLS files are valid YAML
○ Problem: Only works for very basic states - Jinja breaks the test!
○ Problem: What about other renderers?
●
● Improvement: Test that Salt can render the SLS file
○ “salt-call state.sls foo test=True” works for this
○ Alternative: “salt-call state.show_sls foo”
14. Testing Basic Syntax - Notes
● Salt built-ins are useful!
● Better: A separate tool for validating syntax
(somebody should build one!)
● Don’t forget about outputters:
● salt-call state.show_sls foo --output=json
15. Testing in Isolation
● We need to be sure that test results are not influenced
by previous tests
● Unit testing frameworks handle this automatically
● Ideal: Create a new, clean infrastructure for each test
○ Problem: Tests must run quickly!
● Solutions:
○ Use VMs (still to slow if we’re running lots of tests)
○ Use Containers (e.g. LXC / Docker)
16. Docker Containers vs. Full VMs
Docker Pros:
● Easy
● Quick to build and destroy
Docker Cons:
● Missing Functionality (testing services will take
more work)
● Linux only
VM Pros:
● Full OS install - services work / any OS
● Easy to manage if using tools such as Vagrant
● Might be identical to your actual environment
VM Cons:
● Slow(er) to build and destroy
Best Practice: Use both! (For different types of test)
17. Docker: Quickstart
● Docker makes it easy to build & manage LXC containers
● Allows one to quickly customize existing container images
● Mount host directories in the container
Basic Dockerfile (~/saltpdx/Dockerfile):
FROM phusion/baseimage
RUN sudo add-apt-repository -y ppa:saltstack/salt
RUN sudo apt-get update
RUN sudo apt-get -y install salt-minion
VOLUME ["/etc/salt", "/salt/states", "/salt/pillar"]
CMD salt-call state.highstate
● Build an image (tagged salt/test, version 1):
$ docker build -t ‘salt/test:1’ .
● Start a container using the image:
$ docker run --rm -it -v ~/saltpdx/salt:/etc/salt -v ~/saltpdx/states:/salt/states -v /
~/saltpdx/pillar:/salt/pillar salt/test:1
18. Docker Quickstart
● Docker creates a container
based on the image
● Host directories are
specified using the -v flag
● Docker starts the container
and runs the CMD specified
in the Dockerfile
● --rm flag tells docker to
delete the container after
the command has run
● -it (or -i -t) for interactive
terminal mode (add
‘/bin/bash’ to end of
command to get a shell)
19. Docker Tips
● Mount host directories as volumes for:
○ Salt configuration
○ States
○ Pillar
○ Logs?
● Configure containers as salt-masterless to avoid networking & PKI
issues
● Use the --rm flag to automatically delete container instances after
they’ve run
● Tag & version images
20. Docker: Entrypoint
● When you run a Docker container, Docker executes a binary called ENTRYPOINT
● The CMD that you pass to Docker (via Dockerfile or the cli) is passed as an argument to
the ENTRYPOINT
● By default, Docker will use “/bin/sh -c” as the ENTRYPOINT - this can be overridden
● e.g.:
$ docker run --rm --entrypoint /bin/echo salt/test:1 foo
● We can exploit this to make a simple test runner
● Dockerfile:
FROM phusion/baseimage
RUN sudo add-apt-repository -y ppa:saltstack/salt
RUN sudo apt-get update
RUN sudo apt-get -y install salt-minion
VOLUME ["/etc/salt", "/salt/states", "/salt/pillar"]
ADD test_salt.sh /test_salt.sh
RUN chmod +x /test_salt.sh
ENTRYPOINT ["/bin/bash", "/test_salt.sh"]
22. Docker: Entrypoint (con’t)
After building a new image, we can
run:
$ docker run --rm -v / ~/saltpdx/salt:
/etc/salt -v / ~/saltpdx/states:
/salt/states -v / ~/saltpdx/pillar:
/salt/pillar salt/test:2 / highstate
Which will start a container, run “salt-
call state.highstate”, and exit.
23. Docker: Entrypoint (con’t)
Or, we can run:
$ docker run --rm -v / ~/saltpdx/salt:
/etc/salt -v / ~/saltpdx/states:
/salt/states -v / ~/saltpdx/pillar:
/salt/pillar salt/test:2 / foo
Which will run “salt-call state.
show_sls foo”, then “salt-call state.sls
foo”, and exit.
24. Next Step: Automation
● We’ve got the basic tools - the next step is to add some automation
● Host-side automation:
○ Starting and destroying containers
○ Determine what states to test
○ Collect & summarize test results
○ Test various permutations (different Linux version, different
grains, etc.)
● Container-side automation
○ Discover & test sub-components (e.g. file templates)
○ Integration/Acceptance/Behavioral Tests
25. Automation Overview
● Testing is initiated by running a test-controller script on the host
● The test-controller should:
○ Generate a list of states to test and environment permutations
○ Start a container and trigger the test runner
○ Collect test results
○ Destroy the container
○ Repeat for each state
● The Docker image should have a test-runner script that is used as
the ENTRYPOINT
● The test-runner script should:
○ Determine specific tests to run
○ Run the tests
○ Output Results
26. Next Time - Part 2
● Actual code for these automation scripts
● Behavioral Testing (for acceptance/integration tests)
● Collecting and Summarizing Results in a useful fashion
● Continuous Integration
● Adding Vagrant VMs for additional tests
● Testing multi-machine infrastructures
● …???