-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bootstrap a collector cli test suite
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
|