PyCon 2013 Test Driven Infrastructure

826 views

Published on

Test Driven Infrastructure (with examples in RPM packages).

How to save your butt by adding a few cheap and simple tests to your packages.

Use visudo to validate sudo configuration (sudo will stop to work with broken configs!).

Use bash and python to validate scripts against typos, forgotton braces etc.

I gave this talk at the PyConDE 2013 (https://2013.de.pycon.org/), Original video with all lightning talks is http://pyvideo.org/video/2438/mittwoch-lightning-talks

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
826
On SlideShare
0
From Embeds
0
Number of Embeds
331
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

PyCon 2013 Test Driven Infrastructure

  1. 1. www.immobilienscout24.de Test Driven Infrastructure Köln | 16.10.2013 | Schlomo Schapiro Systemarchitekt, Open Source Evangelist License: http://creativecommons.org/licenses/by-nc-nd/3.0/
  2. 2. Untested = Broken
  3. 3. %prep %setup -q %install install … %{buildroot}/… install … %{buildroot}/… %files %defattr(-,root,root,-) /...
  4. 4. BuildRequires: sudo %build set -e visudo -c -f sudoers %install install -m 0440 sudoers -D %{buildroot}/etc/suoders.d/%{name} %files%defattr(-,root,root,-) /etc/suoders.d/%{name}
  5. 5. BuildRequires: PyYAML, pylint %build set -e # syntax checks bash -n my_script.sh # Should be valid python code pylint -E yum-repo-propagate # should be valid YAML file python -c " import yaml yaml.safe_load( open('config.yaml') ) " ...
  6. 6. Continuous Delivery RPM Build Jobs (Unit Tests)  Build RPM_1 and upload to DEV YUM Repo  Build RPM_2 and upload to DEV YUM Repo  ... FOO Integration Test Job  yadtshell update DEVFOO  rsh devfoo99 run-some-local-tests  curl http://devfoo99/deep-status  yum-repo-propagate -y DEVFOO -d PRO RPM_1 RPM_2 Update FOO in Production
  7. 7. Thank you very much! Please contact me for further questions and discussions. Kontakt: Immobilien Scout GmbH Andreasstraße 10 10243 Berlin Fon: +49 30 243 01-1229 Email: schlomo.schapiro@immobilienscout24.de URL: www.immobilienscout24.de All images are either public domain, used in appropriate context or taken from openclipart.org 8

×