2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef SECURITY_MANAGER_TEST_INSTALLREQUEST
18 #define SECURITY_MANAGER_TEST_INSTALLREQUEST
22 #include <sys/types.h>
26 #include <security-manager.h>
28 namespace SecurityManagerTest {
34 InstallRequest(const InstallRequest&) = delete;
35 InstallRequest& operator=(const InstallRequest&) = delete;
38 void setAppId(const char *appId, lib_retcode expectedresult = SECURITY_MANAGER_SUCCESS);
39 void setPkgId(const char *pkgId, lib_retcode expectedresult = SECURITY_MANAGER_SUCCESS);
40 void addPrivilege(const char *privilege, lib_retcode expectedresult = SECURITY_MANAGER_SUCCESS);
41 void addPath(const char *path, app_install_path_type pathType,
42 lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
43 void setUid(const uid_t uid, lib_retcode expectedresult = SECURITY_MANAGER_SUCCESS);
45 const app_inst_req *get() const { return m_req; }
46 friend std::ostream& operator<<(std::ostream &, const InstallRequest&);
53 std::vector<std::string> m_privileges;
54 std::vector<std::pair<std::string, app_install_path_type> > m_paths;
55 std::pair<bool, uid_t> m_uid;
58 std::ostream& operator<<(std::ostream &os, const SecurityManagerTest::InstallRequest &request);
60 } // namespace SecurityManagerTest
62 #endif // SECURITY_MANAGER_TEST_INSTALLREQUEST