[PACKET_IO]fix gtest bug
This commit is contained in:
13
ci/prepare_gtest_network.sh
Normal file
13
ci/prepare_gtest_network.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# create tun device
|
||||
ip tuntap add dev tun0 mode tun
|
||||
|
||||
# add ip addr for tun device
|
||||
ip addr add 192.168.3.11/24 dev tun0
|
||||
|
||||
# kernel open ip forward
|
||||
echo 1 > /proc/sys/inet/ipv4/ip_forward
|
||||
|
||||
# start up tun0
|
||||
ifconfig tun0 up
|
||||
@@ -1,6 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
set -evx
|
||||
|
||||
chmod +x ci/prepare_gtest_network.sh
|
||||
. ci/prepare_gtest_network.sh
|
||||
|
||||
chmod +x ci/get-nprocessors.sh
|
||||
. ci/get-nprocessors.sh
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ TEST(PACKET_IO_Test, packet_io_device_open_and_close) {
|
||||
|
||||
TEST(PACKET_IO_Test, packet_io_device_rx) {
|
||||
struct packet_io_instance *ppio_inst = packet_io_instance_create("stellar", PACKET_IO_RUN_MODE_PCAP_FILE);
|
||||
struct packet_io_device *pdev = packet_io_device_open(ppio_inst, "./src/packet_io/test/test-64.pcapng", 1, 1);
|
||||
struct packet_io_device *pdev = packet_io_device_open(ppio_inst, "./test-64.pcapng", 1, 1);
|
||||
EXPECT_NE(pdev, nullptr);
|
||||
struct stellar_packet *rx_pkts[64];
|
||||
ssize_t fetch_num = packet_io_device_rx(pdev, 0, rx_pkts, 1);
|
||||
@@ -53,7 +53,7 @@ TEST(PACKET_IO_Test, packet_io_device_tx) {
|
||||
|
||||
TEST(PACKET_IO_Test, packet_io_pkts_free) {
|
||||
struct packet_io_instance *ppio_inst = packet_io_instance_create("stellar", PACKET_IO_RUN_MODE_PCAP_FILE);
|
||||
struct packet_io_device *pdev = packet_io_device_open(ppio_inst, "./src/packet_io/test/test-64.pcapng", 1, 1);
|
||||
struct packet_io_device *pdev = packet_io_device_open(ppio_inst, "./test-64.pcapng", 1, 1);
|
||||
EXPECT_NE(pdev, nullptr);
|
||||
struct stellar_packet *rx_pkts[64];
|
||||
ssize_t fetch_num = packet_io_device_rx(pdev, 0, rx_pkts, 1);
|
||||
@@ -65,7 +65,7 @@ TEST(PACKET_IO_Test, packet_io_pkts_free) {
|
||||
|
||||
TEST(PACKET_IO_Test, get_stellar_packet_ctrlzone) {
|
||||
struct packet_io_instance *ppio_inst = packet_io_instance_create("stellar", PACKET_IO_RUN_MODE_PCAP_FILE);
|
||||
struct packet_io_device *pdev = packet_io_device_open(ppio_inst, "./src/packet_io/test/test-64.pcapng", 1, 1);
|
||||
struct packet_io_device *pdev = packet_io_device_open(ppio_inst, "./test-64.pcapng", 1, 1);
|
||||
EXPECT_NE(pdev, nullptr);
|
||||
struct stellar_packet *rx_pkts[64];
|
||||
ssize_t fetch_num = packet_io_device_rx(pdev, 0, rx_pkts, 1);
|
||||
@@ -81,7 +81,7 @@ TEST(PACKET_IO_Test, get_stellar_packet_ctrlzone) {
|
||||
|
||||
TEST(PACKET_IO_Test, get_stellar_packet_data) {
|
||||
struct packet_io_instance *ppio_inst = packet_io_instance_create("stellar", PACKET_IO_RUN_MODE_PCAP_FILE);
|
||||
struct packet_io_device *pdev = packet_io_device_open(ppio_inst, "./src/packet_io/test/test-64.pcapng", 1, 1);
|
||||
struct packet_io_device *pdev = packet_io_device_open(ppio_inst, "./test-64.pcapng", 1, 1);
|
||||
EXPECT_NE(pdev, nullptr);
|
||||
struct stellar_packet *rx_pkts[64];
|
||||
ssize_t fetch_num = packet_io_device_rx(pdev, 0, rx_pkts, 1);
|
||||
@@ -145,50 +145,6 @@ TEST(PACKET_IO_UTIL_Test, release_pio_packet_queue) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_instance_create) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_instance_destroy) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_open) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_close) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_receive) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_send) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_pkt_free) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_buff_ctrlzone) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_buff_mtod) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_buff_buflen) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_MARSIO_Test, pio_marsio_device_buff_datalen) {
|
||||
|
||||
}
|
||||
|
||||
TEST(PACKET_IO_PIO_PCAP_FILE_Test, pio_pcap_file_instance_create) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user