Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | """ lava_rpc_connector.py: |
| 4 | |
| 5 | class that extends xmlrpc in order to add LAVA specific functionality. |
| 6 | Used in managing communication with the back-end. """ |
| 7 | |
| 8 | from __future__ import print_function |
| 9 | |
| 10 | __copyright__ = """ |
| 11 | /* |
Xinyu Zhang | 82dab28 | 2022-10-09 16:33:19 +0800 | [diff] [blame] | 12 | * Copyright (c) 2018-2022, Arm Limited. All rights reserved. |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 13 | * |
| 14 | * SPDX-License-Identifier: BSD-3-Clause |
| 15 | * |
| 16 | */ |
| 17 | """ |
Karl Zhang | 08681e6 | 2020-10-30 13:56:03 +0800 | [diff] [blame] | 18 | |
| 19 | __author__ = "tf-m@lists.trustedfirmware.org" |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 20 | __project__ = "Trusted Firmware-M Open CI" |
Xinyu Zhang | 06286a9 | 2021-07-22 14:00:51 +0800 | [diff] [blame] | 21 | __version__ = "1.4.0" |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 22 | |
| 23 | import xmlrpc.client |
Paul Sokolovsky | 0c5e8da | 2024-03-06 12:18:02 +0700 | [diff] [blame] | 24 | import os |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 25 | import time |
Paul Sokolovsky | d042d9e | 2024-03-11 15:15:26 +0700 | [diff] [blame] | 26 | import json |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 27 | import yaml |
Matthew Hart | 4a4f120 | 2020-06-12 15:52:46 +0100 | [diff] [blame] | 28 | import requests |
| 29 | import shutil |
Paul Sokolovsky | 0c5e8da | 2024-03-06 12:18:02 +0700 | [diff] [blame] | 30 | import subprocess |
Paul Sokolovsky | b06bf6f | 2022-12-27 13:46:24 +0300 | [diff] [blame] | 31 | import logging |
| 32 | |
| 33 | |
| 34 | _log = logging.getLogger("lavaci") |
| 35 | |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 36 | |
| 37 | class LAVA_RPC_connector(xmlrpc.client.ServerProxy, object): |
| 38 | |
| 39 | def __init__(self, |
| 40 | username, |
| 41 | token, |
| 42 | hostname, |
| 43 | rest_prefix="RPC2", |
| 44 | https=False): |
| 45 | |
| 46 | # If user provides hostname with http/s prefix |
| 47 | if "://" in hostname: |
| 48 | htp_pre, hostname = hostname.split("://") |
| 49 | server_addr = "%s://%s:%s@%s/%s" % (htp_pre, |
| 50 | username, |
| 51 | token, |
| 52 | hostname, |
| 53 | rest_prefix) |
| 54 | self.server_url = "%s://%s" % (htp_pre, hostname) |
| 55 | else: |
| 56 | server_addr = "%s://%s:%s@%s/%s" % ("https" if https else "http", |
| 57 | username, |
| 58 | token, |
| 59 | hostname, |
| 60 | rest_prefix) |
| 61 | self.server_url = "%s://%s" % ("https" if https else "http", |
| 62 | hostname) |
| 63 | |
| 64 | self.server_job_prefix = "%s/scheduler/job/%%s" % self.server_url |
Milosz Wasilewski | 4c4190d | 2020-12-15 12:56:22 +0000 | [diff] [blame] | 65 | self.server_api = "%s/api/v0.2/" % self.server_url |
Matthew Hart | 4a4f120 | 2020-06-12 15:52:46 +0100 | [diff] [blame] | 66 | self.server_results_prefix = "%s/results/%%s" % self.server_url |
Matthew Hart | c6bbbf9 | 2020-08-19 14:12:07 +0100 | [diff] [blame] | 67 | self.token = token |
| 68 | self.username = username |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 69 | super(LAVA_RPC_connector, self).__init__(server_addr) |
| 70 | |
| 71 | def _rpc_cmd_raw(self, cmd, params=None): |
| 72 | """ Run a remote comand and return the result. There is no constrain |
| 73 | check on the syntax of the command. """ |
| 74 | |
| 75 | cmd = "self.%s(%s)" % (cmd, params if params else "") |
| 76 | return eval(cmd) |
| 77 | |
Paul Sokolovsky | d042d9e | 2024-03-11 15:15:26 +0700 | [diff] [blame] | 78 | @staticmethod |
| 79 | def is_tux_id(job_id): |
| 80 | job_id = str(job_id) |
| 81 | if job_id.isdigit() and len(job_id) < 22: |
| 82 | return False |
| 83 | else: |
| 84 | return True |
| 85 | |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 86 | def ls_cmd(self): |
| 87 | """ Return a list of supported commands """ |
| 88 | |
| 89 | print("\n".join(self.system.listMethods())) |
| 90 | |
Matthew Hart | 4a4f120 | 2020-06-12 15:52:46 +0100 | [diff] [blame] | 91 | def fetch_file(self, url, out_file): |
Matthew Hart | c6bbbf9 | 2020-08-19 14:12:07 +0100 | [diff] [blame] | 92 | auth_params = { |
| 93 | 'user': self.username, |
| 94 | 'token': self.token |
| 95 | } |
Paul Sokolovsky | 903bc43 | 2022-12-29 17:15:04 +0300 | [diff] [blame] | 96 | with requests.get(url, stream=True, params=auth_params) as r: |
| 97 | r.raise_for_status() |
| 98 | with open(out_file, 'wb') as f: |
| 99 | shutil.copyfileobj(r.raw, f) |
| 100 | return(out_file) |
Matthew Hart | 4a4f120 | 2020-06-12 15:52:46 +0100 | [diff] [blame] | 101 | |
Paul Sokolovsky | d042d9e | 2024-03-11 15:15:26 +0700 | [diff] [blame] | 102 | def get_job_results(self, job_id, job_info, yaml_out_file): |
| 103 | if self.is_tux_id(job_id): |
| 104 | results_url = job_info["extra"]["download_url"] + "lava-results.yaml" |
| 105 | else: |
| 106 | results_url = "{}/yaml".format(self.server_results_prefix % job_id) |
Matthew Hart | 4a4f120 | 2020-06-12 15:52:46 +0100 | [diff] [blame] | 107 | return(self.fetch_file(results_url, yaml_out_file)) |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 108 | |
Paul Sokolovsky | d042d9e | 2024-03-11 15:15:26 +0700 | [diff] [blame] | 109 | def get_job_definition(self, job_id, job_info, yaml_out_file=None): |
| 110 | if self.is_tux_id(job_id): |
| 111 | url = job_info["extra"]["download_url"] + job_info["extra"]["job_definition"] |
| 112 | with requests.get(url) as r: |
| 113 | r.raise_for_status() |
| 114 | job_def = r.text |
| 115 | else: |
| 116 | job_def = self.scheduler.jobs.definition(job_id) |
| 117 | |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 118 | if yaml_out_file: |
| 119 | with open(yaml_out_file, "w") as F: |
| 120 | F.write(str(job_def)) |
Paul Sokolovsky | f2f385d | 2022-01-11 00:36:31 +0300 | [diff] [blame] | 121 | def_o = yaml.safe_load(job_def) |
Xinyu Zhang | 82dab28 | 2022-10-09 16:33:19 +0800 | [diff] [blame] | 122 | return def_o |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 123 | |
Matthew Hart | 4a4f120 | 2020-06-12 15:52:46 +0100 | [diff] [blame] | 124 | def get_job_log(self, job_id, target_out_file): |
Paul Sokolovsky | d042d9e | 2024-03-11 15:15:26 +0700 | [diff] [blame] | 125 | if self.is_tux_id(job_id): |
| 126 | auth_headers = {} |
| 127 | log_url = "https://storage.tuxsuite.com/public/tfc/ci/tests/{job_id}/lava-logs.yaml".format( |
| 128 | job_id=job_id |
| 129 | ) |
| 130 | else: |
| 131 | auth_headers = {"Authorization": "Token %s" % self.token} |
| 132 | log_url = "{server_url}/jobs/{job_id}/logs/".format( |
| 133 | server_url=self.server_api, job_id=job_id |
| 134 | ) |
Fathi Boudra | c10378c | 2021-01-21 18:25:19 +0100 | [diff] [blame] | 135 | with requests.get(log_url, stream=True, headers=auth_headers) as r: |
Paul Sokolovsky | 903bc43 | 2022-12-29 17:15:04 +0300 | [diff] [blame] | 136 | r.raise_for_status() |
Fathi Boudra | c10378c | 2021-01-21 18:25:19 +0100 | [diff] [blame] | 137 | log_list = yaml.load(r.content, Loader=yaml.SafeLoader) |
| 138 | with open(target_out_file, "w") as target_out: |
| 139 | for line in log_list: |
| 140 | level = line["lvl"] |
| 141 | if (level == "target") or (level == "feedback"): |
| 142 | try: |
| 143 | target_out.write("{}\n".format(line["msg"])) |
| 144 | except UnicodeEncodeError: |
| 145 | msg = ( |
| 146 | line["msg"] |
| 147 | .encode("ascii", errors="replace") |
| 148 | .decode("ascii") |
| 149 | ) |
| 150 | target_out.write("{}\n".format(msg)) |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 151 | |
Matthew Hart | 4a4f120 | 2020-06-12 15:52:46 +0100 | [diff] [blame] | 152 | def get_job_config(self, job_id, config_out_file): |
Paul Sokolovsky | d042d9e | 2024-03-11 15:15:26 +0700 | [diff] [blame] | 153 | if self.is_tux_id(job_id): |
| 154 | return |
| 155 | |
Matthew Hart | 4a4f120 | 2020-06-12 15:52:46 +0100 | [diff] [blame] | 156 | config_url = "{}/configuration".format(self.server_job_prefix % job_id) |
| 157 | self.fetch_file(config_url, config_out_file) |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 158 | |
| 159 | def get_job_info(self, job_id, yaml_out_file=None): |
Paul Sokolovsky | d042d9e | 2024-03-11 15:15:26 +0700 | [diff] [blame] | 160 | if self.is_tux_id(job_id): |
| 161 | assert yaml_out_file is None |
| 162 | job_info = subprocess.check_output( |
| 163 | "python3 -u -m tuxsuite test get --json %s" % job_id, |
| 164 | shell=True, |
| 165 | ) |
| 166 | job_info = json.loads(job_info.decode()) |
| 167 | # Convert values to match LAVA output, as expected by |
| 168 | # the rest of code. |
| 169 | job_info["state"] = job_info["state"].capitalize() |
| 170 | job_info["health"] = {"pass": "Complete"}.get(job_info["result"], job_info["result"]) |
Paul Sokolovsky | 4ff31ab | 2024-03-21 13:36:31 +0700 | [diff] [blame] | 171 | # There's no "job_name" aka "description" in Tux data, but we utilize |
| 172 | # the fact that it's included in the original name of the job definition |
| 173 | # file, that info included in the Tux data. |
| 174 | job_info["description"] = job_info["extra"]["job_definition"].split("/", 1)[1].split(".", 1)[0] |
Paul Sokolovsky | d042d9e | 2024-03-11 15:15:26 +0700 | [diff] [blame] | 175 | return job_info |
| 176 | |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 177 | job_info = self.scheduler.jobs.show(job_id) |
| 178 | if yaml_out_file: |
| 179 | with open(yaml_out_file, "w") as F: |
| 180 | F.write(str(job_info)) |
| 181 | return job_info |
| 182 | |
| 183 | def get_error_reason(self, job_id): |
Matthew Hart | 2c2688f | 2020-05-26 13:09:20 +0100 | [diff] [blame] | 184 | try: |
| 185 | lava_res = self.results.get_testsuite_results_yaml(job_id, 'lava') |
Paul Sokolovsky | f2f385d | 2022-01-11 00:36:31 +0300 | [diff] [blame] | 186 | results = yaml.safe_load(lava_res) |
Matthew Hart | 2c2688f | 2020-05-26 13:09:20 +0100 | [diff] [blame] | 187 | for test in results: |
| 188 | if test['name'] == 'job': |
| 189 | return(test.get('metadata', {}).get('error_type', '')) |
| 190 | except Exception: |
| 191 | return("Unknown") |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 192 | |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 193 | def get_job_state(self, job_id): |
| 194 | return self.scheduler.job_state(job_id)["job_state"] |
| 195 | |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 196 | def cancel_job(self, job_id): |
| 197 | """ Cancell job with id=job_id. Returns True if successfull """ |
| 198 | |
| 199 | return self.scheduler.jobs.cancel(job_id) |
| 200 | |
| 201 | def validate_job_yaml(self, job_definition, print_err=False): |
| 202 | """ Validate a job definition syntax. Returns true is server considers |
| 203 | the syntax valid """ |
| 204 | |
| 205 | try: |
| 206 | with open(job_definition) as F: |
| 207 | input_yaml = F.read() |
| 208 | self.scheduler.validate_yaml(input_yaml) |
| 209 | return True |
| 210 | except Exception as E: |
| 211 | if print_err: |
| 212 | print(E) |
| 213 | return False |
| 214 | |
Matthew Hart | 110e1dc | 2020-05-27 17:18:55 +0100 | [diff] [blame] | 215 | def device_type_from_def(self, job_data): |
Paul Sokolovsky | f2f385d | 2022-01-11 00:36:31 +0300 | [diff] [blame] | 216 | def_yaml = yaml.safe_load(job_data) |
Matthew Hart | 110e1dc | 2020-05-27 17:18:55 +0100 | [diff] [blame] | 217 | return(def_yaml['device_type']) |
| 218 | |
| 219 | def has_device_type(self, job_data): |
| 220 | d_type = self.device_type_from_def(job_data) |
| 221 | all_d = self.scheduler.devices.list() |
| 222 | for device in all_d: |
| 223 | if device['type'] == d_type: |
| 224 | if device['health'] in ['Good', 'Unknown']: |
| 225 | return(True) |
| 226 | return(False) |
| 227 | |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 228 | def submit_job(self, job_definition): |
| 229 | """ Will submit a yaml definition pointed by job_definition after |
| 230 | validating it againist the remote backend. Returns resulting job id, |
| 231 | and server url for job""" |
| 232 | |
| 233 | try: |
| 234 | if not self.validate_job_yaml(job_definition): |
Paul Sokolovsky | 80b9b35 | 2024-03-05 16:38:41 +0700 | [diff] [blame] | 235 | _log.error("Server rejected job's syntax") |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 236 | raise Exception("Invalid job") |
| 237 | with open(job_definition, "r") as F: |
| 238 | job_data = F.read() |
| 239 | except Exception as e: |
| 240 | print("Cannot submit invalid job. Check %s's content" % |
| 241 | job_definition) |
| 242 | print(e) |
| 243 | return None, None |
Paul Sokolovsky | 0c5e8da | 2024-03-06 12:18:02 +0700 | [diff] [blame] | 244 | |
| 245 | device_type = self.device_type_from_def(job_data) |
| 246 | |
| 247 | if device_type == "fvp" and os.environ.get("USE_TUXSUITE_FVP", "0") == "1": |
| 248 | output = subprocess.check_output( |
| 249 | "python3 -u -m tuxsuite test submit --no-wait --device fvp-lava --job-definition %s" % job_definition, |
| 250 | shell=True, |
| 251 | ) |
| 252 | |
| 253 | job_id = job_url = None |
| 254 | for l in output.decode().split("\n"): |
| 255 | _log.debug(l) |
| 256 | if l.startswith("uid:"): |
| 257 | job_id = l.split(None, 1)[1].strip() |
| 258 | job_url = "https://tuxapi.tuxsuite.com/v1/groups/tfc/projects/ci/tests/" + job_id |
| 259 | return (job_id, job_url) |
| 260 | |
Dean Birch | a6ede7e | 2020-03-13 14:00:33 +0000 | [diff] [blame] | 261 | try: |
Dean Birch | 1d545c0 | 2020-05-29 14:09:21 +0100 | [diff] [blame] | 262 | if self.has_device_type(job_data): |
| 263 | job_id = self.scheduler.submit_job(job_data) |
| 264 | job_url = self.server_job_prefix % job_id |
| 265 | return(job_id, job_url) |
| 266 | else: |
| 267 | raise Exception("No devices online with required device_type") |
Dean Birch | a6ede7e | 2020-03-13 14:00:33 +0000 | [diff] [blame] | 268 | except Exception as e: |
Paul Sokolovsky | b2ca65b | 2024-03-11 15:07:34 +0700 | [diff] [blame] | 269 | _log.exception("Exception submitting job to LAVA", e) |
Dean Birch | a6ede7e | 2020-03-13 14:00:33 +0000 | [diff] [blame] | 270 | return(None, None) |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 271 | |
| 272 | def resubmit_job(self, job_id): |
| 273 | """ Re-submit job with provided id. Returns resulting job id, |
| 274 | and server url for job""" |
| 275 | |
| 276 | job_id = self.scheduler.resubmit_job(job_id) |
| 277 | job_url = self.server_job_prefix % job_id |
| 278 | return(job_id, job_url) |
| 279 | |
| 280 | def block_wait_for_job(self, job_id, timeout, poll_freq=1): |
| 281 | """ Will block code execution and wait for the job to submit. |
| 282 | Returns job status on completion """ |
| 283 | |
| 284 | start_t = int(time.time()) |
| 285 | while(True): |
| 286 | cur_t = int(time.time()) |
| 287 | if cur_t - start_t >= timeout: |
| 288 | print("Breaking because of timeout") |
| 289 | break |
| 290 | # Check if the job is not running |
Dean Arnold | f1169b9 | 2020-03-11 10:14:14 +0000 | [diff] [blame] | 291 | cur_status = self.get_job_state(job_id) |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 292 | # If in queue or running wait |
Dean Arnold | c1d81b4 | 2020-03-11 15:56:36 +0000 | [diff] [blame] | 293 | if cur_status not in ["Canceling","Finished"]: |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 294 | time.sleep(poll_freq) |
| 295 | else: |
| 296 | break |
Dean Arnold | c1d81b4 | 2020-03-11 15:56:36 +0000 | [diff] [blame] | 297 | return self.scheduler.job_health(job_id)["job_health"] |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 298 | |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 299 | def block_wait_for_jobs(self, job_ids, timeout, poll_freq=10): |
| 300 | """ Wait for multiple LAVA job ids to finish and return finished list """ |
| 301 | |
| 302 | start_t = int(time.time()) |
| 303 | finished_jobs = {} |
| 304 | while(True): |
| 305 | cur_t = int(time.time()) |
| 306 | if cur_t - start_t >= timeout: |
| 307 | print("Breaking because of timeout") |
| 308 | break |
| 309 | for job_id in job_ids: |
Paul Sokolovsky | fb298c6 | 2022-04-29 23:15:17 +0300 | [diff] [blame] | 310 | if job_id in finished_jobs: |
| 311 | continue |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 312 | # Check if the job is not running |
Paul Sokolovsky | 81ff0ad | 2022-12-29 21:47:01 +0300 | [diff] [blame] | 313 | try: |
| 314 | cur_status = self.get_job_info(job_id) |
Paul Sokolovsky | c82f933 | 2023-01-10 23:50:25 +0300 | [diff] [blame] | 315 | except (xmlrpc.client.ProtocolError, OSError) as e: |
Paul Sokolovsky | 81ff0ad | 2022-12-29 21:47:01 +0300 | [diff] [blame] | 316 | # There can be transient HTTP errors, e.g. "502 Proxy Error" |
Paul Sokolovsky | c82f933 | 2023-01-10 23:50:25 +0300 | [diff] [blame] | 317 | # or socket timeout. |
Paul Sokolovsky | 81ff0ad | 2022-12-29 21:47:01 +0300 | [diff] [blame] | 318 | # Just continue with the next job, the faulted one will be |
| 319 | # re-checked on next iteration. |
Paul Sokolovsky | c82f933 | 2023-01-10 23:50:25 +0300 | [diff] [blame] | 320 | _log.warning("block_wait_for_jobs: %r occurred, ignore and continue", e) |
Paul Sokolovsky | 81ff0ad | 2022-12-29 21:47:01 +0300 | [diff] [blame] | 321 | time.sleep(2) |
| 322 | continue |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 323 | # If in queue or running wait |
| 324 | if cur_status['state'] in ["Canceling","Finished"]: |
| 325 | cur_status['error_reason'] = self.get_error_reason(job_id) |
| 326 | finished_jobs[job_id] = cur_status |
Paul Sokolovsky | b06bf6f | 2022-12-27 13:46:24 +0300 | [diff] [blame] | 327 | _log.info( |
Paul Sokolovsky | 6e83a23 | 2024-03-11 15:30:04 +0700 | [diff] [blame] | 328 | "Job %s finished in %ds with state: %s, health: %s. Remaining: %d", |
Paul Sokolovsky | b7a41a9 | 2022-12-28 18:06:45 +0300 | [diff] [blame] | 329 | job_id, time.time() - start_t, |
| 330 | cur_status['state'], |
| 331 | cur_status['health'], |
Paul Sokolovsky | b06bf6f | 2022-12-27 13:46:24 +0300 | [diff] [blame] | 332 | len(job_ids) - len(finished_jobs) |
| 333 | ) |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 334 | if len(job_ids) == len(finished_jobs): |
| 335 | break |
| 336 | else: |
| 337 | time.sleep(poll_freq) |
| 338 | if len(job_ids) == len(finished_jobs): |
| 339 | break |
| 340 | return finished_jobs |
| 341 | |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 342 | def test_credentials(self): |
| 343 | """ Attempt to querry the back-end and verify that the user provided |
| 344 | authentication is valid """ |
| 345 | |
| 346 | try: |
| 347 | self._rpc_cmd_raw("system.listMethods") |
| 348 | return True |
| 349 | except Exception as e: |
| 350 | print(e) |
| 351 | print("Credential validation failed") |
| 352 | return False |
| 353 | |
| 354 | |
| 355 | if __name__ == "__main__": |
| 356 | pass |