Mission ImpAnsible - NSM
at
(RobotFrame)work
WROCPY 2020 - Wrocław
Adam Przybyła <adam.przybyla@gmail.com>
42
Answer to the Ultimate Question of Life,
the Universe, and Everything
What is a Robot Framework?
●
Open Source
●
Generic test automation framework
●
License
●
Editors
●
Python support
Why to use Robot
Framework?
●
High level keywords
●
Logging
●
Reports
●
Data driven test cases
●
Behavior-driven style test cases
●
Tagging
●
Easy to include in your continous integration system
●
Ubiquous language
Given-When-Then style
Given/When/Then/And/But - removed
Ubiquitous Language is the term Eric Evans
uses in Domain Driven Design for the practice of
building up a common, rigorous language
between developers and users. ... Evans makes
clear that using the ubiquitous language in
conversations with domain experts is an important
part of testing it, and hence the domain model.
Who is an admin?
●
More Commands per sec
●
let’s make a robot – what could be wrong?
●
Reboot fix
●
Logs, logs everywhere …
●
Admins do nothing
Escape from Freedom
Text, text, text ...
●
Linux as text processing system
●
Compilers, compilers and compilers compilers
●
Python - scripts
●
Robot Framework
●
Humanities – languages related science
●
Everymany knows computers
●
Natural language can be accurate
●
Natural Semantic Metalangue
●
We can copy all data to the cloud ...
[adam@tao ~]$ find /bin/ /sbin/|xargs -l1 file|cut -f2 -d:|cut -f1 -d,|sort |uniq -c|
grep -v "symbolic link"|sort -rn
1538 ELF 64-bit LSB executable
523 ELF 64-bit LSB shared object
485 Python script
287 POSIX shell script
71 Perl script
68 Bourne-Again shell script
20 ELF 32-bit LSB executable
17 setuid ELF 64-bit LSB shared object
10 setgid ELF 64-bit LSB shared object
8 regular file
4 setuid executable
3 setgid executable
3 C++ source
2 directory
2 a /usr/bin/sh script
1 setuid regular file
1 Palm OS dynamic library data "#!/bin/sh"
1 Lua script
1 executable
[adam@tao ~]
*** Settings ***
library Impansible
library Collections
*** Test Cases ***
test 1
${x}= Setup localhost
log to console ${x}
${y}= get from dictionary ${x} ansible_facts
${h}= get from dictionary ${y} ansible_hostname
${z}= get from dictionary ${y} ansible_distribution
Should be Equal ${z} Ubuntu
Should Contain ${h} tester
test 2
${x}= apt localhost package=mtr state=present
${x}= get from dictionary ${x} invocation
${y}= get from dictionary ${x} module_args
${s}= get from dictionary ${y} state
Should be Equal ${s} present
test 3
${x}= apt localhost package=mtr state=absent
${x}= get from dictionary ${x} invocation
${y}= get from dictionary ${x} module_args
${s}= get from dictionary ${y} state
Should be Equal ${s} absent
test 4
${c}= get certificate localhost host=www.onet.pl port=443 proxy_host=10.1.1.1
${e}= get from dictionary ${c} expired
Should not be True ${e}
Impansible
Five clouds is enough
Robotframework-nsm
*** Settings ***
Resource NSM.robot
Metadata Author Adam Przybyla
*** Test Cases ***
Test 1
Teraz jest tak: ja widzę webpage
Ja nie widzę słowa logged na webpage
Potem ja użyję słów credentials na webpage
Z tego powodu ja widzę słowa logged na webpage
Niedługo potem ja nie widzę webpage
Test 2
Teraz jest tak: ja widzę webpage
Ja nie widzę słowa logged na webpage
Potem ja użyję słów bad credentials na webpage
Z tego powodu ja nie widzę słowa logged na webpage
Niedługo potem ja nie widzę webpage
Test 3
Teraz jest tak: ja widzę webpage
Ja nie widzę słowa logged na webpage
Niedługo potem ja nie widzę webpage
*** Settings ***
Resource NSM.robot
Metadata Author Adam Przybyla <adam.przybyla@gmail.com>
*** Test Cases ***
Test 1
It is like this now: I see the webpage
I not see words logged on the webpage
then i use the words credentials on webpage
because of this: I see words logged on the webpage
after this i see the webpage no more
Test 2
It is like this now: I see the webpage
I not see words logged on the webpage
then i use the words bad credentials on webpage
because of this: I not see words logged on the webpage
after this i see the webpage no more
Test 3
It is like this now: I see the webpage
I not see words logged on the webpage
after this i see the webpage no more
*** Settings ***
Resource NSM.robot
Metadata Author Adam Przybyla
*** Test Cases ***
测试 1
现在是这样的:我看到 webpage
我在 webpage 上看不到 logged 单词
然后我在 webpage 上使用 credentials 单词
因此我在 webpage 上看到 logged 单词
在此之后,我不再看到 webpage
测试 2
现在是这样的:我看到 webpage
我在 webpage 上看不到 logged 单词
然后我在 webpage 上使用 bad credentials 单词
因此我在 webpage 上看不到 logged 单词
在此之后,我不再看到 webpage
测试 3
现在是这样的:我看到 webpage
我在 webpage 上看不到 logged 单词
在此之后,我不再看到 webpage
Documentation
https://www.youtube.com/watch?v=njcHzGYv7nI
https://www.itprotoday.com/hybrid-cloud/how-know-when-cloud-
computing-trend-has-come-its-end
http://robotframework.org/
https://docs.ansible.com/ansible/latest/modules/modules_by_categ
ory.html
https://searchcloudcomputing.techtarget.com/tip/Beat-vendor-lock-
in-with-a-cloud-exit-strategy
https://www.theguardian.com/commentisfree/2019/aug/24/douglas-
adams-was-right-knowledge-without-understanding-is-meaningless
https://github.com/AdamPrzybyla
Advocatus diavoli
Privacy & Exit plan
Questions?

