Testing Idempotence for Infrastructure as Code

Due to the competitiveness of the computing industry, software developers are pressured to quickly deliver new code releases. At the same time, operators are expected to update and keep production systems stable at all times. To overcome the development–operations barrier, organizations have started to adopt Infrastructure as Code (IaC) tools to efficiently deploy middleware and applications using automation scripts. These automations comprise a series of steps that should be idempotent to guarantee repeatability and convergence. Rigorous testing is required to ensure that the system idempotently converges to a desired state, starting from arbitrary states. We propose and evaluate a model-based testing framework for IaC. An abstracted system model is utilized to derive state transition graphs, based on which we systematically generate test cases for the automation. The test cases are executed in light-weight virtual machine environments. Our prototype targets one popular IaC tool (Chef), but the approach is general. We apply our framework to a large base of public IaC scripts written by operators, showing that it correctly detects non-idempotent automations.

[1]  Steve Traugott,et al.  Why Order Matters: Turing Equivalence in Automated Systems Administration , 2002, LISA.

[2]  Mike Loukides,et al.  What is DevOps , 2012 .

[3]  Steven D. Gribble,et al.  Configuration Debugging as Search: Finding the Needle in the Haystack , 2004, OSDI.

[4]  Luis Daniel Benavides Navarro,et al.  Debugging and Testing Middleware with Aspect-Based Control-Flow and Causal Patterns , 2008, Middleware.

[5]  Shaoying Liu,et al.  Generating test data from state‐based specifications , 2003, Softw. Test. Verification Reliab..

[6]  George Candea,et al.  Parallel symbolic execution for automated real-world software testing , 2011, EuroSys '11.

[7]  Sander van der Burg,et al.  Automating System Tests Using Declarative Virtual Machines , 2010, 2010 IEEE 21st International Symposium on Software Reliability Engineering.

[8]  Jerome A. Rolia,et al.  Automatic Stress Testing of Multi-tier Systems by Dynamic Bottleneck Switch Generation , 2009, Middleware.

[9]  Bruno Legeard,et al.  A taxonomy of model‐based testing approaches , 2012, Softw. Test. Verification Reliab..

[10]  Asser N. Tantawi,et al.  Enabling Efficient Placement of Virtual Infrastructures in the Cloud , 2012, Middleware.

[11]  Sarfraz Khurshid,et al.  Symbolic execution for software testing in practice: preliminary assessment , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[12]  Schahram Dustdar,et al.  Testing of data‐centric and event‐based dynamic service compositions , 2013, Softw. Test. Verification Reliab..

[13]  Diego Zamboni,et al.  Learning CFEngine 3 - automated system administration for sites of any size , 2012 .

[14]  Alva L. Couch,et al.  On the Algebraic Structure of Convergence , 2003, DSOM.

[15]  Jez Humble,et al.  Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation , 2010 .

[16]  George Candea,et al.  Automated software testing as a service , 2010, SoCC '10.

[17]  Andreas Hoffmann,et al.  Model-Based Testing , 2012, IEEE Software.

[18]  Michael Hüttermann DevOps for Developers , 2012, Apress.

[19]  Marc Reichenbach,et al.  Continuous Integration and Automation for Devops , 2013 .

[20]  Hareton K. N. Leung,et al.  A survey of combinatorial testing , 2011, CSUR.

[21]  Marcus Brunner,et al.  Self-Managing Distributed Systems , 2003, Lecture Notes in Computer Science.

[22]  Pat Helland,et al.  Building on Quicksand , 2009, CIDR.

[23]  Pat Helland,et al.  Idempotence is not a medical condition , 2012, Commun. ACM.

[24]  Schahram Dustdar,et al.  Testing Elastic Computing Systems , 2013, IEEE Internet Computing.

[25]  Michael Httermann,et al.  DevOps for Developers , 2012 .

[26]  Mona Attariyan,et al.  AutoBash: improving configuration management with operating system causality analysis , 2007, SOSP.

[27]  Mark Burgess Testable system administration , 2011, CACM.