2021-01-18 22:03:31 +00:00
|
|
|
#!/usr/bin/env python3
|
2021-05-07 13:14:40 +00:00
|
|
|
import os
|
2021-01-18 22:03:31 +00:00
|
|
|
import sys
|
|
|
|
from testflows.core import *
|
|
|
|
|
|
|
|
append_path(sys.path, "..", "..")
|
|
|
|
|
|
|
|
from helpers.cluster import Cluster
|
|
|
|
from helpers.argparser import argparser
|
|
|
|
from ldap.role_mapping.requirements import *
|
|
|
|
|
|
|
|
# Cross-outs of known fails
|
|
|
|
xfails = {
|
|
|
|
"mapping/roles removed and added in parallel":
|
2021-05-07 13:14:40 +00:00
|
|
|
[(Fail, "known bug")],
|
|
|
|
"user dn detection/mapping/roles removed and added in parallel":
|
2021-01-18 22:03:31 +00:00
|
|
|
[(Fail, "known bug")]
|
|
|
|
}
|
|
|
|
|
|
|
|
@TestFeature
|
|
|
|
@Name("role mapping")
|
|
|
|
@ArgumentParser(argparser)
|
|
|
|
@Specifications(
|
2021-05-07 19:37:29 +00:00
|
|
|
SRS_014_ClickHouse_LDAP_Role_Mapping
|
2021-01-18 22:03:31 +00:00
|
|
|
)
|
|
|
|
@Requirements(
|
|
|
|
RQ_SRS_014_LDAP_RoleMapping("1.0")
|
|
|
|
)
|
|
|
|
@XFails(xfails)
|
|
|
|
def regression(self, local, clickhouse_binary_path, stress=None, parallel=None):
|
|
|
|
"""ClickHouse LDAP role mapping regression module.
|
|
|
|
"""
|
2021-05-07 13:14:40 +00:00
|
|
|
top().terminating = False
|
2021-01-18 22:03:31 +00:00
|
|
|
nodes = {
|
|
|
|
"clickhouse": ("clickhouse1", "clickhouse2", "clickhouse3"),
|
|
|
|
}
|
|
|
|
|
2021-05-10 20:59:47 +00:00
|
|
|
if stress is not None:
|
|
|
|
self.context.stress = stress
|
|
|
|
if parallel is not None:
|
|
|
|
self.context.parallel = parallel
|
|
|
|
|
2021-05-07 13:14:40 +00:00
|
|
|
with Cluster(local, clickhouse_binary_path, nodes=nodes,
|
|
|
|
docker_compose_project_dir=os.path.join(current_dir(), "ldap_role_mapping_env")) as cluster:
|
2021-01-18 22:03:31 +00:00
|
|
|
self.context.cluster = cluster
|
|
|
|
|
|
|
|
Scenario(run=load("ldap.authentication.tests.sanity", "scenario"), name="ldap sanity")
|
|
|
|
Feature(run=load("ldap.role_mapping.tests.server_config", "feature"))
|
|
|
|
Feature(run=load("ldap.role_mapping.tests.mapping", "feature"))
|
2021-05-07 13:14:40 +00:00
|
|
|
#Feature(run=load("ldap.role_mapping.tests.user_dn_detection", "feature"))
|
2021-01-18 22:03:31 +00:00
|
|
|
|
|
|
|
if main():
|
|
|
|
regression()
|