Skip to content

Commit

Permalink
Add cloud init tests for alibaba images.
Browse files Browse the repository at this point in the history
  • Loading branch information
smarlowucf committed Oct 9, 2020
1 parent de217a0 commit 203bd1e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests:
- test_sles_alibaba_services
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pytest


@pytest.mark.parametrize('name', [
('cloud-init-local'),
('cloud-init'),
('cloud-config'),
('cloud-final')
])
def test_sles_alibaba_one_shot_services(check_service, host, name):
assert check_service(name, running=None)

if host.exists('systemctl'):
# No clear way to check a service exited successfully using sysvinit
output = host.run(
"systemctl show -p Result {0} | sed 's/Result=//g'".format(name)
)
assert output.stdout.strip() == 'success'

0 comments on commit 203bd1e

Please sign in to comment.