Kubernetes storage validation by Ansible test automation framework

Why we used ansible?

How ansible is used?

Structure of ansible automation framework roles

roles
Feature_test
volumegroup_provision
Tasks
Test1.yml
Test2.yml
Main.yml
volumesnapshot_provision
volume_resize
basic_volume_workflow
Lib
resources
(library files sc,pvc,pod and IO inside Pod)
volgroup_play.yml
volsnaphost_play.yml
volresize_play.yml
basic_volume_play.yml
Hosts
In the above framework, test1.yml and test2.yml are tasks file where test cases would be written.
Each feature will have its own play file—for example, Volgroup_play.yml. So if we execute volgroup_play.yml, then tests reside in test1.yml and test2.yml will be executed.
Below command will execute the playansible-playbook -I hosts volgroup_play.yml -vv

Challenges:

Problem:

Solution:

- Block:

- include: test_header
vars:
Test_file: ‘test1.yml’
Test_description: ‘volume group provision basic workflow’
< creation of SC,PVC and POD and validation logic>
<After validation ,do cleanup>

- include: test_footer
vars:
Test_file: “test1.yml”
Test_description: ‘volume group provision basic workflow’
Test_result: “Pass”
rescue:
- include: test_footer
vars:
Test_file: “test1.yml”
Test_description: ‘volume group provision basic workflow’
Test_result: “Fail”
< Cleanup logic>

Problem:

Solution:

Conclusion:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store