Skip to content

Commit

Permalink
Bootstrap a collector cli test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaroqui committed Jan 9, 2018
1 parent 68c9643 commit a59a4cb
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions lib/tests/test_collector_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# coding: utf8

from __future__ import print_function
from __future__ import unicode_literals

import sys
import json
import logging
from StringIO import StringIO

import nodemgr

CONFIG = "--config=/root/.opensvc-cli"
UNICODE_STRING = "bêh"
#logging.disable(logging.CRITICAL)

class Test:
def test_000(self):
"""
cli get /users/self
"""
ret = nodemgr.main(argv=[
CONFIG, "collector", "cli",
"get", "/users/self",
])
assert ret == 0

def test_001(self):
"""
cli ls
"""
ret = nodemgr.main(argv=[
CONFIG, "collector", "cli",
"ls",
])
assert ret == 0

def test_011(self):
"""
cli POST /groups
"""
ret = nodemgr.main(argv=[
CONFIG, "collector", "cli",
"post", "/groups", "--data", "role=unittest",
])

def test_101(self):
"""
cli moduleset create 1
"""
ret = nodemgr.main(argv=[
CONFIG, "collector", "cli",
"moduleset", "--create", "--moduleset", "unittest1",
])
assert ret == 0

def test_102(self):
"""
cli moduleset create 2
"""
ret = nodemgr.main(argv=[
CONFIG, "collector", "cli",
"moduleset", "--create", "--moduleset", "unittest2",
])
assert ret == 0

def test_103(self):
"""
cli moduleset recreate 1
"""
ret = nodemgr.main(argv=[
CONFIG, "collector", "cli",
"moduleset", "--create", "--moduleset", "unittest1",
])
assert ret == 0

def test_104(self):
"""
cli moduleset add responsible
"""
ret = nodemgr.main(argv=[
CONFIG, "collector", "cli",
"moduleset", "--attach",
"--moduleset", "unittest1",
"--responsible-group", "unittest",
"--publication-group", "unittest",
])
assert ret == 0

0 comments on commit a59a4cb

Please sign in to comment.