Hanappi, O. (2016). Testing idempotence and convergence of automatic configuration scripts [Diploma Thesis, Technische Universität Wien]. reposiTUm. https://doi.org/10.34726/hss.2016.24374
Das Aufkommen von Cloud Computing und großen, dynamisch skalierenden verteilten Anwendungen in den letzten Jahren führte zu einem erhöhten Wunsch nach automatisierter Verwaltung von IT Ressourcen und somit zur Verbreitung von Lösungen zur automatischen Konfiguration. Diese arbeiten auf der Grundlage einer deklarativen Beschreibung des gewünschten Zustands des Systems. Durch wiederholte Ausführungen eines Konfigurationsprogramms wird das System entsprechend konfiguriert. Die ausgeführten Aktionen können zwar zwischenzeitlich fehlschlagen, werden schlussendlich jedoch erfolgreich angewandt. Das System konvergiert somit zum gewünschten Zustand. Essentiell für die Erreichung von Konvergenz ist die Idempotenz der zugrundeliegenden Aktionen, also die Eigenschaft, dass diese das System nach erfolgreicher Ausführung nicht weiter verändern und ebenso nicht fehlschlagen. Die Entwicklung solcher idempotenten Aktionen ist eine anspruchsvolle Aufgabe und erfordert ausführliches Testen. Zusätzlich zu Idempotenzproblemen können sich verschiedene Aktionen gegenseitig beeinflussen oder in Konflikt zueinander stehen. Insbesondere ist eine Sequenz idempotenter Aktionen nicht zwangsläufig ebenfalls idempotent. Weiters ist die Reihenfolge der ausgeführten Aktionen nicht immer vollständig definiert, sodass sie sich von einer Ausführung zur nächsten unterscheiden kann. Dies beruht auf der Idee, dass der Konfigurationsprozess konvergent ist und das System den gewünschten Zustand letztendlich erreicht, unabhängig von der konkreten Ausführungsreihenfolge. Es ist möglich, dass Konflikte nur unter gewissen Umständen auftreten und daher unentdeckt bleiben. Das Erstellen von automatisierten Konfigurationen, die idempotent und konvergent sind, ist daher aus obigen Gründen eine schwierige Aufgabe, die gründliches und systematisches Testen erfordert. Wir wenden daher einen modellbasierten Testansatz an, stellen ein konzeptuelles Modell zum automatischen Testen von Idempotenz und Konvergenz vor und setzen dieses anhand eines Prototypen um, der auf Puppet basiert. Aktionen in Puppet Scripts sind lediglich partiell geordnet. Es gibt üblicherweise viele verschiedene Ausführungsreihenfolgen, sodass nicht alle getestet werden können. Aus diesem Grund führen wir das Konzept der Erhaltung (engl. preservation) ein. Dies ist eine Eigenschaft, die die Konvergenz der gesamten Konfiguration sicherstellt, sofern Erhaltung paarweise zwischen allen Aktionen erfüllt ist. Wir evaluieren das vorgestellte Model anhand realer Puppet Scripts und zeigen die Effektivität des Ansatzes. Der entwickelte Prototyp ist in der Lage, sowohl alle Idempotenz- und Konvergenzprobleme in einer Menge von Scripts mit bekannten Problemen als auch einige bislang unentdeckte Probleme in einer zufällig gewählten Menge zu identifizieren.
de
In recent years, with the rise of cloud computing and large dynamically scaling distributed applications, the demand for automatically managing IT infrastructures grew steadily and led to the adoption of so-called configuration management tools. Such tools operate on declarative descriptions of the desired state of the system. They are repeatably applied and try to configure the system accordingly. The actions performed may fail temporarily but will eventually succeed. The system is called to converge to the desired state. A crucial property to achieve convergence is the idempotence of the executed actions, hence that repeated executions do not fail or change the system state once the action succeeded. Developing such idempotent actions is a very challenging task and requires thorough testing. In addition to idempotence issues, different actions may influence or are in conflict with each other. In particular, a sequence of idempotent actions is not necessarily idempotent as well. Furthermore, the order in which actions are executed may not be totally defined, but may vary from one execution to another. This stems from the idea that the configuration process is convergent and the system will eventually reach the desired state, regardless of the execution order of the underlying actions. Conflicts may only occur in some orders and could thus stay undetected. It follows that creating idempotent and convergent automated configurations is a difficult task which requires rigorous and systematic testing. Therefore, we apply a model based test approach, propose a conceptual framework for automated idempotence and convergence testing and present a prototypical implementation thereof based on Puppet. Actions in Puppet scripts are only partially ordered, such that there are usually many different execution orders and testing all of them is not viable in general. Hence, we define a property called preservation, which can be tested pairwise between resources and which, assuming that it holds for all pairs of resources, implies the convergence of the corresponding configuration. We perform an evaluation of our model based on real world Puppet scripts and show the effectiveness of the presented approach. The prototype is able to detect all idempotence and convergence related issues in a set of real world Puppet scripts with known issues as well as some hitherto undiscovered issues in a large set of arbitrarily chosen Puppet scripts.