|
|
|
@ -45,22 +45,28 @@ def test_should_validate_DnsRecord():
|
|
|
|
|
sut = DnsRecord(None)
|
|
|
|
|
assert not sut.is_valid()
|
|
|
|
|
|
|
|
|
|
sut = DnsRecord('name')
|
|
|
|
|
sut = DnsRecord("name")
|
|
|
|
|
assert not sut.is_valid()
|
|
|
|
|
|
|
|
|
|
sut = DnsRecord('name', ipv4='1.2.3.4')
|
|
|
|
|
sut = DnsRecord("name", ipv4="1.2.3.4")
|
|
|
|
|
assert sut.is_valid()
|
|
|
|
|
|
|
|
|
|
sut = DnsRecord('name', ipv6='1::')
|
|
|
|
|
sut = DnsRecord("name", ipv6="1::")
|
|
|
|
|
assert sut.is_valid()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_c4k_build_should_update_fqdn(tmp_path):
|
|
|
|
|
project = Project(str(tmp_path), name="name")
|
|
|
|
|
def test_devops_buildpath():
|
|
|
|
|
sut = Devops(
|
|
|
|
|
stage="test", project_root_path="../../..", module="cloud", name="meissa"
|
|
|
|
|
)
|
|
|
|
|
assert "../../../target/meissa/cloud" == sut.build_path()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_c4k_build_should_update_fqdn():
|
|
|
|
|
project_config = {
|
|
|
|
|
"stage": "test",
|
|
|
|
|
"name": "name",
|
|
|
|
|
"project_root_path": str(tmp_path),
|
|
|
|
|
"project_root_path": "mypath",
|
|
|
|
|
"module": "module",
|
|
|
|
|
"build_dir_name": "target",
|
|
|
|
|
}
|
|
|
|
@ -77,7 +83,7 @@ def test_c4k_build_should_update_fqdn(tmp_path):
|
|
|
|
|
grafana_cloud_user="user",
|
|
|
|
|
grafana_cloud_password="password",
|
|
|
|
|
)
|
|
|
|
|
build = Devops(project_config)
|
|
|
|
|
|
|
|
|
|
sut = C4k(project_config)
|
|
|
|
|
sut.update_runtime_config(DnsRecord("test.de", ipv6="1::"))
|
|
|
|
|
|
|
|
|
@ -101,8 +107,9 @@ def test_c4k_build_should_update_fqdn(tmp_path):
|
|
|
|
|
} == sut.c4k_mixin_auth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_c4k_build_should_calculate_command(tmp_path):
|
|
|
|
|
project = Project(str(tmp_path), name="name")
|
|
|
|
|
def test_c4k_build_should_calculate_command():
|
|
|
|
|
devops = Devops(stage="test", project_root_path='',
|
|
|
|
|
module="module", name="name")
|
|
|
|
|
project_config = {
|
|
|
|
|
"stage": "test",
|
|
|
|
|
"name": "name",
|
|
|
|
@ -117,14 +124,13 @@ def test_c4k_build_should_calculate_command(tmp_path):
|
|
|
|
|
grafana_cloud_user="user",
|
|
|
|
|
grafana_cloud_password="password",
|
|
|
|
|
)
|
|
|
|
|
build = Devops(project_config)
|
|
|
|
|
sut = C4k(project_config)
|
|
|
|
|
assert (
|
|
|
|
|
"c4k-module-standalone.jar "
|
|
|
|
|
+ "/target/name/module/out_c4k_config.yaml "
|
|
|
|
|
+ "/target/name/module/out_c4k_auth.yaml > "
|
|
|
|
|
+ "/target/name/module/out_module.yaml"
|
|
|
|
|
== sut.command(build)
|
|
|
|
|
== sut.command(devops)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
project_config = {
|
|
|
|
@ -138,17 +144,15 @@ def test_c4k_build_should_calculate_command(tmp_path):
|
|
|
|
|
project_config,
|
|
|
|
|
{},
|
|
|
|
|
{},
|
|
|
|
|
executabel_name = "executabel_name",
|
|
|
|
|
executabel_name="executabel_name",
|
|
|
|
|
grafana_cloud_user="user",
|
|
|
|
|
grafana_cloud_password="password",
|
|
|
|
|
)
|
|
|
|
|
build = Devops(project_config)
|
|
|
|
|
sut = C4k(project_config)
|
|
|
|
|
assert (
|
|
|
|
|
"c4k-executabel_name-standalone.jar "
|
|
|
|
|
+ "/target/name/module/out_c4k_config.yaml "
|
|
|
|
|
+ "/target/name/module/out_c4k_auth.yaml > "
|
|
|
|
|
+ "/target/name/module/out_module.yaml"
|
|
|
|
|
== sut.command(build)
|
|
|
|
|
== sut.command(devops)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|