Mission ImpAnsible - NSM at (RobotFrame)work

  • 1.
    Mission ImpAnsible -NSM at (RobotFrame)work WROCPY 2020 - Wrocław Adam Przybyła <adam.przybyla@gmail.com>
  • 2.
    42 Answer to theUltimate Question of Life, the Universe, and Everything
  • 3.
    What is aRobot Framework? ● Open Source ● Generic test automation framework ● License ● Editors ● Python support
  • 4.
    Why to useRobot Framework? ● High level keywords ● Logging ● Reports ● Data driven test cases ● Behavior-driven style test cases ● Tagging ● Easy to include in your continous integration system ● Ubiquous language
  • 5.
  • 6.
    Ubiquitous Language isthe term Eric Evans uses in Domain Driven Design for the practice of building up a common, rigorous language between developers and users. ... Evans makes clear that using the ubiquitous language in conversations with domain experts is an important part of testing it, and hence the domain model.
  • 8.
    Who is anadmin? ● More Commands per sec ● let’s make a robot – what could be wrong? ● Reboot fix ● Logs, logs everywhere … ● Admins do nothing
  • 9.
  • 10.
    Text, text, text... ● Linux as text processing system ● Compilers, compilers and compilers compilers ● Python - scripts ● Robot Framework ● Humanities – languages related science ● Everymany knows computers ● Natural language can be accurate ● Natural Semantic Metalangue ● We can copy all data to the cloud ...
  • 11.
    [adam@tao ~]$ find/bin/ /sbin/|xargs -l1 file|cut -f2 -d:|cut -f1 -d,|sort |uniq -c| grep -v "symbolic link"|sort -rn 1538 ELF 64-bit LSB executable 523 ELF 64-bit LSB shared object 485 Python script 287 POSIX shell script 71 Perl script 68 Bourne-Again shell script 20 ELF 32-bit LSB executable 17 setuid ELF 64-bit LSB shared object 10 setgid ELF 64-bit LSB shared object 8 regular file 4 setuid executable 3 setgid executable 3 C++ source 2 directory 2 a /usr/bin/sh script 1 setuid regular file 1 Palm OS dynamic library data "#!/bin/sh" 1 Lua script 1 executable [adam@tao ~]
  • 12.
    *** Settings *** libraryImpansible library Collections *** Test Cases *** test 1 ${x}= Setup localhost log to console ${x} ${y}= get from dictionary ${x} ansible_facts ${h}= get from dictionary ${y} ansible_hostname ${z}= get from dictionary ${y} ansible_distribution Should be Equal ${z} Ubuntu Should Contain ${h} tester test 2 ${x}= apt localhost package=mtr state=present ${x}= get from dictionary ${x} invocation ${y}= get from dictionary ${x} module_args ${s}= get from dictionary ${y} state Should be Equal ${s} present test 3 ${x}= apt localhost package=mtr state=absent ${x}= get from dictionary ${x} invocation ${y}= get from dictionary ${x} module_args ${s}= get from dictionary ${y} state Should be Equal ${s} absent test 4 ${c}= get certificate localhost host=www.onet.pl port=443 proxy_host=10.1.1.1 ${e}= get from dictionary ${c} expired Should not be True ${e} Impansible
  • 13.
  • 14.
  • 16.
    *** Settings *** ResourceNSM.robot Metadata Author Adam Przybyla *** Test Cases *** Test 1 Teraz jest tak: ja widzę webpage Ja nie widzę słowa logged na webpage Potem ja użyję słów credentials na webpage Z tego powodu ja widzę słowa logged na webpage Niedługo potem ja nie widzę webpage Test 2 Teraz jest tak: ja widzę webpage Ja nie widzę słowa logged na webpage Potem ja użyję słów bad credentials na webpage Z tego powodu ja nie widzę słowa logged na webpage Niedługo potem ja nie widzę webpage Test 3 Teraz jest tak: ja widzę webpage Ja nie widzę słowa logged na webpage Niedługo potem ja nie widzę webpage
  • 17.
    *** Settings *** ResourceNSM.robot Metadata Author Adam Przybyla <adam.przybyla@gmail.com> *** Test Cases *** Test 1 It is like this now: I see the webpage I not see words logged on the webpage then i use the words credentials on webpage because of this: I see words logged on the webpage after this i see the webpage no more Test 2 It is like this now: I see the webpage I not see words logged on the webpage then i use the words bad credentials on webpage because of this: I not see words logged on the webpage after this i see the webpage no more Test 3 It is like this now: I see the webpage I not see words logged on the webpage after this i see the webpage no more
  • 18.
    *** Settings *** ResourceNSM.robot Metadata Author Adam Przybyla *** Test Cases *** 测试 1 现在是这样的:我看到 webpage 我在 webpage 上看不到 logged 单词 然后我在 webpage 上使用 credentials 单词 因此我在 webpage 上看到 logged 单词 在此之后,我不再看到 webpage 测试 2 现在是这样的:我看到 webpage 我在 webpage 上看不到 logged 单词 然后我在 webpage 上使用 bad credentials 单词 因此我在 webpage 上看不到 logged 单词 在此之后,我不再看到 webpage 测试 3 现在是这样的:我看到 webpage 我在 webpage 上看不到 logged 单词 在此之后,我不再看到 webpage
  • 19.
  • 20.
  • 21.