Created
February 5, 2019 00:06
-
-
Save rnrbarbosa/faa9225f7f63a74e3a86c0b3733fdfdf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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