summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorVijay Kumar Banerjee <vijay@rtems.org>2021-02-25 10:27:14 -0700
committerVijay Kumar Banerjee <vijay@rtems.org>2021-04-07 16:15:38 -0600
commit3dca9ed92b865e98639ce71df3984cdbcaf3f4ee (patch)
tree7cc4ba20c443e4fe1a268108ed5d61f88e35cf8b /testsuites
parentc90fa83041f1467ac9795c489b7151db3a041ab5 (diff)
downloadrtems-3dca9ed92b865e98639ce71df3984cdbcaf3f4ee.tar.bz2
testsuites/libtests: Remove networking01
Update #3850
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/libtests/networking01/init.c161
-rw-r--r--testsuites/libtests/networking01/networking01.doc26
-rw-r--r--testsuites/libtests/networking01/networking01.scn9
3 files changed, 0 insertions, 196 deletions
diff --git a/testsuites/libtests/networking01/init.c b/testsuites/libtests/networking01/init.c
deleted file mode 100644
index 0d13ae7a75..0000000000
--- a/testsuites/libtests/networking01/init.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2016 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Dornierstr. 4
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/socket.h>
-#include <netdb.h>
-#include <string.h>
-#include <netinet/in.h>
-
-#include <rtems.h>
-#include <tmacros.h>
-
-const char rtems_test_name[] = "NETWORKING 1";
-
-/* forward declarations to avoid warnings */
-static rtems_task Init(rtems_task_argument argument);
-
-static void fill_sa(struct sockaddr *sa, sa_family_t family)
-{
- memset(sa, 0, sizeof(*sa));
- sa->sa_len = sizeof(*sa);
- sa->sa_family = family;
-}
-
-static void fill_sa_in(struct sockaddr_in *sa_in,
- in_addr_t addr, in_port_t port)
-{
- fill_sa((struct sockaddr *)sa_in, AF_INET);
- sa_in->sin_port = htons(port);
- sa_in->sin_addr.s_addr = htonl(addr);
-}
-
-static void test_getnameinfo(
- const struct sockaddr *sa,
- int flags,
- bool ask_node,
- bool ask_service,
- int expected_returnvalue,
- const char *expected_node,
- const char *expected_service
-)
-{
- char node[] = "255.255.255.255";
- char service[] = "65535";
- socklen_t salen = sa->sa_len;
- int rv;
-
- char *node_p = node;
- char *service_p = service;
- size_t node_l = sizeof(node);
- size_t service_l = sizeof(service);
-
- if(ask_node == false) {
- node_p = NULL;
- node_l = 0;
- }
-
- if(ask_service == false) {
- service_p = NULL;
- service_l = 0;
- }
-
- rv = getnameinfo(sa, salen, node_p, node_l, service_p, service_l, flags);
- rtems_test_assert(rv == expected_returnvalue);
-
- if(expected_node != NULL) {
- rtems_test_assert(strcmp(expected_node, node) == 0);
- }
-
- if(expected_service != NULL) {
- rtems_test_assert(strcmp(expected_service, service) == 0);
- }
-}
-
-static void test(void)
-{
- struct sockaddr sa;
- struct sockaddr_in sa_in;
- struct sockaddr *sa_in_p = (struct sockaddr *) &sa_in;
-
- const in_addr_t ip1_num = 0x7F000001u;
- const char ip1_string[] = "127.0.0.1";
-
- const in_addr_t ip2_num = 0xC0A86464u;
- const char ip2_string[] = "192.168.100.100";
-
- const in_port_t port1_num = 7u;
- const char port1_string[] = "7";
-
- const in_port_t port2_num = 65534u;
- const char port2_string[] = "65534";
-
-
- puts("Try AF_INET6");
- fill_sa(&sa, AF_INET6);
- test_getnameinfo(&sa, 0, true, true, EAI_FAMILY, NULL, NULL);
-
- puts("force node name");
- fill_sa_in(&sa_in, ip1_num, port1_num);
- test_getnameinfo(sa_in_p, NI_NAMEREQD, true, true, EAI_NONAME, NULL, NULL);
-
- puts("force service name");
- fill_sa_in(&sa_in, ip1_num, port1_num);
- test_getnameinfo(sa_in_p, NI_NAMEREQD, true, true, EAI_NONAME, NULL, NULL);
-
- puts("get node only");
- fill_sa_in(&sa_in, ip1_num, port1_num);
- test_getnameinfo(sa_in_p, 0, true, false, 0, ip1_string, NULL);
-
- puts("get service only");
- fill_sa_in(&sa_in, ip1_num, port1_num);
- test_getnameinfo(sa_in_p, 0, false, true, 0, NULL, port1_string);
-
- puts("get node and service");
- fill_sa_in(&sa_in, ip1_num, port1_num);
- test_getnameinfo(sa_in_p, 0, true, true, 0, ip1_string, port1_string);
-
- puts("get node and service with maximum number of characters for IP");
- fill_sa_in(&sa_in, ip2_num, port2_num);
- test_getnameinfo(sa_in_p, 0, true, true, 0, ip2_string, port2_string);
-}
-
-static rtems_task Init(rtems_task_argument argument)
-{
- TEST_BEGIN();
- test();
- TEST_END();
-
- rtems_test_exit(0);
-}
-
-#define CONFIGURE_INIT
-
-#define CONFIGURE_MICROSECONDS_PER_TICK 10000
-
-#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS (1)
-
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
-
-#include <rtems/confdefs.h>
diff --git a/testsuites/libtests/networking01/networking01.doc b/testsuites/libtests/networking01/networking01.doc
deleted file mode 100644
index 949a32cbcb..0000000000
--- a/testsuites/libtests/networking01/networking01.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2016 embedded brains GmbH. All rights reserved.
-#
-# embedded brains GmbH
-# Dornierstr. 4
-# 82178 Puchheim
-# Germany
-# <rtems@embedded-brains.de>
-#
-# The license and distribution terms for this file may be
-# found in the file LICENSE in this distribution or at
-# http://www.rtems.org/license/LICENSE.
-
-This file describes the directives and concepts tested by this test set.
-
-test set name: networking
-
-directives:
-
-+ getnameinfo()
-
-concepts:
-
-+ Try to get some valid and invalid name infos.
-
-NOTE: This test works without a network connection.
diff --git a/testsuites/libtests/networking01/networking01.scn b/testsuites/libtests/networking01/networking01.scn
deleted file mode 100644
index 75e8457a0f..0000000000
--- a/testsuites/libtests/networking01/networking01.scn
+++ /dev/null
@@ -1,9 +0,0 @@
-*** BEGIN OF TEST LIBNETWORKING 1 ***
-Try AF_INET6
-force node name
-force service name
-get node only
-get service only
-get node and service
-get node and service with maximum number of characters for IP
-*** END OF TEST LIBNETWORKING 1 ***