1#!/usr/bin/env python3 2# coding=utf-8 3 4# 5# Copyright (c) 2020-2022 Huawei Device Co., Ltd. 6# Licensed under the Apache License, Version 2.0 (the "License"); 7# you may not use this file except in compliance with the License. 8# You may obtain a copy of the License at 9# 10# http://www.apache.org/licenses/LICENSE-2.0 11# 12# Unless required by applicable law or agreed to in writing, software 13# distributed under the License is distributed on an "AS IS" BASIS, 14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15# See the License for the specific language governing permissions and 16# limitations under the License. 17# 18 19from dataclasses import dataclass 20 21 22__all__ = ["Constant", "ComType", "HostDrivenTestType", 23 "ParserType", "DeviceLiteKernel", "CKit"] 24 25 26class Constant: 27 PRODUCT_PARAM_START = r"To Obtain Product Params Start" 28 PRODUCT_PARAM_END = r"To Obtain Product Params End" 29 TRUSTED_ROOT_CA = "trusted_root_ca.json" 30 TRUSTED_ROOT_CA_PATH = "/system/etc/security/trusted_root_ca.json" 31 TRUSTED_ROOT_CA_KEY = "C=CN, O=OpenHarmony, OU=OpenHarmony Team, CN=OpenHarmony Application Root CA" 32 TRUSTED_ROOT_CA_VAL = """-----BEGIN CERTIFICATE----- 33MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO 34MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh 35bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y 36MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD 37VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG 38A1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTB2MBAGByqGSM49 39AgEGBSuBBAAiA2IABE023XmRaw2DnO8NSsb+KG/uY0FtS3u5LQucdr3qWVnRW5ui 40QIL6ttNZBEeLTUeYcJZCpayg9Llf+1SmDA7dY4iP2EcRo4UN3rilovtfFfsmH4ty 413SApHVFzWUl+NwdH8KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC 42AQYwHQYDVR0OBBYEFBc6EKGrGXzlAE+s0Zgnsphadw7NMAwGCCqGSM49BAMDBQAD 43ZwAwZAIwd1p3JzHN93eoPped1li0j64npgqNzwy4OrkehYAqNXpcpaEcLZ7UxW8E 44I2lZJ3SbAjAkqySHb12sIwdSFKSN9KCMMEo/eUT5dUXlcKR2nZz0MJdxT5F51qcX 451CumzkcYhgU= 46-----END CERTIFICATE----- 47""" 48 49 50@dataclass 51class ComType(object): 52 """ 53 ComType enumeration 54 """ 55 cmd_com = "cmd" 56 deploy_com = "deploy" 57 58 59@dataclass 60class HostDrivenTestType(object): 61 """ 62 HostDrivenType enumeration 63 """ 64 device_test = "DeviceTest" 65 windows_test = "WindowsTest" 66 67 68@dataclass 69class ParserType: 70 ctest_lite = "CTestLite" 71 cpp_test_lite = "CppTestLite" 72 cpp_test_list_lite = "CppTestListLite" 73 open_source_test = "OpenSourceTest" 74 build_only_test = "BuildOnlyTestLite" 75 jsuit_test_lite = "JSUnitTestLite" 76 77 78@dataclass 79class DeviceLiteKernel(object): 80 """ 81 Lite device os enumeration 82 """ 83 linux_kernel = "linux" 84 lite_kernel = "lite" 85 86 87@dataclass 88class CKit: 89 push = "PushKit" 90 liteinstall = "LiteAppInstallKit" 91 command = "CommandKit" 92 config = "ConfigKit" 93 wifi = "WIFIKit" 94 propertycheck = 'PropertyCheckKit' 95 sts = 'STSKit' 96 shell = "ShellKit" 97 deploy = 'DeployKit' 98 mount = 'MountKit' 99 liteuikit = 'LiteUiKit' 100 rootfs = "RootFsKit" 101 liteshell = "LiteShellKit" 102 app_install = "AppInstallKit" 103 deploytool = "DeployToolKit" 104 query = "QueryKit" 105 component = "ComponentKit" 106 permission = "PermissionKit" 107 smartperf = "SmartPerfKit" 108