repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
rancher | rancher-master/tests/integration/suite/test_default_roles.py | import pytest
import json
from .common import random_str
from .conftest import wait_for_condition, wait_until, wait_for
CREATOR_ANNOTATION = 'authz.management.cattle.io/creator-role-bindings'
systemProjectLabel = "authz.management.cattle.io/system-project"
defaultProjectLabel = "authz.management.cattle.io/default-proj... | 9,284 | 33.516729 | 79 | py |
rancher | rancher-master/tests/integration/suite/test_workloads.py | from .common import random_str
from rancher import ApiError
from .conftest import wait_for, wait_until_available, user_project_client
import time
import pytest
def test_workload_image_change_private_registry(admin_pc):
client = admin_pc.client
registry1_name = random_str()
registries = {'index.docker.io... | 15,629 | 32.184713 | 79 | py |
rancher | rancher-master/tests/integration/suite/pipeline_common.py | # flake8: noqa
import requests
from flask import jsonify
from threading import Thread
class MockServer(Thread):
def __init__(self, port=5000):
super().__init__()
from flask import Flask
self.port = port
self.app = Flask(__name__)
self.url = "http://localhost:%s" % self.por... | 17,913 | 49.461972 | 1,234 | py |
rancher | rancher-master/tests/integration/suite/test_hpa.py | from .common import random_str
def test_hpa(admin_pc):
client = admin_pc.client
ns = admin_pc.cluster.client.create_namespace(
name=random_str(),
projectId=admin_pc.project.id)
name = random_str()
workload = client.create_workload(
name=name,
namespaceId=ns.id,
... | 1,872 | 25.013889 | 51 | py |
rancher | rancher-master/tests/integration/suite/test_role_template.py | from .common import random_str
from .conftest import wait_until_available, wait_until, wait_for
from rancher import ApiError
import time
import pytest
import kubernetes
def test_role_template_creation(admin_mc, remove_resource):
rt_name = random_str()
rt = admin_mc.client.create_role_template(name=rt_name)
... | 14,180 | 36.715426 | 79 | py |
rancher | rancher-master/tests/integration/suite/test_ingress.py | from .common import random_str, auth_check
def test_ingress_fields(admin_pc_client):
auth_check(admin_pc_client.schema, 'ingress', 'crud', {
'namespaceId': 'cr',
'projectId': 'cr',
'rules': 'cru',
'tls': 'cru',
'ingressClassName': 'cru',
'defaultBackend': 'cru',
... | 4,630 | 31.843972 | 72 | py |
rancher | rancher-master/tests/integration/suite/test_rbac.py | import kubernetes
import pytest
from rancher import ApiError
import time
from .common import random_str
from .test_catalog import wait_for_template_to_be_created
from .conftest import wait_until_available, wait_until, \
cluster_and_client, user_project_client, \
kubernetes_api_client, wait_for, ClusterContext,... | 32,471 | 33.037736 | 79 | py |
rancher | rancher-master/tests/integration/suite/test_kontainer_engine_annotations.py | from .common import random_str
from .conftest import wait_until, wait_for
annotation = "clusterstatus.management.cattle.io/" \
"temporary-security-credentials"
access_key = "accessKey"
secret_key = "secretKey"
session_token = "sessionToken"
region = "region"
"""
There are effectively 2 ways that an EKS c... | 3,429 | 29.900901 | 75 | py |
rancher | rancher-master/tests/integration/suite/__init__.py | 0 | 0 | 0 | py | |
rancher | rancher-master/tests/integration/suite/test_notifier.py | from kubernetes.client import CustomObjectsApi
from .common import random_str
def test_notifier_smtp_password(admin_mc, remove_resource):
client = admin_mc.client
name = random_str()
password = random_str()
notifier = client.create_notifier(clusterId="local",
name... | 2,429 | 37.571429 | 77 | py |
rancher | rancher-master/tests/integration/suite/test_project_catalog.py | from .conftest import wait_until, wait_until_available, wait_for_condition,\
user_project_client
from rancher import ApiError
from .common import random_str
import time
def test_project_catalog_creation(admin_mc, remove_resource,
user_mc, user_factory, admin_pc,
... | 12,258 | 37.91746 | 77 | py |
rancher | rancher-master/tests/integration/suite/test_users.py | import pytest
from kubernetes.client import CustomObjectsApi
from rancher import ApiError
from .conftest import random_str, wait_for
grbAnno = "cleanup.cattle.io/grbUpgradeCluster"
rtAnno = "cleanup.cattle.io/rtUpgradeCluster"
def test_user_cant_delete_self(admin_mc):
client = admin_mc.client
with pytest.rai... | 4,230 | 30.81203 | 79 | py |
rancher | rancher-master/tests/integration/suite/test_kontainer_engine_config.py | from .common import random_str
def test_gke_config_appears_correctly(admin_mc, remove_resource):
cluster = admin_mc.client.create_cluster(
name=random_str(), googleKubernetesEngineConfig={
"credentials": "bad credentials",
"nodeCount": 3
})
remove_resource(cluster)
... | 5,639 | 34.25 | 78 | py |
rancher | rancher-master/tests/integration/suite/test_settings.py | import pytest
from rancher import ApiError
from .common import random_str
from .conftest import wait_until
# cacerts is readOnly, and should not be able to be set through the API
def test_create_read_only(admin_mc, remove_resource):
client = admin_mc.client
with pytest.raises(ApiError) as e:
client.c... | 3,367 | 30.185185 | 79 | py |
rancher | rancher-master/tests/integration/suite/test_project_resource_quota.py | import pytest
from .common import random_str
import time
from rancher import ApiError
def ns_default_quota():
return {"limit": {"pods": "4"}}
def ns_quota():
return {"limit": {"pods": "4"}}
def ns_small_quota():
return {"limit": {"pods": "1"}}
def ns_large_quota():
return {"limit": {"pods": "200... | 19,291 | 38.859504 | 79 | py |
rancher | rancher-master/tests/integration/suite/test_cluster.py | import kubernetes
from .common import random_str
from .conftest import wait_for, kubernetes_api_client
from kubernetes.client import CustomObjectsApi
from kubernetes.client.rest import ApiException
def test_cluster_node_count(admin_mc, remove_resource,
raw_remove_custom_resource):
"""T... | 3,167 | 33.064516 | 79 | py |
rancher | rancher-master/tests/integration/suite/test_dynamic_schemas.py | import copy
import pytest
from .conftest import wait_for
@pytest.mark.nonparallel
def test_dynamic_schemas_update(request, admin_mc):
assert not schema_has_field(admin_mc)
eks_schema = admin_mc.client.by_id_dynamicSchema(
'amazonelasticcontainerserviceconfig')
new_field = copy.deepcopy(eks_sche... | 1,610 | 31.22 | 73 | py |
rancher | rancher-master/tests/integration/suite/test_catalog.py | import pytest
import time
from rancher import ApiError
from .common import wait_for_template_to_be_created, \
wait_for_template_to_be_deleted, random_str, wait_for_atleast_workload
from .conftest import set_server_version, wait_for, DEFAULT_CATALOG
def test_catalog(admin_mc, remove_resource):
client = admin_m... | 16,016 | 37.970803 | 78 | py |
rancher | rancher-master/tests/integration/suite/test_tokens.py | import pytest
import rancher
import requests
import time
from .conftest import BASE_URL, AUTH_URL, protect_response
def test_certificates(admin_mc):
client = admin_mc.client
tokens = client.list_token()
currentCount = 0
for t in tokens:
if t.current:
assert t.userId == admin_mc.u... | 3,154 | 27.169643 | 78 | py |
rancher | rancher-master/tests/integration/suite/test_alert.py | import pytest
from rancher import ApiError
from .common import random_str
from .conftest import wait_for
from .alert_common import MockReceiveAlert
dingtalk_config = {
"type": "/v3/schemas/dingtalkConfig",
"url": "http://127.0.0.1:4050/dingtalk/test/",
}
microsoft_teams_config = {
"type": "/v3/schemas/msT... | 2,622 | 30.60241 | 78 | py |
rancher | rancher-master/tests/validation/tests/common.py | import os
import random
import time
CATTLE_TEST_URL = os.environ.get('CATTLE_TEST_URL', "")
ADMIN_TOKEN = os.environ.get('ADMIN_TOKEN', "None")
USER_TOKEN = os.environ.get('USER_TOKEN', "None")
CLUSTER_NAME = os.environ.get("RANCHER_CLUSTER_NAME", "")
DEFAULT_TIMEOUT = 120
def random_int(start, end):
return rand... | 1,082 | 23.613636 | 70 | py |
rancher | rancher-master/tests/validation/tests/__init__.py | 0 | 0 | 0 | py | |
rancher | rancher-master/tests/validation/tests/kubernetes_conformance/conftest.py | import os
import pytest
import random
from lib.aws import AmazonWebServices
from lib.rke_client import RKEClient
from lib.kubectl_client import KubectlClient
CLOUD_PROVIDER = os.environ.get("CLOUD_PROVIDER", 'AWS')
TEMPLATE_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'resources/rke_template... | 994 | 24.512821 | 75 | py |
rancher | rancher-master/tests/validation/tests/kubernetes_conformance/test_rke_k8s_conformance.py | import os
import time
from .conftest import * # NOQA
from tests.rke.common import create_rke_cluster, delete_nodes
KUBE_CONFIG_PATH = os.environ.get(
'KUBE_CONFIG_PATH', 'kube_config_cluster.yml')
CONFORMANCE_DONE = "no-exit was specified, sonobuoy is now blocking"
def extract_file_results_path(logs):
log... | 2,402 | 32.84507 | 79 | py |
rancher | rancher-master/tests/validation/tests/kubernetes_conformance/__init__.py | 0 | 0 | 0 | py | |
rancher | rancher-master/tests/validation/tests/rke/test_install_rbac.py | from .conftest import * # NOQA
from .common import * # NOQA
@pytest.mark.skip("Use as an example of how to test RBAC")
def test_install_rbac_1(test_name, cloud_provider, rke_client, kubectl):
"""
Create a three node cluster and runs validation to create pods
Removes cluster and validates components are ... | 3,017 | 43.382353 | 78 | py |
rancher | rancher-master/tests/validation/tests/rke/conftest.py | import os
import pytest
import random
from lib.aws import AmazonWebServices
from lib.rke_client import RKEClient
from lib.kubectl_client import KubectlClient
CLOUD_PROVIDER = os.environ.get("CLOUD_PROVIDER", 'AWS')
TEMPLATE_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'resources/rke_template... | 994 | 24.512821 | 75 | py |
rancher | rancher-master/tests/validation/tests/rke/test_upgrade.py | import os
from .conftest import * # NOQA
from .common import * # NOQA
import pytest
K8S_PREUPGRADE_IMAGE = os.environ.get(
'RANCHER_K8S_PREUPGRADE_IMAGE', 'v1.16.8-rancher1-3')
K8S_UPGRADE_IMAGE = os.environ.get(
'RANCHER_K8S_UPGRADE_IMAGE', 'v1.17.4-rancher1-3')
def test_upgrade_1(test_name, cloud_provid... | 6,472 | 38.230303 | 78 | py |
rancher | rancher-master/tests/validation/tests/rke/test_install_roles.py | from .conftest import * # NOQA
from .common import * # NOQA
def test_install_roles_1(test_name, cloud_provider, rke_client, kubectl):
"""
Create cluster with single node with roles controlplane, worker, etcd
"""
rke_template = 'cluster_install_roles_1.yml.j2'
nodes = cloud_provider.create_multip... | 1,800 | 33.634615 | 73 | py |
rancher | rancher-master/tests/validation/tests/rke/test_update_roles.py | from .conftest import * # NOQA
from .common import * # NOQA
def test_update_roles_1(test_name, cloud_provider, rke_client, kubectl):
"""
Update cluster adding a worker node
Before Update: Create three node cluster, each node with a single role
node0 - controlplane
node1 - etcd
node2 - worker... | 21,968 | 38.300537 | 79 | py |
rancher | rancher-master/tests/validation/tests/rke/common.py | import time
import os
import json
k8s_resource_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"resources/k8s_ymls/")
# Global expectedimagesdict declared to store the images for a specific
# k8s Version
expectedimagesdict = {}
def create_and_validate(
cloud_provid... | 25,659 | 39.601266 | 80 | py |
rancher | rancher-master/tests/validation/tests/rke/__init__.py | 0 | 0 | 0 | py | |
rancher | rancher-master/tests/validation/tests/rke/test_remove_cluster.py | from .conftest import * # NOQA
from .common import * # NOQA
def test_remove_1(test_name, cloud_provider, rke_client, kubectl):
"""
Create a three node cluster and runs validation to create pods
Removes cluster and validates components are removed
Then creates new cluster on the same nodes and valida... | 718 | 31.681818 | 66 | py |
rancher | rancher-master/tests/validation/tests/rke/test_install_config.py | from .conftest import * # NOQA
from .common import * # NOQA
def test_install_config_1(test_name, cloud_provider, rke_client, kubectl):
"""
Node Address specified as just IP and using only this in the node spec
Specific kubernetes_version can be used
"""
rke_template = 'cluster_install_config_11.... | 4,984 | 35.654412 | 77 | py |
rancher | rancher-master/tests/validation/tests/v1_api/test_fleet.py | from .common import * # NOQA
import pytest
namespace = {'client': None, 'cluster': None}
def test_fleet_simple():
client = namespace['client']
template = read_json_from_resource_dir("fleet_1.json")
name = random_name()
# set name
template['metadata']['name'] = name
# set target
cluster_... | 2,426 | 33.671429 | 83 | py |
rancher | rancher-master/tests/validation/tests/v1_api/test_deployment.py | from .common import * # NOQA
import pytest
namespace = {"client": None, "ns": None}
def test_namespace_create():
template = read_yaml_from_resource_dir("namespace.yaml")
template["metadata"]["name"] = random_test_name()
client = namespace["client"]
res = client.create_namespace(template)
# valid... | 2,920 | 35.5125 | 83 | py |
rancher | rancher-master/tests/validation/tests/v1_api/test_monitoring_v2.py | from .common import * # NOQA
import pytest
import requests
import semver
namespace = {'client': None,
'cluster': None,
'rancher_catalog': None,
'project': None}
m_chart_name = 'rancher-monitoring'
m_version = os.environ.get('RANCHER_MONITORING_V2_VERSION', None)
m_app = 'cattle-... | 5,400 | 36.769231 | 93 | py |
rancher | rancher-master/tests/validation/tests/v1_api/common.py | from ..common import * # NOQA
import pprint
import json
import yaml
import rancher
TEST_IMAGE_V1 = os.environ.get('RANCHER_TEST_IMAGE_V1', "ranchertest/mytestcontainer")
def get_admin_client_v1():
url = CATTLE_TEST_URL + "/v1"
# in fact, we get the cluster client for the local cluster
return rancher.Cli... | 2,559 | 31 | 86 | py |
rancher | rancher-master/tests/validation/tests/v1_api/__init__.py | 0 | 0 | 0 | py | |
rancher | rancher-master/tests/validation/tests/v1_api/test_daemonset.py | from .common import * # NOQA
import pytest
namespace = {"client": None, "ns": None}
def test_daemonset():
client = namespace["client"]
ns = namespace["ns"]
template = read_json_from_resource_dir("daemonset_1.json")
name = random_name()
# set name
template["metadata"]["name"] = name
# set... | 2,561 | 34.583333 | 82 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_ad_custom_filter.py | from .common import * # NOQA
import requests
AUTH_PROVIDER = os.environ.get('RANCHER_AUTH_PROVIDER', "")
'''
Prerequisite:
Enable AD without TLS, and using testuser1 as admin user.
Description:
In this test, we are testing the customized user and group search filter
functionalities.
1) For customized user search ... | 6,151 | 36.284848 | 77 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_windows_cluster.py | from .common import TEST_IMAGE
from .common import TEST_IMAGE_NGINX
from .common import TEST_IMAGE_OS_BASE
from .common import cluster_cleanup
from .common import get_user_client
from .common import random_test_name
from .test_rke_cluster_provisioning import create_custom_host_from_nodes
from .test_rke_cluster_provisio... | 2,495 | 35.705882 | 85 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_volumes.py | import pytest
from rancher import ApiError
from .common import * # NOQA
namespace = {"p_client": None,
"ns": None,
"cluster": None,
"project": None,
"pv": None,
"pvc": None}
# this is the path to the mounted dir in the pod(workload)
MOUNT_PATH = "/var/... | 22,060 | 39.257299 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_logging.py | import pytest
import requests
import base64
import time
from .common import random_test_name, get_user_client
from .common import get_user_client_and_cluster
from .common import create_project_and_ns
from .common import get_project_client_for_token
from .common import create_kubeconfig
from .common import wait_for_app_... | 11,139 | 36.635135 | 149 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_deploy_clusters.py | from .common import * # NOQA
from .test_aks_cluster import get_aks_version, create_and_validate_aks_cluster
from .test_eks_cluster import EKS_K8S_VERSIONS, create_and_validate_eks_cluster
from .test_gke_cluster import get_gke_config, \
create_and_validate_gke_cluster, get_gke_version_credentials
from .test_rke_clu... | 6,871 | 34.791667 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_istio.py | import copy
import os
import re
import pytest
import time
from subprocess import CalledProcessError
from rancher import ApiError
from .test_auth import enable_ad, load_setup_data
from .common import add_role_to_user
from .common import auth_get_user_token
from .common import auth_resource_cleanup
from .common impor... | 39,244 | 36.844744 | 115 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_cli.py | import ast
import os
import pytest
from .test_rke_cluster_provisioning import (create_and_validate_custom_host,
cluster_cleanup)
from .cli_objects import RancherCli
from .common import (ADMIN_TOKEN, USER_TOKEN, CATTLE_TEST_URL, CLUSTER_NAME,
DATA_SUBDIR,... | 19,770 | 41.065957 | 81 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_group_grb.py | from .test_auth import enable_ad, load_setup_data
from .common import * # NOQA
from rancher import ApiError
import pytest
import requests
'''
Prerequisite:
- Enable Auth
- Optional: searching nested group enabled
- All users used for testing global group role binding should not be used
to create the... | 11,936 | 37.015924 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_nfs.py | import pytest
from .common import * # NOQA
namespace = {"p_client": None,
"ns": None,
"cluster": None,
"project": None,
"pv": None,
"pvc": None}
# this is the path to the mounted dir in the NFS server
NFS_SERVER_MOUNT_PATH = "/nfs"
# this is the path t... | 6,549 | 34.79235 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_kdm_changes.py | from copy import deepcopy
import os
import ast
import requests
from .common import json
from .common import CATTLE_API_URL
from .common import create_config_file
from .common import CATTLE_TEST_URL
from .common import ADMIN_TOKEN
from .common import get_setting_value_by_name
from .common import get_user_client
from .co... | 8,779 | 39.091324 | 94 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_v2_cis_scan.py | import pytest
import os
from .common import USER_TOKEN
from .common import get_cluster_client_for_token_v1
from .common import execute_kubectl_cmd
from .common import get_user_client_and_cluster
from .common import wait_until_app_v2_deployed
from .common import check_v2_app_and_uninstall
CIS_CHART_VERSION = os.environ... | 3,108 | 33.544444 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/conftest.py | import urllib3
from .common import * # NOQA
# This stops ssl warnings for insecure certs
urllib3.disable_warnings()
def pytest_configure(config):
if TEST_RBAC and CATTLE_TEST_URL:
rbac_prepare()
if AUTH_PROVIDER != "":
prepare_auth_data()
def pytest_unconfigure(config):
if TEST_RBAC an... | 1,155 | 23.083333 | 78 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_auth.py | import json
import os
import pytest
import requests
from .common import ADMIN_TOKEN
from .common import AUTH_PROVIDER
from .common import AUTH_USER_PASSWORD
from .common import CATTLE_TEST_URL
from .common import cluster_cleanup
from .common import create_project_and_ns
from .common import get_admin_client
from .commo... | 33,106 | 38.319477 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_node_annotation.py | import pytest
import time
from .common import create_kubeconfig
from .common import CLUSTER_MEMBER
from .common import CLUSTER_OWNER
from .common import PROJECT_MEMBER
from .common import PROJECT_OWNER
from .common import PROJECT_READ_ONLY
from .common import get_client_for_token
from .common import get_node_details
fr... | 28,779 | 33.716526 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_pipeline.py | import pytest
import time
import urllib
import re
from .common import CATTLE_TEST_URL
from .common import USER_TOKEN
from .common import DNS_REGEX
from .common import create_connection
from .common import create_kubeconfig
from .common import create_project_and_ns
from .common import get_cluster_client_for_token
from ... | 4,525 | 35.208 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_import_k3s_cluster.py | from python_terraform import * # NOQA
from .common import * # NOQA
RANCHER_REGION = os.environ.get("AWS_REGION")
RANCHER_VPC_ID = os.environ.get("AWS_VPC")
RANCHER_SUBNETS = os.environ.get("AWS_SUBNET")
RANCHER_AWS_SG = os.environ.get("AWS_SECURITY_GROUPS")
RANCHER_AVAILABILITY_ZONE = os.environ.get("AWS_AVAILABILITY... | 13,346 | 43.342193 | 100 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_upgrade.py | import base64
import pytest
from .common import * # NOQA
from .test_secrets import (
create_and_validate_workload_with_secret_as_env_variable,
create_and_validate_workload_with_secret_as_volume,
validate_workload_with_secret,
create_secret)
from .test_service_discovery import create_dns_record
clust... | 26,680 | 35.153117 | 81 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_monitoring.py | import pytest
import copy
from .common import * # NOQA
namespace = {
"cluster": None,
"project": None,
"system_project": None,
"system_project_client": None
}
cluster_query_template = {
"obj": None,
"action_name": "query",
"filters": {},
"metricParams": {},
"interval": "5s",
... | 31,604 | 37.636919 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_run_sonobuoy.py | import base64
import os
import time
from .common import *
RANCHER_SONOBUOY_VERSION = os.environ.get("RANCHER_SONOBUOY_VERSION", "0.18.2")
RANCHER_K8S_VERSION = os.environ.get("RANCHER_K8S_VERSION", "v1.18.2")
RANCHER_SONOBUOY_MODE = os.environ.get("RANCHER_SONOBUOY_MODE",
"certif... | 2,309 | 32.970588 | 156 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_helm_v3.py | from .common import * # NOQA
import pytest
CATALOG_NAME = random_test_name("test-v3")
CATALOG_URL = "https://github.com/rancher/integration-test-charts.git"
BRANCH = "validation-tests"
MYSQL_EXTERNALID_131 = \
create_catalog_external_id(CATALOG_NAME, "mysql", "1.3.1")
MYSQL_EXTERNALID_132 = \
create_catalog_e... | 6,041 | 33.525714 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_bkp_restore_s3_with_iam.py | import pytest
from .common import * # NOQA
from .test_rke_cluster_provisioning import rke_config, engine_install_url, \
validate_rke_dm_host_2
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None,
"nodes": []}
backup_info = {"backupname": None, "backup_id": None, "workload": No... | 3,289 | 31.9 | 76 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_vmwarevsphere_driver.py | import pytest, copy
from .common import * # NOQA
RANCHER_VSPHERE_USERNAME = os.environ.get("RANCHER_VSPHERE_USERNAME", "")
RANCHER_VSPHERE_PASSWORD = os.environ.get("RANCHER_VSPHERE_PASSWORD", "")
RANCHER_VSPHERE_VCENTER = os.environ.get("RANCHER_VSPHERE_VCENTER", "")
RANCHER_VSPHERE_VCENTER_PORT = \
os.environ.g... | 7,582 | 31.82684 | 84 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_secrets.py | import base64
from rancher import ApiError
import pytest
from .common import * # NOQA
CLUSTER_NAME = os.environ.get("CLUSTER_NAME", "")
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
def test_secret_create_all_ns():
"""
Verify creation of secrets is functional
"""
p... | 28,809 | 35.700637 | 113 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_network_policy.py | import pytest
from .common import * # NOQA
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
random_password = random_test_name("pass")
PROJECT_ISOLATION = os.environ.get('RANCHER_PROJECT_ISOLATION', "disabled")
def test_connectivity_between_pods():
p_client = namespace["p_client"]
... | 3,394 | 38.022989 | 78 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_service_discovery.py | """
This file contains tests for service discovery.
This file also has rbac tests based on different roles
Test requirement:
Below Env variables need to set
CATTLE_TEST_URL - url to rancher server
ADMIN_TOKEN - Admin token from rancher
USER_TOKEN - User token from rancher
RANCHER_CLUSTER_NAME - Cluster name to run test... | 21,594 | 35.91453 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_rke_cluster_provisioning.py | from threading import Thread
import pytest
from .common import * # NOQA
from rancher import ApiError
K8S_VERSION = os.environ.get('RANCHER_K8S_VERSION', "")
K8S_VERSION_UPGRADE = os.environ.get('RANCHER_K8S_VERSION_UPGRADE', "")
POD_SECURITY_POLICY_TEMPLATE = \
os.environ.get('RANCHER_POD_SECURITY_POLICY_TEMPLATE... | 43,156 | 34.964167 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_global_role.py | from .common import * # NOQA
from rancher import ApiError
import pytest
# values used to create a catalog
BRANCH = "dev"
URL = "https://git.rancher.io/system-charts"
def test_global_role_create_1(remove_resource):
""" test that admin can create a new global role, assign it
to a standard user, then the user ... | 14,873 | 34.414286 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_import_rke2_cluster.py | from python_terraform import * # NOQA
from .common import * # NOQA
RANCHER_AWS_AMI = os.environ.get("AWS_AMI", "")
RANCHER_AWS_USER = os.environ.get("AWS_USER", "ubuntu")
RANCHER_REGION = os.environ.get("AWS_REGION")
RANCHER_VPC_ID = os.environ.get("AWS_VPC")
RANCHER_SUBNETS = os.environ.get("AWS_SUBNET")
RANCHER_A... | 10,535 | 43.455696 | 93 | py |
rancher | rancher-master/tests/validation/tests/v3_api/cli_objects.py | import os
import time
import subprocess
from pathlib import Path
from .common import get_user_client, random_test_name, \
DATA_SUBDIR, run_command, random_str
from .cli_common import DEFAULT_TIMEOUT, BaseCli
class RancherCli(BaseCli):
def __init__(self, url, token, context):
self.login(url, token, co... | 19,131 | 43.596737 | 83 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_gke_cluster.py | from .common import * # NOQA
import requests
import pytest
CREDENTIALS = os.environ.get('RANCHER_GKE_CREDENTIAL', "")
GKE_MASTER_VERSION = os.environ.get('RANCHER_GKE_MASTER_VERSION', "")
gkecredential = pytest.mark.skipif(not CREDENTIALS, reason='GKE Credentials '
'not provided, ... | 3,791 | 34.111111 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_rke2_airgap.py | import os
import time
from lib.aws import AWS_USER
from .common import AmazonWebServices
from .test_airgap import (AG_HOST_NAME, BASTION_ID, NUMBER_OF_INSTANCES,
add_cleaned_images, get_bastion_node,
run_command_on_airgap_node, setup_ssh_key,
... | 9,357 | 43.990385 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_import_cluster.py | import os
from lib.aws import AmazonWebServices
from .common import get_user_client
from .common import run_command
from .common import random_test_name
from .common import run_command_with_stderr
from .common import create_custom_host_registration_token
from .common import validate_cluster
from .common import cluster_... | 5,051 | 35.875912 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_custom_host_reg.py | from .test_auth import enable_ad, load_setup_data, enable_openldap, \
OPENLDAP_AUTH_USER_PASSWORD, enable_freeipa, FREEIPA_AUTH_USER_PASSWORD
from .common import * # NOQA
import ast
AGENT_REG_CMD = os.environ.get('RANCHER_AGENT_REG_CMD', "")
HOST_COUNT = int(os.environ.get('RANCHER_HOST_COUNT', 1))
HOST_NAME = os... | 8,698 | 43.15736 | 101 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_catalog_library.py | """
This file has tests to deploy apps in a project created in a cluster.
Test requirements:
Env variables - Cattle_url, Admin Token, User Token, Cluster Name
Test on at least 3 worker nodes
App versions are given in 'cataloglib_appversion.json' file
"""
import json
from .common import os
from .common import pytest
f... | 3,620 | 36.71875 | 77 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_aks_cluster.py | from .common import * # NOQA
import pytest
import requests
AKS_CLUSTER_VERSION = os.environ.get('RANCHER_AKS_CLUSTER_VERSION', '')
SSH_KEY = os.environ.get('RANCHER_SSH_KEY', "")
SUBSCRIPTION_ID = os.environ.get('RANCHER_AKS_SUBSCRIPTION_ID', '')
TENANT_ID = os.environ.get('RANCHER_AKS_TENANT_ID', '')
CLIENT_ID = os... | 3,647 | 34.417476 | 78 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_certificate.py | """
This test suite contains tests to validate certificate create/edit/delete with
different possible way and with different roles of users.
Test requirement:
Below Env variables need to be set
CATTLE_TEST_URL - url to rancher server
ADMIN_TOKEN - Admin token from rancher
USER_TOKEN - User token from rancher
RANCHER_CL... | 34,024 | 42.51023 | 80 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_sa.py | import pytest
from .common import * # NOQA
do_test_sa = \
ast.literal_eval(os.environ.get('RANCHER_SA_CHECK', "True"))
if_test_sa = pytest.mark.skipif(
do_test_sa is not True,
reason="This test should not be executed on imported clusters")
@if_test_sa
def test_sa_for_user_clusters():
cmd = "get se... | 737 | 26.333333 | 67 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_bkp_restore_local.py | import pytest
from rancher import ApiError
from .common import * # NOQA
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None,
"nodes": []}
backup_info = {"backupname": None, "backup_id": None, "workload": None,
"backupfilename": None, "etcdbackupdata": None}
rbac_ro... | 6,579 | 37.934911 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_configmaps.py | from .common import * # NOQA
from rancher import ApiError
CLUSTER_NAME = os.environ.get("CLUSTER_NAME", "")
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
def test_cmap_create_single_ns_volume():
"""
Create a configmap.Create and validate workload using
the configmap as a... | 19,443 | 34.808471 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_eks_cluster.py | from .common import * # NOQA
import pytest
EKS_ACCESS_KEY = os.environ.get('RANCHER_EKS_ACCESS_KEY', "")
EKS_SECRET_KEY = os.environ.get('RANCHER_EKS_SECRET_KEY', "")
EKS_AMI = os.environ.get('RANCHER_EKS_AMI', "")
EKS_REGION = os.environ.get('RANCHER_EKS_REGION', "us-west-2")
EKS_K8S_VERSION = os.environ.get('RANCHE... | 2,230 | 31.333333 | 116 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_node_label.py | import pytest
import time
from .common import create_kubeconfig
from .common import CLUSTER_MEMBER
from .common import CLUSTER_OWNER
from .common import PROJECT_MEMBER
from .common import PROJECT_OWNER
from .common import PROJECT_READ_ONLY
from .common import get_client_for_token
from .common import delete_node
from .c... | 42,943 | 35.424088 | 88 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_airgap.py | import base64
import os
import pytest
import re
import time
from lib.aws import AWS_USER
from .common import (
ADMIN_PASSWORD, AmazonWebServices, run_command, wait_for_status_code,
TEST_IMAGE, TEST_IMAGE_NGINX, TEST_IMAGE_OS_BASE, readDataFile,
DEFAULT_CLUSTER_STATE_TIMEOUT
)
from .test_custom_host_reg impo... | 33,676 | 42.623057 | 84 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_multi_cluster_app.py | from .common import create_catalog_external_id
from .common import create_project_and_ns
from .common import get_admin_client
from .common import get_defaut_question_answers
from .common import get_project_client_for_token
from .common import get_user_client
from .common import get_user_client_and_cluster
from .test_rk... | 24,783 | 39.965289 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_registry.py | """
This file contains test related to add registry and
deploying workloads with those registry.
Test requirement:
Below Env variables need to set
CATTLE_TEST_URL - url to rancher server
ADMIN_TOKEN - Admin token from rancher
USER_TOKEN - User token from rancher
RANCHER_CLUSTER_NAME - Cluster name to run test on
RANCHE... | 20,831 | 37.223853 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_create_ha.py | from python_terraform import * # NOQA
from pkg_resources import packaging
from .common import * # NOQA
from .test_boto_create_eks import get_eks_kubeconfig
from .test_import_k3s_cluster import create_multiple_control_cluster
from .test_rke_cluster_provisioning import rke_config
# RANCHER_HA_KUBECONFIG and RANCHER_HA... | 21,944 | 40.5625 | 108 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_k8s_version_networkmodes.py | from lib.aws import AmazonWebServices
from .common import * # NOQA
k8s_version = "v1.10.1-rancher1"
rke_config = {"authentication": {"type": "authnConfig", "strategy": "x509"},
"ignoreDockerVersion": False,
"type": "rancherKubernetesEngineConfig"}
RANCHER_CLEANUP_CLUSTER = os.environ.get(... | 2,291 | 33.208955 | 77 | py |
rancher | rancher-master/tests/validation/tests/v3_api/common.py | from ..common import * # NOQA
import inspect
import json
import os
import random
import subprocess
import ssl
import time
import requests
import ast
import paramiko
import rancher
import pytest
from urllib.parse import urlparse
from rancher import ApiError
from lib.aws import AmazonWebServices
from copy import deepcop... | 109,519 | 35.912706 | 117 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_app.py | from .common import * # NOQA
import pytest
from .test_rbac import create_user
from .test_rke_cluster_provisioning import create_and_validate_custom_host
project_detail = {"cluster1": {"project1": None, "namespace1": None,
"project2": None, "namespace2": None,
... | 33,155 | 39.189091 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_bkp_restore_s3_with_creds.py | import pytest
from .common import * # NOQA
from .test_rke_cluster_provisioning import rke_config, validate_rke_dm_host_2,\
node_template_linode
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None,
"nodes": []}
backup_info = {"backupname": None, "backup_id": None, "workload": N... | 2,332 | 33.308824 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_cert_rotation.py | import pytest
import datetime
import time
import os
import ast
from .common import rbac_get_user_token_by_role
from .common import get_client_for_token
from .common import get_user_client_and_cluster
from .common import validate_cluster_state
from .common import get_etcd_nodes
from rancher import ApiError
# Globals
#... | 6,593 | 31.323529 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_hpa.py | import pytest
from rancher import ApiError
from .common import * # NOQA
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
def test_create_hpa():
p_client = namespace["p_client"]
ns = namespace["ns"]
hpa, workload = create_hpa(p_client, ns)
p_client.delete(hpa, workload)
... | 20,277 | 36.621521 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_ingress.py | """
This test suite contains tests to validate ingress create/edit/delete with
different possible way and with different roles of users.
Test requirement:
Below Env variables need to set
CATTLE_TEST_URL - url to rancher server
ADMIN_TOKEN - Admin token from rancher
USER_TOKEN - User token from rancher
RANCHER_CLUSTER_N... | 21,612 | 39.779245 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_cis_scan.py | import pytest
import requests
import time
from rancher import ApiError
from lib.aws import AmazonWebServices
from .common import CLUSTER_MEMBER, configure_cis_requirements
from .common import CLUSTER_OWNER
from .common import CIS_SCAN_PROFILE
from .common import cluster_cleanup
from .common import get_user_client
from ... | 17,915 | 37.119149 | 79 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_rbac.py | import pytest
from rancher import ApiError, Client
from .common import (
ADMIN_TOKEN,
CATTLE_API_URL,
assign_members_to_cluster,
assign_members_to_project,
change_member_role_in_cluster,
change_member_role_in_project,
create_ns,
create_project,
create_project_and_ns,
get_user_cl... | 12,635 | 37.290909 | 77 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_hosted_eks_cluster.py | import os
from .common import get_user_client
from .common import random_test_name
from .common import validate_cluster
from .common import wait_for_cluster_delete
from .test_create_ha import resource_prefix
from lib.aws import AmazonWebServices
import pytest
EKS_ACCESS_KEY = os.environ.get('RANCHER_EKS_ACCESS_KEY'... | 16,213 | 34.019438 | 84 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_logging_e2e.py | import time
import urllib
import pytest
from .common import CATTLE_TEST_URL
from .common import DEFAULT_TIMEOUT
from .common import USER_TOKEN
from .common import WebsocketLogParse
from .common import create_connection
from .common import create_kubeconfig
from .common import create_project_and_ns
from .common import... | 7,498 | 35.940887 | 102 | py |
rancher | rancher-master/tests/validation/tests/v3_api/__init__.py | 0 | 0 | 0 | py | |
rancher | rancher-master/tests/validation/tests/v3_api/test_boto_create_eks.py | import base64
from .common import run_command_with_stderr
from .test_eks_cluster import ekscredential
from .test_eks_cluster import \
DATA_SUBDIR, EKS_ACCESS_KEY, EKS_SECRET_KEY, EKS_REGION
from .test_rke_cluster_provisioning import evaluate_clustername
from lib.aws import AmazonWebServices
@ekscredential
def te... | 1,695 | 34.333333 | 77 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_workload.py | import pytest
from .common import * # NOQA
from rancher import ApiError
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
RBAC_ROLES = [CLUSTER_OWNER, PROJECT_MEMBER, PROJECT_OWNER,
PROJECT_READ_ONLY, CLUSTER_MEMBER]
WORKLOAD_TYPES = ["daemonSet", "statefulSet", "cronJob", "j... | 48,386 | 41.333333 | 84 | py |
rancher | rancher-master/tests/validation/tests/v3_api/test_bkp_restore_local_with_snapshot_check.py | import pytest
from .common import * # NOQA
from .test_rke_cluster_provisioning import create_and_validate_custom_host
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None,
"nodes": []}
backup_info = {"backupname": None, "backup_id": None, "workload": None,
"backupfil... | 1,780 | 35.346939 | 76 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.