Best Python code snippet using SeleniumBase
params.py
Source:params.py
...53java_home = config['hostLevelParams']['java_home']54java_version = int(config['hostLevelParams']['java_version'])55security_enabled = config['configurations']['cluster-env']['security_enabled']56if config is not None:57 kerberos_command_params = get_property_value(config, 'kerberosCommandParams')58 cluster_host_info = get_property_value(config, 'clusterHostInfo')59 if cluster_host_info is not None:60 kdc_server_hosts = get_property_value(cluster_host_info, 'kdc_server_hosts')61 if (kdc_server_hosts is not None) and (len(kdc_server_hosts) > 0):62 kdc_server_host = kdc_server_hosts[0]63 configurations = get_property_value(config, 'configurations')64 if configurations is not None:65 cluster_env = get_property_value(configurations, 'cluster-env')66 if cluster_env is not None:67 smoke_test_principal = get_property_value(cluster_env, 'smokeuser_principal_name', None, True, None)68 smoke_test_keytab_file = get_property_value(cluster_env, 'smokeuser_keytab', None, True, None)69 smoke_user = get_property_value(cluster_env, 'smokeuser', smoke_user, True, smoke_user)70 default_group = get_property_value(cluster_env, 'user_group')71 if default_group is None:72 default_group = get_property_value(cluster_env, 'user-group')73 # ##############################################################################################74 # Get krb5.conf template data75 # ##############################################################################################76 realm = 'EXAMPLE.COM'77 domains = ''78 kdc_host = 'localhost'79 admin_server_host = None80 admin_principal = None81 admin_password = None82 admin_keytab = None83 test_principal = None84 test_password = None85 test_keytab = None86 test_keytab_file = None87 encryption_types = None88 manage_krb5_conf = "true"89 krb5_conf_template = None90 krb5_conf_data = get_property_value(configurations, 'krb5-conf')91 kerberos_env = get_property_value(configurations, "kerberos-env")92 if kerberos_env is not None:93 manage_identities = get_property_value(kerberos_env, "manage_identities", "true", True, "true")94 encryption_types = get_property_value(kerberos_env, "encryption_types", None, True, None)95 realm = get_property_value(kerberos_env, "realm", None, True, None)96 kdc_host = get_property_value(kerberos_env, 'kdc_host', kdc_host)97 admin_server_host = get_property_value(kerberos_env, 'admin_server_host', admin_server_host)98 if krb5_conf_data is not None:99 realm = get_property_value(krb5_conf_data, 'realm', realm)100 domains = get_property_value(krb5_conf_data, 'domains', domains)101 admin_principal = get_property_value(krb5_conf_data, 'admin_principal', admin_principal, True, None)102 admin_password = get_property_value(krb5_conf_data, 'admin_password', admin_password, True, None)103 admin_keytab = get_property_value(krb5_conf_data, 'admin_keytab', admin_keytab, True, None)104 test_principal = get_property_value(krb5_conf_data, 'test_principal', test_principal, True, None)105 test_password = get_property_value(krb5_conf_data, 'test_password', test_password, True, None)106 test_keytab = get_property_value(krb5_conf_data, 'test_keytab', test_keytab, True, None)107 test_keytab_file = get_property_value(krb5_conf_data, 'test_keytab_file', test_keytab_file, True, None)108 krb5_conf_template = get_property_value(krb5_conf_data, 'content', krb5_conf_template)109 krb5_conf_dir = get_property_value(krb5_conf_data, 'conf_dir', krb5_conf_dir)110 krb5_conf_file = get_property_value(krb5_conf_data, 'conf_file', krb5_conf_file)111 krb5_conf_path = krb5_conf_dir + '/' + krb5_conf_file112 manage_krb5_conf = get_property_value(krb5_conf_data, 'manage_krb5_conf', "true")113 # ##############################################################################################114 # Get kdc.conf template data115 # ##############################################################################################116 kdcdefaults_kdc_ports = "88"117 kdcdefaults_kdc_tcp_ports = "88"118 kdc_conf_template = None119 kdc_conf_data = get_property_value(configurations, 'kdc-conf')120 if kdc_conf_data is not None:121 kdcdefaults_kdc_ports = get_property_value(kdc_conf_data, 'kdcdefaults_kdc_ports', kdcdefaults_kdc_ports)122 kdcdefaults_kdc_tcp_ports = get_property_value(kdc_conf_data, 'kdcdefaults_kdc_tcp_ports', kdcdefaults_kdc_tcp_ports)123 kdc_conf_template = get_property_value(kdc_conf_data, 'content', kdc_conf_template)124 kdc_conf_dir = get_property_value(kdc_conf_data, 'conf_dir', kdc_conf_dir)125 kdc_conf_file = get_property_value(kdc_conf_data, 'conf_file', kdc_conf_file)126 kdc_conf_path = kdc_conf_dir + '/' + kdc_conf_file127 # ##############################################################################################128 # Get kadm5.acl template data129 # ##############################################################################################130 kdcdefaults_kdc_ports = '88'131 kdcdefaults_kdc_tcp_ports = '88'132 kadm5_acl_template = None133 kadm5_acl_data = get_property_value(configurations, 'kadm5-acl')134 if kadm5_acl_data is not None:135 kadm5_acl_template = get_property_value(kadm5_acl_data, 'content', kadm5_acl_template)136 kadm5_acl_dir = get_property_value(kadm5_acl_data, 'conf_dir', kadm5_acl_dir)137 kadm5_acl_file = get_property_value(kadm5_acl_data, 'conf_file', kadm5_acl_file)138 kadm5_acl_path = kadm5_acl_dir + '/' + kadm5_acl_file139 # ################################################################################################140 # Get commandParams141 # ################################################################################################142 command_params = get_property_value(config, 'commandParams')143 if command_params is not None:144 keytab_details = get_unstructured_data(command_params, 'keytab')145 if manage_identities:146 smoke_test_principal = get_property_value(command_params, 'principal_name', smoke_test_principal)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!