mirror of https://github.com/sipwise/ngcpcfg.git
* bin/ngcpcfg: SKIP_RESTORE_PERMS so we can skip that on tests * scripts/status: use NGCPCTL_BASE and NGCPCTL_MAIN so it would work in test environment Change-Id: I8ba80bbb2ea3adf1b8cc2a4229568a87f9508cbdmr10.0
parent
59fa4170c5
commit
24098da128
Binary file not shown.
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env py.test-3
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.status
|
||||
def test_status(ngcpcfgcli, tmpdir, gitrepo):
|
||||
src = "basic-ngcp-config.tar.gz"
|
||||
with gitrepo.from_archive(src):
|
||||
cfg_dir = os.path.join(gitrepo.localpath, "ngcp-config")
|
||||
out = ngcpcfgcli(
|
||||
"status",
|
||||
env={
|
||||
# don't mess with perms
|
||||
"SKIP_RESTORE_PERMS": "true",
|
||||
"NGCPCTL_MAIN": cfg_dir,
|
||||
# we just need a clean git repo
|
||||
"NGCPCTL_BASE": cfg_dir,
|
||||
},
|
||||
)
|
||||
|
||||
# debug, only printed in logs in case of error
|
||||
print("stdout:")
|
||||
print(out.stdout.replace("\\n", "\n"))
|
||||
print("stderr:")
|
||||
print(out.stderr.replace("\\n", "\n"))
|
||||
assert out.returncode == 0
|
||||
Loading…
Reference in new issue