From 3d00a7d23a96f29c138cfc1672825b90b9e0c05e Mon Sep 17 00:00:00 2001 From: yinjiaming Date: Wed, 24 Nov 2021 11:39:59 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9E=E7=8E=B0=E4=BA=86musl=E5=BA=93?= =?UTF-8?q?net=E6=A8=A1=E5=9D=97=E4=B8=AD=E7=9A=84=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=8E=A5=E5=8F=A3=E5=92=8C=E7=9B=B8=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=20=E3=80=90?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E3=80=91=20musl=E5=BA=93=E4=B8=AD=E5=85=B3?= =?UTF-8?q?=E4=BA=8Enet=E6=A8=A1=E5=9D=97=E6=9C=89=E4=B8=80=E4=BA=9BAPI?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=AE=9E=E7=8E=B0=EF=BC=8C=E7=9B=B8=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=BE=97=E4=B8=8D=E6=98=AF=E9=9D=9E=E5=B8=B8=E5=90=88=E7=90=86?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【修改方案】 删去了与实现的API不相关的测试用例,修改了测试用例中一些错误的地方, 修改了测试用例中依赖硬件环境的一些地方。 【影响】 对现有的产品编译不会有影响。 re #I4JQI1 Signed-off-by: yinjiaming Change-Id: If57f50b025c84aa79107691efb091dde8e7b2156 --- testsuites/unittest/net/netdb/config.gni | 1 - .../net/netdb/full/net_netdb_test_002.cpp | 12 ++ .../net/netdb/full/net_netdb_test_004.cpp | 20 +- .../net/netdb/full/net_netdb_test_006.cpp | 11 + .../net/netdb/full/net_netdb_test_007.cpp | 12 ++ .../net/netdb/full/net_netdb_test_008.cpp | 12 ++ .../net/netdb/full/net_netdb_test_009.cpp | 12 ++ .../net/netdb/full/net_netdb_test_011.cpp | 17 +- .../net/netdb/full/net_netdb_test_012.cpp | 26 ++- .../net/netdb/full/net_netdb_test_014.cpp | 48 ----- .../net/netdb/full/net_netdb_test_015.cpp | 4 - .../net/netdb/full/net_netdb_test_016.cpp | 18 ++ .../net/netdb/full/net_netdb_test_017.cpp | 12 ++ .../net/netdb/full/net_netdb_test_018.cpp | 38 +++- .../net/netdb/full/net_netdb_test_019.cpp | 43 +++- .../net/netdb/full/net_netdb_test_020.cpp | 31 ++- .../net/netdb/full/net_netdb_test_021.cpp | 15 +- .../net/netdb/full/net_netdb_test_022.cpp | 15 +- testsuites/unittest/net/netdb/lt_net_netdb.h | 1 - .../unittest/net/netdb/net_netdb_test.cpp | 201 ++++++++++++++++++ .../net/resolv/full/net_resolv_test_004.cpp | 12 ++ .../net/resolv/full/net_resolv_test_008.cpp | 12 ++ 22 files changed, 491 insertions(+), 82 deletions(-) delete mode 100644 testsuites/unittest/net/netdb/full/net_netdb_test_014.cpp diff --git a/testsuites/unittest/net/netdb/config.gni b/testsuites/unittest/net/netdb/config.gni index 32a188fc..2c1702ad 100644 --- a/testsuites/unittest/net/netdb/config.gni +++ b/testsuites/unittest/net/netdb/config.gni @@ -49,7 +49,6 @@ netdb_sources_full = [ "$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_010.cpp", "$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_011.cpp", "$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_012.cpp", - "$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_014.cpp", "$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_015.cpp", "$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_016.cpp", "$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_017.cpp", diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_002.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_002.cpp index bb124c5c..2e295946 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_002.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_002.cpp @@ -35,6 +35,17 @@ static int AddrInfoTest(void) { // Prerequisite: correct DNS servers must be configured. + char host_file[] = "127.0.0.2 example.com\n", serv_file[] = "ftp 21/tcp\n"; + char *pathList[] = {"/etc/hosts", "/etc/services"}; + char *streamList[] = {host_file, serv_file}; + int streamLen[] = {sizeof(host_file), sizeof(serv_file)}; + const int file_number = 2; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct addrinfo *addr = NULL; int ret = getaddrinfo("example.com", "ftp", NULL, &addr); ICUNIT_ASSERT_EQUAL(ret, 0, ret); @@ -50,6 +61,7 @@ static int AddrInfoTest(void) const char *p = gai_strerror(EAI_AGAIN); ICUNIT_ASSERT_NOT_EQUAL(p, NULL, -1); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp index aeea1cc3..95787450 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp @@ -34,8 +34,19 @@ static int GetHostByAddrTest(void) { + char host_file[] = "127.0.0.1 localhost\n100.0.0.0 example.com example\n"; + char *pathList[] = {"/etc/hosts"}; + char *streamList[] = {host_file}; + int streamLen[] = {sizeof(host_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct in_addr ia; - int length = 4; + int length = 4; // the address length is 4; ia.s_addr = inet_addr("127.0.0.1"); struct hostent *addr = gethostbyaddr(&ia, sizeof ia, AF_INET); ICUNIT_ASSERT_NOT_EQUAL(addr, NULL, -1); @@ -43,19 +54,18 @@ static int GetHostByAddrTest(void) ICUNIT_ASSERT_STRING_EQUAL(addr->h_name, "localhost", -1); ICUNIT_ASSERT_EQUAL(addr->h_length, length, -1); - ia.s_addr = inet_addr("100.109.180.184"); + ia.s_addr = inet_addr("100.0.0.0"); addr = gethostbyaddr(&ia, sizeof ia, AF_INET); ICUNIT_ASSERT_NOT_EQUAL(addr, NULL, -1); ICUNIT_ASSERT_EQUAL(addr->h_addrtype, AF_INET, addr->h_addrtype); - ICUNIT_ASSERT_STRING_EQUAL(addr->h_name, "szvphisprb93341", -1); - ICUNIT_ASSERT_STRING_EQUAL(addr->h_aliases[0], "szvphisprb93341", -1); + ICUNIT_ASSERT_STRING_EQUAL(addr->h_name, "example.com", -1); errno = 0; ia.s_addr = inet_addr("127.0.0.0"); addr = gethostbyaddr(&ia, sizeof ia, AF_INET); ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno); - return ICUNIT_SUCCESS; +    RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_006.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_006.cpp index b9932e81..9cc7c829 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_006.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_006.cpp @@ -34,6 +34,16 @@ static int GetHostByNameTest(void) { + char host_file[] = "127.0.0.1 localhost\n"; + char *pathList[] = {"/etc/hosts"}; + char *streamList[] = {host_file}; + int streamLen[] = {sizeof(host_file)}; + int flag = PrepareFileEnv(pathList, streamList, streamLen, 1); + if (flag != 0) { + RecoveryFileEnv(pathList, 1); + return -1; + } + struct hostent *addr = gethostbyname("localhost"); ICUNIT_ASSERT_NOT_EQUAL(addr, NULL, -1); ICUNIT_ASSERT_EQUAL(strcmp(addr->h_name, "localhost"), 0, -1); @@ -49,6 +59,7 @@ static int GetHostByNameTest(void) addr = gethostbyname("lo"); ICUNIT_ASSERT_EQUAL(addr, NULL, -1); + RecoveryFileEnv(pathList, 1); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_007.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_007.cpp index 712e5b97..42ef5c50 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_007.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_007.cpp @@ -34,6 +34,17 @@ static int GetHostByNameRTest(void) { + char host_file[] = "127.0.0.1 localhost\n"; + char *pathList[] = {"/etc/hosts"}; + char *streamList[] = {static_cast(host_file)}; + int streamLen[] = {sizeof(host_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct hostent addr, *result = NULL; char buf[1024]; char buf1[1]; @@ -60,6 +71,7 @@ static int GetHostByNameRTest(void) ret = gethostbyname_r("lo", &addr, buf, sizeof buf, &result, &err); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_008.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_008.cpp index 6a9d44e6..7819b3b6 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_008.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_008.cpp @@ -34,6 +34,17 @@ static int GetHostByName2Test(void) { + char host_file[] = "127.0.0.1 localhost\n"; + char *pathList[] = {"/etc/hosts"}; + char *streamList[] = {static_cast(host_file)}; + int streamLen[] = {sizeof(host_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct hostent *addr = gethostbyname2("localhost", AF_INET); ICUNIT_ASSERT_NOT_EQUAL(addr, NULL, -1); ICUNIT_ASSERT_EQUAL(strcmp(addr->h_name, "localhost"), 0, -1); @@ -51,6 +62,7 @@ static int GetHostByName2Test(void) addr = gethostbyname2("localh", AF_INET); ICUNIT_ASSERT_EQUAL(addr, NULL, -1); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_009.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_009.cpp index c14bc9b7..7a9ab531 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_009.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_009.cpp @@ -33,6 +33,17 @@ static int GetHostByName2RTest(void) { + char host_file[] = "127.0.0.1 localhost\n"; + char *pathList[] = {"/etc/hosts"}; + char *streamList[] = {host_file}; + int streamLen[] = {sizeof(host_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct hostent addr, *result = NULL; char buf[1024]; char buf1[1]; @@ -59,6 +70,7 @@ static int GetHostByName2RTest(void) ret = gethostbyname2_r("lo", AF_INET, &addr, buf, sizeof buf, &result, &err); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_011.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_011.cpp index b6b7f191..32f7d434 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_011.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_011.cpp @@ -35,16 +35,29 @@ static int GetServByPortTest(void) { // refer to the `/etc/services' file. + char serv_file[] = "ssh 22/tcp\n"; + char *pathList[] = {"/etc/services"}; + char *streamList[] = {static_cast(serv_file)}; + int streamLen[] = {sizeof(serv_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + + const int test_port_no = 22; // ssh port number is 22 struct servent *se1 = nullptr; - struct servent *se = getservbyport(htons(22), "tcp"); + struct servent *se = getservbyport(htons(test_port_no), "tcp"); ICUNIT_ASSERT_NOT_EQUAL(se, NULL, -1); ICUNIT_ASSERT_STRING_EQUAL(se->s_name, "ssh", -1); ICUNIT_ASSERT_STRING_EQUAL(se->s_proto, "tcp", -1); ICUNIT_ASSERT_STRING_EQUAL(se->s_aliases[0], "ssh", -1); - se1 = getservbyport(htons(22), "tp"); + se1 = getservbyport(htons(test_port_no), "tp"); ICUNIT_ASSERT_EQUAL(se1, nullptr, -1); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_012.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_012.cpp index 0e9ad90e..503948f9 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_012.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_012.cpp @@ -35,26 +35,42 @@ static int GetServByPortRTest(void) { // refer to the `/etc/services' file. + char serv_file[] = "ssh 22/tcp\n"; + char *pathList[] = {"/etc/services"}; + char *streamList[] = {static_cast(serv_file)}; + int streamLen[] = {sizeof(serv_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct servent se, *result = NULL; char buf[1024]; char buf1[2]; - int ret = getservbyport_r(htons(22), "udp", &se, buf, sizeof buf, &result); + const int test_port_no = 22; // ssh port number is 22 + int ret = getservbyport_r(htons(test_port_no), "tcp", &se, buf, sizeof buf, &result); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_NOT_EQUAL(result, NULL, -1); ICUNIT_ASSERT_STRING_EQUAL(se.s_name, "ssh", -1); - ICUNIT_ASSERT_STRING_EQUAL(se.s_proto, "udp", -1); + ICUNIT_ASSERT_STRING_EQUAL(se.s_proto, "tcp", -1); ICUNIT_ASSERT_STRING_EQUAL(se.s_aliases[0], "ssh", -1); ICUNIT_ASSERT_STRING_EQUAL(result->s_name, "ssh", -1); - ICUNIT_ASSERT_STRING_EQUAL(result->s_proto, "udp", -1); + ICUNIT_ASSERT_STRING_EQUAL(result->s_proto, "tcp", -1); ICUNIT_ASSERT_STRING_EQUAL(result->s_aliases[0], "ssh", -1); - ret = getservbyport_r(htons(22), "udp", &se, buf1, sizeof buf1, &result); + ret = getservbyport_r(htons(test_port_no), "udp", &se, buf, sizeof buf, &result); + ICUNIT_ASSERT_EQUAL(ret, ENOENT, -1); + + ret = getservbyport_r(htons(test_port_no), "udp", &se, buf1, sizeof buf1, &result); ICUNIT_ASSERT_EQUAL(ret, ERANGE, ret); - ret = getservbyport_r(htons(22), "ud", &se, buf, sizeof buf, &result); + ret = getservbyport_r(htons(test_port_no), "ud", &se, buf, sizeof buf, &result); ICUNIT_ASSERT_EQUAL(ret, EINVAL, ret); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_014.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_014.cpp deleted file mode 100644 index d4f0caaa..00000000 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_014.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "lt_net_netdb.h" -#include - -static int IfNameIndexTest(void) -{ - struct if_nameindex *idx = if_nameindex(); - ICUNIT_ASSERT_NOT_EQUAL(idx, NULL, -1); - - if_freenameindex(idx); - - return ICUNIT_SUCCESS; -} - -void NetNetDbTest014(void) -{ - TEST_ADD_CASE(__FUNCTION__, IfNameIndexTest, TEST_POSIX, TEST_TCP, TEST_LEVEL0, TEST_FUNCTION); -} diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_015.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_015.cpp index 95e675b4..612b1575 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_015.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_015.cpp @@ -44,10 +44,6 @@ static int IfNameToIndexTest(void) ICUNIT_ASSERT_NOT_EQUAL(str, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(if_name, "lo", -1); - str = if_indextoname(3, if_name); - ICUNIT_ASSERT_EQUAL(str, nullptr, -1); - ICUNIT_ASSERT_EQUAL(errno, ENXIO, errno); - ret = if_nametoindex("eth1"); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(errno, ENODEV, errno); diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_016.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_016.cpp index 652db1ed..c9d2d67b 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_016.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_016.cpp @@ -32,6 +32,23 @@ static int GetServByNameTest(void) { + char serv_file[] = "echo 7/tcp\n" + "echo 7/udp\n" + "discard 9/tcp sink null\n" + "discard 9/udp sink null\n" + "systat 11/tcp users\n" + "ssh 22/tcp\n"; + + char *pathList[] = {"/etc/services"}; + char *streamList[] = {static_cast(serv_file)}; + int streamLen[] = {sizeof(serv_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct servent *se1 = nullptr; struct servent *se2 = nullptr; @@ -53,6 +70,7 @@ static int GetServByNameTest(void) se2 = getservbyname("systat", "udp"); ICUNIT_ASSERT_EQUAL(se2, nullptr, -1); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_017.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_017.cpp index 81908c55..a3469ff6 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_017.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_017.cpp @@ -32,6 +32,17 @@ static int GetServByNameRTest(void) { + char serv_file[] = "ssh 22/tcp\n"; + char *pathList[] = {"/etc/services"}; + char *streamList[] = {static_cast(serv_file)}; + int streamLen[] = {sizeof(serv_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct servent se; struct servent *result = NULL; char buf1[1024] = { 0 }; @@ -58,6 +69,7 @@ static int GetServByNameRTest(void) ret = getservbyname_r("sh", "tcp", &se, buf1, sizeof buf1, &result); ICUNIT_ASSERT_EQUAL(ret, ENOENT, ret); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_018.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_018.cpp index 3f816dc8..415fd086 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_018.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_018.cpp @@ -32,6 +32,28 @@ static int GetServEntTest(void) { + char serv_file[] = "tcpmux 1/tcp # TCP port service multiplexer\n" + "echo 7/tcp\n" + "echo 7/udp\n" + "discard 9/tcp sink null\n" + "ssh 100000/tcp\n" + "ssh /tcp\n" + "ssh 22/"; + char *pathList[] = {"/etc/services"}; + char *streamList[] = {static_cast(serv_file)}; + int streamLen[] = {sizeof(serv_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + + /* tcpmux,echo,discard port number is 1,7,9 */ + const int tcpmux_port_no = 1; + const int echo_port_no = 7; + const int discard_port_no = 9; + struct servent *se1 = nullptr; struct servent *se2 = nullptr; struct servent *se3 = nullptr; @@ -40,7 +62,7 @@ static int GetServEntTest(void) ICUNIT_ASSERT_NOT_EQUAL(se1, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(se1->s_name, "tcpmux", -1); ICUNIT_ASSERT_STRING_EQUAL(se1->s_proto, "tcp", -1); - ICUNIT_ASSERT_EQUAL(se1->s_port, ntohs(1), -1); + ICUNIT_ASSERT_EQUAL(se1->s_port, ntohs(tcpmux_port_no), -1); endservent(); se2 = getservent(); @@ -60,20 +82,28 @@ static int GetServEntTest(void) ICUNIT_ASSERT_NOT_EQUAL(se3, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(se3->s_name, "echo", -1); ICUNIT_ASSERT_STRING_EQUAL(se3->s_proto, "tcp", -1); - ICUNIT_ASSERT_EQUAL(se3->s_port, ntohs(7), -1); + ICUNIT_ASSERT_EQUAL(se3->s_port, ntohs(echo_port_no), -1); se3 = getservent(); ICUNIT_ASSERT_NOT_EQUAL(se3, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(se3->s_name, "echo", -1); ICUNIT_ASSERT_STRING_EQUAL(se3->s_proto, "udp", -1); - ICUNIT_ASSERT_EQUAL(se3->s_port, ntohs(7), -1); + ICUNIT_ASSERT_EQUAL(se3->s_port, ntohs(echo_port_no), -1); se3 = getservent(); ICUNIT_ASSERT_NOT_EQUAL(se3, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(se3->s_name, "discard", -1); ICUNIT_ASSERT_STRING_EQUAL(se3->s_proto, "tcp", -1); - ICUNIT_ASSERT_EQUAL(se3->s_port, ntohs(9), -1); + ICUNIT_ASSERT_EQUAL(se3->s_port, ntohs(discard_port_no), -1); ICUNIT_ASSERT_STRING_EQUAL(se3->s_aliases[0], "sink", -1); + ICUNIT_ASSERT_STRING_EQUAL(se3->s_aliases[1], "null", -1); + ICUNIT_ASSERT_EQUAL(se3->s_aliases[2], nullptr, -1); + + se3 = getservent(); + ICUNIT_ASSERT_EQUAL(se3, nullptr, -1); + endservent(); + + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_019.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_019.cpp index 53c9b08a..70ad889a 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_019.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_019.cpp @@ -29,21 +29,37 @@ */ #include "lt_net_netdb.h" +#include static int GetHostEntTest(void) { + char host_file[] = "127.0.0.1 localhost #localhost\n" + "::1 ip6-localhost\n" + "10.0.0.0 example example.com example.cn\n" + "10.0.0.0\n" + "10.0.0 example.com"; + char *pathList[] = {"/etc/hosts"}; + char *streamList[] = {static_cast(host_file)}; + int streamLen[] = {sizeof(host_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct hostent *se1 = nullptr; struct hostent *se2 = nullptr; struct hostent *se3 = nullptr; - int type = 2; - int length1 = 4; - int length2 = 16; + char addr[INET6_ADDRSTRLEN]; se1 = gethostent(); ICUNIT_ASSERT_NOT_EQUAL(se1, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(se1->h_name, "localhost", -1); - ICUNIT_ASSERT_EQUAL(se1->h_addrtype, type, -1); - ICUNIT_ASSERT_EQUAL(se1->h_length, length1, -1); + ICUNIT_ASSERT_EQUAL(se1->h_addrtype, AF_INET, -1); + ICUNIT_ASSERT_EQUAL(se1->h_length, INADDRSZ, -1); + ICUNIT_ASSERT_STRING_EQUAL("127.0.0.1", inet_ntop(AF_INET, se1->h_addr_list[0], addr, INET_ADDRSTRLEN), -1); + ICUNIT_ASSERT_EQUAL(se1->h_aliases[0], nullptr, -1); endhostent(); se2 = gethostent(); @@ -62,15 +78,24 @@ static int GetHostEntTest(void) se3 = gethostent(); ICUNIT_ASSERT_NOT_EQUAL(se3, nullptr, -1); ICUNIT_ASSERT_EQUAL(se3->h_addrtype, AF_INET6, -1); - ICUNIT_ASSERT_STRING_EQUAL(se3->h_name, "localhost", -1); - ICUNIT_ASSERT_EQUAL(se3->h_length, length2, -1); + ICUNIT_ASSERT_STRING_EQUAL(se3->h_name, "ip6-localhost", -1); + ICUNIT_ASSERT_EQUAL(se3->h_length, IN6ADDRSZ, -1); + ICUNIT_ASSERT_STRING_EQUAL("::1", inet_ntop(AF_INET6, se3->h_addr_list[0], addr, INET6_ADDRSTRLEN), -1); se3 = gethostent(); ICUNIT_ASSERT_NOT_EQUAL(se3, nullptr, -1); ICUNIT_ASSERT_EQUAL(se3->h_addrtype, AF_INET, -1); - ICUNIT_ASSERT_STRING_EQUAL(se3->h_name, "szvphisprb93341", -1); - ICUNIT_ASSERT_STRING_EQUAL(se3->h_aliases[0], "szvphisprb93341.huawei.com", -1); + ICUNIT_ASSERT_STRING_EQUAL(se3->h_name, "example", -1); + ICUNIT_ASSERT_STRING_EQUAL("10.0.0.0", inet_ntop(AF_INET, se3->h_addr_list[0], addr, INET_ADDRSTRLEN), -1); + ICUNIT_ASSERT_STRING_EQUAL(se3->h_aliases[0], "example.com", -1); + ICUNIT_ASSERT_STRING_EQUAL(se3->h_aliases[1], "example.cn", -1); + ICUNIT_ASSERT_EQUAL(se3->h_aliases[2], nullptr, -1); + se3 = gethostent(); + ICUNIT_ASSERT_EQUAL(se3, nullptr, -1); + endhostent(); + + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_020.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_020.cpp index a08a22f0..5cad29c6 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_020.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_020.cpp @@ -32,6 +32,20 @@ static int GetNetEntTest(void) { + char network_file[] = "# symbolic names for networks, see networks(5) for more information\n" + "link-local 169.254.0.0\n" + "example 192.168.1.0 network example-network\n" + "test1"; + char *pathList[] = {"/etc/networks"}; + char *streamList[] = {static_cast(network_file)}; + int streamLen[] = {sizeof(network_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct netent *se1 = nullptr; struct netent *se2 = nullptr; struct netent *se3 = nullptr; @@ -39,8 +53,9 @@ static int GetNetEntTest(void) se1 = getnetent(); ICUNIT_ASSERT_NOT_EQUAL(se1, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(se1->n_name, "link-local", -1); - ICUNIT_ASSERT_EQUAL(se1->n_addrtype, 2, -1); + ICUNIT_ASSERT_EQUAL(se1->n_addrtype, AF_INET, -1); ICUNIT_ASSERT_EQUAL(se1->n_net, inet_network("169.254.0.0"), -1); + ICUNIT_ASSERT_EQUAL(se1->n_aliases[0], nullptr, -1); endnetent(); se2 = getnetent(); @@ -56,6 +71,20 @@ static int GetNetEntTest(void) ICUNIT_ASSERT_EQUAL(se1->n_addrtype, se3->n_addrtype, -1); ICUNIT_ASSERT_EQUAL(se1->n_net, se3->n_net, -1); + se1 = getnetent(); + ICUNIT_ASSERT_NOT_EQUAL(se1, nullptr, -1); + ICUNIT_ASSERT_STRING_EQUAL(se1->n_name, "example", -1); + ICUNIT_ASSERT_EQUAL(se1->n_addrtype, AF_INET, -1); + ICUNIT_ASSERT_EQUAL(se1->n_net, inet_network("192.168.1.0"), -1); + ICUNIT_ASSERT_STRING_EQUAL(se1->n_aliases[0], "network", -1); + ICUNIT_ASSERT_STRING_EQUAL(se1->n_aliases[1], "example-network", -1); + ICUNIT_ASSERT_EQUAL(se1->n_aliases[2], nullptr, -1); + + se1 = getnetent(); + ICUNIT_ASSERT_EQUAL(se1, nullptr, -1); + endnetent(); + + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_021.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_021.cpp index 0e4254b3..9b784d51 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_021.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_021.cpp @@ -32,6 +32,18 @@ static int GetNetBynametTest(void) { + char network_file[] = "# symbolic names for networks, see networks(5) for more information\n" + "link-local 169.254.0.0\n"; + char *pathList[] = {"/etc/networks"}; + char *streamList[] = {static_cast(network_file)}; + int streamLen[] = {sizeof(network_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct netent *se1 = nullptr; struct netent *se2 = nullptr; struct netent *se3 = nullptr; @@ -39,7 +51,7 @@ static int GetNetBynametTest(void) se1 = getnetbyname("link-local"); ICUNIT_ASSERT_NOT_EQUAL(se1, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(se1->n_name, "link-local", -1); - ICUNIT_ASSERT_EQUAL(se1->n_addrtype, 2, -1); + ICUNIT_ASSERT_EQUAL(se1->n_addrtype, AF_INET, -1); ICUNIT_ASSERT_EQUAL(se1->n_net, inet_network("169.254.0.0"), -1); se2 = getnetbyname("link"); @@ -48,6 +60,7 @@ static int GetNetBynametTest(void) se3 = getnetbyname("hs"); ICUNIT_ASSERT_EQUAL(se3, nullptr, -1); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/full/net_netdb_test_022.cpp b/testsuites/unittest/net/netdb/full/net_netdb_test_022.cpp index 3bf0f9b1..b551318e 100644 --- a/testsuites/unittest/net/netdb/full/net_netdb_test_022.cpp +++ b/testsuites/unittest/net/netdb/full/net_netdb_test_022.cpp @@ -32,6 +32,18 @@ static int GetNetByAddrtTest(void) { + char network_file[] = "# symbolic names for networks, see networks(5) for more information\n" + "link-local 169.254.0.0\n"; + char *pathList[] = {"/etc/networks"}; + char *streamList[] = {static_cast(network_file)}; + int streamLen[] = {sizeof(network_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct netent *se1 = nullptr; struct netent *se2 = nullptr; struct netent *se3 = nullptr; @@ -39,7 +51,7 @@ static int GetNetByAddrtTest(void) se1 = getnetbyaddr(inet_network("169.254.0.0"), AF_INET); ICUNIT_ASSERT_NOT_EQUAL(se1, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(se1->n_name, "link-local", -1); - ICUNIT_ASSERT_EQUAL(se1->n_addrtype, 2, -1); + ICUNIT_ASSERT_EQUAL(se1->n_addrtype, AF_INET, -1); ICUNIT_ASSERT_EQUAL(se1->n_net, inet_network("169.254.0.0"), -1); se2 = getnetbyaddr(inet_network("169.254.0.1"), AF_INET); @@ -48,6 +60,7 @@ static int GetNetByAddrtTest(void) se3 = getnetbyaddr(inet_network("169.254.0.1"), AF_INET6); ICUNIT_ASSERT_EQUAL(se3, nullptr, -1); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/netdb/lt_net_netdb.h b/testsuites/unittest/net/netdb/lt_net_netdb.h index d60a83cc..1ef994ee 100644 --- a/testsuites/unittest/net/netdb/lt_net_netdb.h +++ b/testsuites/unittest/net/netdb/lt_net_netdb.h @@ -52,7 +52,6 @@ void NetNetDbTest010(void); void NetNetDbTest011(void); void NetNetDbTest012(void); void NetNetDbTest013(void); -void NetNetDbTest014(void); void NetNetDbTest015(void); void NetNetDbTest016(void); void NetNetDbTest017(void); diff --git a/testsuites/unittest/net/netdb/net_netdb_test.cpp b/testsuites/unittest/net/netdb/net_netdb_test.cpp index 84761e3f..aa0e2dea 100644 --- a/testsuites/unittest/net/netdb/net_netdb_test.cpp +++ b/testsuites/unittest/net/netdb/net_netdb_test.cpp @@ -72,5 +72,206 @@ HWTEST_F(NetDbTest, NetNetDbTest013, TestSize.Level0) NetNetDbTest013(); } +#endif + +#if defined(LOSCFG_USER_TEST_FULL) +/* * + * @tc.name: NetNetDbTest018 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest018, TestSize.Level0) +{ + NetNetDbTest018(); +} + +/* * + * @tc.name: NetNetDbTest002 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest002, TestSize.Level0) +{ + NetNetDbTest002(); +} + +/* * + * @tc.name: NetNetDbTest003 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest003, TestSize.Level0) +{ + NetNetDbTest003(); +} + +/* * + * @tc.name: NetNetDbTest004 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest004, TestSize.Level0) +{ + NetNetDbTest004(); +} + +/* * + * @tc.name: NetNetDbTest006 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest006, TestSize.Level0) +{ + NetNetDbTest006(); +} + +/* * + * @tc.name: NetNetDbTest007 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest007, TestSize.Level0) +{ + NetNetDbTest007(); +} + +/* * + * @tc.name: NetNetDbTest008 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest008, TestSize.Level0) +{ + NetNetDbTest008(); +} + +/* * + * @tc.name: NetNetDbTest009 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest009, TestSize.Level0) +{ + NetNetDbTest009(); +} + +/* * + * @tc.name: NetNetDbTest010 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest010, TestSize.Level0) +{ + NetNetDbTest010(); +} + +/* * + * @tc.name: NetNetDbTest011 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest011, TestSize.Level0) +{ + NetNetDbTest011(); +} + +/* * + * @tc.name: NetNetDbTest012 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest012, TestSize.Level0) +{ + NetNetDbTest012(); +} + +/* * + * @tc.name: NetNetDbTest015 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest015, TestSize.Level0) +{ + NetNetDbTest015(); +} + +/* * + * @tc.name: NetNetDbTest016 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest016, TestSize.Level0) +{ + NetNetDbTest016(); +} + +/* * + * @tc.name: NetNetDbTest017 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest017, TestSize.Level0) +{ + NetNetDbTest017(); +} + +/* * + * @tc.name: NetNetDbTest019 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest019, TestSize.Level0) +{ + NetNetDbTest019(); +} + +/* * + * @tc.name: NetNetDbTest020 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest020, TestSize.Level0) +{ + NetNetDbTest020(); +} + +/* * + * @tc.name: NetNetDbTest021 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest021, TestSize.Level0) +{ + NetNetDbTest021(); +} + +/* * + * @tc.name: NetNetDbTest022 + * @tc.desc: function for NetDbTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(NetDbTest, NetNetDbTest022, TestSize.Level0) +{ + NetNetDbTest022(); +} + #endif } diff --git a/testsuites/unittest/net/resolv/full/net_resolv_test_004.cpp b/testsuites/unittest/net/resolv/full/net_resolv_test_004.cpp index e8cb672a..ea7b2ed7 100644 --- a/testsuites/unittest/net/resolv/full/net_resolv_test_004.cpp +++ b/testsuites/unittest/net/resolv/full/net_resolv_test_004.cpp @@ -34,6 +34,17 @@ static int EtherHosttonTest(void) { // suppose "0:0:0:0:0:0 localhost" in `/etc/ethers' file. + char ether_file[] = "0:0:0:0:0:0 localhost"; + char *pathList[] = {"/etc/ethers"}; + char *streamList[] = {static_cast(ether_file)}; + int streamLen[] = {sizeof(ether_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct ether_addr addr, *eaddr = &addr; int ret = ether_hostton("localhost", eaddr); @@ -45,6 +56,7 @@ static int EtherHosttonTest(void) ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[4], 0x00, eaddr->ether_addr_octet[4]); ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[5], 0x00, eaddr->ether_addr_octet[5]); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/testsuites/unittest/net/resolv/full/net_resolv_test_008.cpp b/testsuites/unittest/net/resolv/full/net_resolv_test_008.cpp index baf77fbe..2fe4a303 100644 --- a/testsuites/unittest/net/resolv/full/net_resolv_test_008.cpp +++ b/testsuites/unittest/net/resolv/full/net_resolv_test_008.cpp @@ -35,6 +35,17 @@ static int EtherNtohostTest(void) { // suppose "0:0:0:0:0:0 localhost" in `/etc/ethers' file. + char ether_file[] = "0:0:0:0:0:0 localhost"; + char *pathList[] = {"/etc/ethers"}; + char *streamList[] = {static_cast(ether_file)}; + int streamLen[] = {sizeof(ether_file)}; + const int file_number = 1; + int flag = PrepareFileEnv(pathList, streamList, streamLen, file_number); + if (flag != 0) { + RecoveryFileEnv(pathList, file_number); + return -1; + } + struct ether_addr addr = {{0,0,0,0,0,0}}, *eaddr = &addr; char buf[100]; int ret = ether_ntohost(buf, eaddr); @@ -42,6 +53,7 @@ static int EtherNtohostTest(void) ICUNIT_ASSERT_EQUAL(ret, 0, -1); ICUNIT_ASSERT_EQUAL(strcmp("localhost", buf), 0, -1); + RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; }