Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use skipTest for network state integration test #34489

Merged
merged 2 commits into from
Jul 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions tests/integration/states/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,23 @@

# Salt libs
import integration
import salt.utils

# Salttesting libs
from salttesting import skipIf
from salttesting.helpers import destructiveTest, ensure_in_syspath

ensure_in_syspath('../../')


def _check_arch_linux():
with salt.utils.fopen('/etc/os-release', 'r') as f:
release = f.readline()
r = release.split('=')[1].strip().strip('"')
return r


@destructiveTest
@skipIf(_check_arch_linux() == 'Arch Linux', 'Network state not supported on Arch')
class NetworkTest(integration.ModuleCase, integration.SaltReturnAssertsMixIn):
'''
Validate network state module
'''
def setUp(self):
os_family = self.run_function('grains.get', ['os_family'])
if os_family not in ('RedHat', 'Debian'):
self.skipTest('Network state only supported on RedHat and Debian based systems')

self.run_function('cmd.run', ['ip link add name dummy0 type dummy'])

def tearDown(self):
Expand Down