1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef APPSPAWN_TEST_STUB_H 17 #define APPSPAWN_TEST_STUB_H 18 19 #include <iostream> 20 21 struct HapDomainInfo { 22 std::string apl; 23 std::string packageName; 24 unsigned int hapFlags = 1; 25 }; 26 27 class HapContextStub { 28 public: 29 HapContextStub(); 30 ~HapContextStub(); 31 int HapDomainSetcontext(HapDomainInfo& hapDomainInfo); 32 }; 33 34 enum SeccompFilterType: int { 35 SYSTEM_SA, // system service process 36 SYSTEM_OTHERS, // HDF process and daemon process 37 APP, 38 INDIVIDUAL // process which need enable individual policy 39 }; 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 pid_t GetTestPid(void); 45 void SetHapDomainSetcontextResult(int result); 46 #ifdef __cplusplus 47 } 48 #endif 49 #endif // APPSPAWN_TEST_STUB_H 50