Fix test-resource and permissions on platform v3.0
[platform/upstream/csr-framework.git] / test / test-resource.h
1 /*
2  *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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
15  */
16 /*
17  * @file        test-resource.h
18  * @author      Kyungwook Tak (k.tak@samsung.com)
19  * @version     1.0
20  * @brief       Test resoure name and paths
21  */
22 #pragma once
23
24 #include <string>
25
26 // Test data for content screening
27 #define TEST_FILE_NORMAL   TEST_DIR "/test_normal_file"
28 #define TEST_FILE_HIGH     TEST_DIR "/test_malware_file"
29 #define TEST_FILE_MEDIUM   TEST_DIR "/test_risky_file"
30 #define TEST_FILE_LOW      TEST_DIR "/test_generic_file"
31
32 #define TEST_DIR_MALWARES  TEST_DIR "/test_dir"
33 #define TEST_DIR_ROOT      "/"
34 #define TEST_DIR_TMP       "/tmp"
35 const char *TEST_DIR_MEDIA();
36 const char *TEST_DIR_APPS();
37
38 const char *TEST_FILE_MEDIA();
39 #define TEST_FILE_TMP_IN_DIR_MALWARES TEST_DIR_MALWARES "/tmp_malware_file"
40 #define TEST_FILE_TMP                 TEST_DIR_TMP "/test_malware_file"
41 #define TEST_FILE_NO_EXIST            TEST_DIR_TMP "/not_existing_file"
42
43 #define TEST_WGT_PKG_ID    "hFhcNcbE6K"
44 #define TEST_WGT_TYPE      "wgt"
45 #define TEST_WGT_PATH      TEST_RES_DIR "/" TEST_TARGET "/MaliciousWgt.wgt"
46 const char *TEST_WGT_APP_ROOT();
47 const char *TEST_WGT_MAL_FILE();
48
49 #define TEST_SAFE_WGT_PKG_ID   "q3JfX6RA5q"
50 #define TEST_SAFE_WGT_TYPE     "wgt"
51 #define TEST_SAFE_WGT_PATH     TEST_RES_DIR "/" TEST_TARGET "/non-malware.wgt"
52
53 #define TEST_TPK_PKG_ID    "org.example.malicioustpk"
54 #define TEST_TPK_TYPE      "tpk"
55 #define TEST_TPK_PATH      TEST_RES_DIR "/" TEST_TARGET "/MaliciousTpk.tpk"
56 const char *TEST_TPK_APP_ROOT();
57 const char *TEST_TPK_MAL_FILE();
58
59 const char *TEST_FAKE_APP_ROOT();
60 const char *TEST_FAKE_APP_FILE();
61
62 #define MALWARE_HIGH_NAME            "test_malware"
63 #define MALWARE_HIGH_SEVERITY        CSR_CS_SEVERITY_HIGH
64 #define MALWARE_HIGH_DETAILED_URL    "http://high.malware.com"
65 #define MALWARE_HIGH_SIGNATURE       "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
66
67 #define MALWARE_MEDIUM_NAME          "test_risk"
68 #define MALWARE_MEDIUM_SEVERITY      CSR_CS_SEVERITY_MEDIUM
69 #define MALWARE_MEDIUM_DETAILED_URL  "http://medium.malware.com"
70 #define MALWARE_MEDIUM_SIGNATURE     "RISKY_MALWARE"
71
72 #define MALWARE_LOW_NAME             "test_generic"
73 #define MALWARE_LOW_SEVERITY         CSR_CS_SEVERITY_LOW
74 #define MALWARE_LOW_DETAILED_URL     "http://low.malware.com"
75 #define MALWARE_LOW_SIGNATURE        "GENERIC_MALWARE"
76
77 // Test data for web protection
78 #define RISK_HIGH_RISK               CSR_WP_RISK_HIGH
79 #define RISK_HIGH_URL                "http://highrisky.test.com/abc/def"
80 #define RISK_HIGH_DETAILED_URL       "http://high.risky.com"
81
82 #define RISK_MEDIUM_RISK             CSR_WP_RISK_MEDIUM
83 #define RISK_MEDIUM_URL              "https://mediumrisky.test.com:80/abc/def"
84 #define RISK_MEDIUM_DETAILED_URL     "http://medium.risky.com"
85
86 #define RISK_LOW_RISK                CSR_WP_RISK_LOW
87 #define RISK_LOW_URL                 "lowrisky.test.com:8080/abc/def"
88 #define RISK_LOW_DETAILED_URL        "http://low.risky.com"
89
90 #define RISK_UNVERIFIED_RISK         CSR_WP_RISK_UNVERIFIED
91 #define RISK_UNVERIFIED_URL          "http://unverified.test.com:8080/abc/def"
92 #define RISK_UNVERIFIED_DETAILED_URL (nullptr)
93