Skip to content

Instantly share code, notes, and snippets.

@rnrbarbosa
Created February 5, 2019 00:06
Show Gist options
  • Save rnrbarbosa/faa9225f7f63a74e3a86c0b3733fdfdf to your computer and use it in GitHub Desktop.
Save rnrbarbosa/faa9225f7f63a74e3a86c0b3733fdfdf to your computer and use it in GitHub Desktop.
Feature: Test Hosts
Scenario Outline: Ping Hosts
Given a <host>
When we ping the <host>
Then the <response> is correct
Examples: Hosts
| host |
| server-01.domain.com |
| server-02.domain.com |
| server-03.domain.com |
from behave import *
import testinfra
@given('a {host}')
def step_impl(context, host):
con = "ssh://root@" + host + ":3022"
context.host = testinfra.get_host(con)
@when('we ping the {host}')
def step_impl(context,host):
pass
@then('the {response} is correct')
def step_impl(context, response):
assert (context.host.system_info.type == "linux")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment