Upgrade NetBSD tests to 01.11.2017_23.20 snapshot
This contains some new testcases in /usr/tests/...: - .../lib/libc - .../lib/libthr - .../lib/msun - .../sys/kern Tested on: amd64, i386 MFC after: 1 month
This commit is contained in:
commit
cdebaff820
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312008
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_libcrypto.sh,v 1.3 2010/11/08 19:06:12 pooka Exp $
|
# $NetBSD: t_libcrypto.sh,v 1.4 2016/10/13 09:25:37 martin Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -49,7 +49,7 @@ atf_test_case bn
|
|||||||
bn_head()
|
bn_head()
|
||||||
{
|
{
|
||||||
atf_set "descr" "Checks BIGNUM library"
|
atf_set "descr" "Checks BIGNUM library"
|
||||||
atf_set "timeout" "300"
|
atf_set "timeout" "360"
|
||||||
}
|
}
|
||||||
bn_body()
|
bn_body()
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_pubkey.sh,v 1.3 2011/06/09 05:25:21 spz Exp $
|
# $NetBSD: t_pubkey.sh,v 1.4 2016/10/13 09:25:37 martin Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -49,7 +49,7 @@ atf_test_case rsa
|
|||||||
rsa_head()
|
rsa_head()
|
||||||
{
|
{
|
||||||
atf_set "descr" "Checks RSA"
|
atf_set "descr" "Checks RSA"
|
||||||
atf_set "timeout" "300"
|
atf_set "timeout" "420"
|
||||||
}
|
}
|
||||||
rsa_body()
|
rsa_body()
|
||||||
{
|
{
|
||||||
@ -60,7 +60,7 @@ atf_test_case ec
|
|||||||
ec_head()
|
ec_head()
|
||||||
{
|
{
|
||||||
atf_set "descr" "Checks EC cipher"
|
atf_set "descr" "Checks EC cipher"
|
||||||
atf_set "timeout" "300"
|
atf_set "timeout" "480"
|
||||||
}
|
}
|
||||||
ec_body()
|
ec_body()
|
||||||
{
|
{
|
||||||
@ -81,7 +81,7 @@ atf_test_case ecdsa
|
|||||||
ecdsa_head()
|
ecdsa_head()
|
||||||
{
|
{
|
||||||
atf_set "descr" "Checks ECDSA algorithm"
|
atf_set "descr" "Checks ECDSA algorithm"
|
||||||
atf_set "timeout" "300"
|
atf_set "timeout" "480"
|
||||||
}
|
}
|
||||||
ecdsa_body()
|
ecdsa_body()
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: h_pad.c,v 1.1 2010/08/04 13:15:15 pooka Exp $ */
|
/* $NetBSD: h_pad.c,v 1.2 2016/10/15 07:08:06 nat Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
|
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
|
||||||
@ -56,14 +56,14 @@ main(int argc, char *argv[])
|
|||||||
ssize_t n;
|
ssize_t n;
|
||||||
|
|
||||||
rump_init();
|
rump_init();
|
||||||
audiofd = rump_sys_open("/dev/audio0", O_RDWR);
|
|
||||||
if (audiofd == -1)
|
|
||||||
err(1, "open audio");
|
|
||||||
|
|
||||||
padfd = rump_sys_open("/dev/pad0", O_RDONLY);
|
padfd = rump_sys_open("/dev/pad0", O_RDONLY);
|
||||||
if (padfd == -1)
|
if (padfd == -1)
|
||||||
err(1, "open pad");
|
err(1, "open pad");
|
||||||
|
|
||||||
|
audiofd = rump_sys_open("/dev/audio0", O_RDWR);
|
||||||
|
if (audiofd == -1)
|
||||||
|
err(1, "open audio");
|
||||||
|
|
||||||
if ((n = rump_sys_write(audiofd, musa, sizeof(musa))) != sizeof(musa))
|
if ((n = rump_sys_write(audiofd, musa, sizeof(musa))) != sizeof(musa))
|
||||||
err(1, "write");
|
err(1, "write");
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
913
contrib/netbsd-tests/dev/cgd/t_cgd_3des.c
Normal file
913
contrib/netbsd-tests/dev/cgd/t_cgd_3des.c
Normal file
@ -0,0 +1,913 @@
|
|||||||
|
/* $NetBSD: t_cgd_3des.c,v 1.1 2016/11/11 07:39:58 alnsn Exp $ */
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
* by Alexander Nasonov.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* 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 HOLDERS 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 <sys/types.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
|
||||||
|
#include <atf-c.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <util.h>
|
||||||
|
|
||||||
|
#include <dev/cgdvar.h>
|
||||||
|
|
||||||
|
#include <rump/rump.h>
|
||||||
|
#include <rump/rump_syscalls.h>
|
||||||
|
|
||||||
|
#include "../../h_macros.h"
|
||||||
|
|
||||||
|
#define SECSIZE 512
|
||||||
|
|
||||||
|
struct testvec {
|
||||||
|
unsigned int blkno;
|
||||||
|
const uint8_t *ptxt; /* PlainText */
|
||||||
|
const uint8_t *ctxt; /* CipherText */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 192 bits CBC key, NUL terminated.
|
||||||
|
*/
|
||||||
|
static const char c3des_cbc_192_key[25] = {
|
||||||
|
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, /* ABCDEFGH */
|
||||||
|
0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, /* IJKLMNOP */
|
||||||
|
0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* QRSTUVWX */
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
static const uint8_t c3des_cbc_ptxt[SECSIZE] =
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop"
|
||||||
|
" abcdefghijklmnop";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IV method encblkno1, blkno 0.
|
||||||
|
*/
|
||||||
|
static const uint8_t c3des_cbc_192_encblkno1_vec0_ctxt[SECSIZE] = {
|
||||||
|
0x19, 0x92, 0xc8, 0xce, 0xdf, 0xa3, 0x14, 0xef,
|
||||||
|
0xff, 0x88, 0x9f, 0x01, 0xfa, 0x6f, 0xfa, 0xa6,
|
||||||
|
0xdd, 0x2b, 0x43, 0x67, 0xfa, 0xce, 0x37, 0x95,
|
||||||
|
0x73, 0x4d, 0x18, 0x33, 0x0c, 0x29, 0xb6, 0xbb,
|
||||||
|
0x37, 0x77, 0x31, 0x74, 0xf6, 0x62, 0x03, 0xd2,
|
||||||
|
0x78, 0x13, 0x55, 0xf6, 0x58, 0x49, 0xaf, 0x2a,
|
||||||
|
0x15, 0x4c, 0xc2, 0x4a, 0x55, 0x99, 0x82, 0xb9,
|
||||||
|
0xfb, 0x8b, 0x4f, 0x92, 0xe3, 0xbc, 0x9b, 0x09,
|
||||||
|
0x42, 0x7b, 0x5f, 0x54, 0xed, 0xf0, 0xcb, 0x5d,
|
||||||
|
0x93, 0xba, 0x09, 0x4b, 0x20, 0xf3, 0xe6, 0x44,
|
||||||
|
0x30, 0x5e, 0x9e, 0xfc, 0x7a, 0x3c, 0x7d, 0x11,
|
||||||
|
0x63, 0xea, 0x40, 0x94, 0xaa, 0xd0, 0xa9, 0xf6,
|
||||||
|
0xc7, 0x1e, 0x8f, 0xc8, 0xa6, 0x2c, 0xf7, 0xeb,
|
||||||
|
0x51, 0x26, 0xdc, 0xf8, 0x73, 0xf9, 0xb4, 0xa8,
|
||||||
|
0x80, 0x4a, 0xe5, 0x6f, 0xb6, 0x33, 0x13, 0x6b,
|
||||||
|
0x1b, 0x7d, 0x00, 0xde, 0x44, 0x7e, 0x26, 0xa2,
|
||||||
|
0x82, 0xa7, 0x80, 0x16, 0x34, 0xde, 0xb9, 0x82,
|
||||||
|
0x4c, 0x42, 0x8e, 0x0d, 0x48, 0x7e, 0x38, 0xbd,
|
||||||
|
0x1d, 0x7d, 0x98, 0xbb, 0x11, 0x8a, 0x72, 0x14,
|
||||||
|
0x4e, 0xaa, 0xd0, 0xef, 0x4d, 0x7f, 0xa3, 0xa6,
|
||||||
|
0xfc, 0x85, 0x9d, 0x74, 0x63, 0x9d, 0xe4, 0x5c,
|
||||||
|
0xf7, 0xa8, 0xd0, 0xd7, 0x95, 0xb4, 0x28, 0x64,
|
||||||
|
0x41, 0x2d, 0x5d, 0xd9, 0xba, 0x79, 0xa7, 0xb3,
|
||||||
|
0x9c, 0x16, 0xfa, 0xb8, 0x10, 0x5d, 0x1d, 0xd4,
|
||||||
|
0xce, 0xad, 0x67, 0x27, 0x91, 0x8a, 0xb3, 0xbc,
|
||||||
|
0x37, 0x20, 0x95, 0xac, 0xf7, 0x0d, 0xe0, 0x1e,
|
||||||
|
0x59, 0xa7, 0xe5, 0x81, 0x82, 0x6a, 0x71, 0x07,
|
||||||
|
0x85, 0x43, 0x43, 0xdb, 0xbf, 0x56, 0xb0, 0x0a,
|
||||||
|
0x4c, 0xf1, 0xcd, 0xcd, 0xa3, 0x9a, 0x10, 0x8e,
|
||||||
|
0x0c, 0xe2, 0x6d, 0xf2, 0x16, 0xd0, 0x4c, 0xac,
|
||||||
|
0xf9, 0xfc, 0xc9, 0x56, 0x1f, 0x31, 0x89, 0x1c,
|
||||||
|
0xfa, 0xb7, 0x49, 0xea, 0x69, 0x91, 0xfe, 0x45,
|
||||||
|
0x96, 0x5e, 0x45, 0xc3, 0x2c, 0xb1, 0x40, 0xd9,
|
||||||
|
0x1f, 0x82, 0x3f, 0xc1, 0x45, 0x7c, 0x39, 0x72,
|
||||||
|
0x6f, 0x52, 0xe4, 0xaf, 0x15, 0xa4, 0xe2, 0xd4,
|
||||||
|
0xa1, 0xa4, 0xb2, 0xb5, 0x4a, 0x0b, 0xad, 0xe4,
|
||||||
|
0x1e, 0x5c, 0x26, 0x62, 0x81, 0x78, 0x3e, 0xd3,
|
||||||
|
0x6a, 0x98, 0x94, 0x2a, 0x00, 0xa7, 0xe4, 0x04,
|
||||||
|
0x9d, 0x9a, 0xfc, 0xcf, 0xad, 0x2b, 0xba, 0x9b,
|
||||||
|
0x40, 0x1e, 0x71, 0x3a, 0xb6, 0x92, 0xc4, 0xc5,
|
||||||
|
0x56, 0x58, 0x92, 0x2a, 0x69, 0xbe, 0x0f, 0xb0,
|
||||||
|
0x91, 0xae, 0xaa, 0x3f, 0x07, 0xe8, 0xf9, 0x71,
|
||||||
|
0x20, 0x06, 0xed, 0xe0, 0x80, 0xec, 0xc9, 0xe7,
|
||||||
|
0x54, 0xaa, 0xaa, 0xf4, 0x4c, 0xb2, 0x34, 0xf7,
|
||||||
|
0x8a, 0x76, 0xc2, 0x4a, 0xae, 0x71, 0x7a, 0x07,
|
||||||
|
0xd7, 0xec, 0x75, 0x2f, 0x8a, 0x99, 0x59, 0x13,
|
||||||
|
0xd0, 0x8d, 0x18, 0x69, 0x0d, 0xd9, 0x39, 0x73,
|
||||||
|
0x2b, 0xd0, 0xa3, 0xbc, 0x9e, 0x29, 0x4d, 0x88,
|
||||||
|
0xff, 0x98, 0x02, 0xb4, 0xcf, 0xa1, 0xf9, 0x2a,
|
||||||
|
0xa6, 0xef, 0x7c, 0x72, 0x26, 0x4e, 0xd7, 0xdf,
|
||||||
|
0xec, 0x3a, 0xbc, 0x8e, 0xe6, 0xb3, 0x2b, 0x43,
|
||||||
|
0xcd, 0x67, 0x8b, 0x72, 0x00, 0x6f, 0xe5, 0x85,
|
||||||
|
0xe2, 0x2a, 0x4c, 0x8d, 0x02, 0x44, 0x6b, 0x7a,
|
||||||
|
0x89, 0x7a, 0x18, 0x3b, 0xc8, 0x9c, 0x8d, 0x60,
|
||||||
|
0xec, 0x79, 0x58, 0x15, 0x98, 0x71, 0x4b, 0x1a,
|
||||||
|
0x34, 0x69, 0x96, 0xd0, 0x0f, 0x01, 0x27, 0x2e,
|
||||||
|
0x19, 0x02, 0xf0, 0x17, 0x8c, 0x89, 0xbf, 0x05,
|
||||||
|
0xf0, 0xfe, 0xc3, 0xe6, 0x90, 0x9d, 0xa2, 0xb1,
|
||||||
|
0x40, 0x06, 0x7e, 0xcd, 0x20, 0x7e, 0x5f, 0x54,
|
||||||
|
0x31, 0xfb, 0x79, 0x84, 0x47, 0x38, 0x71, 0x69,
|
||||||
|
0xe1, 0xd5, 0x4e, 0x84, 0xa3, 0x2b, 0x4a, 0x86,
|
||||||
|
0xc2, 0x21, 0x5b, 0x15, 0xc3, 0x63, 0xbb, 0xc5,
|
||||||
|
0x5c, 0xc1, 0xfb, 0x31, 0x3a, 0x4d, 0xb1, 0x9e,
|
||||||
|
0xe1, 0xd8, 0x67, 0x4b, 0x08, 0x42, 0xc4, 0xe8,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IV method encblkno1, blkno 1.
|
||||||
|
*/
|
||||||
|
static const uint8_t c3des_cbc_192_encblkno1_vec1_ctxt[SECSIZE] = {
|
||||||
|
0x1d, 0x65, 0xdf, 0x01, 0x9b, 0x24, 0xa5, 0x10,
|
||||||
|
0x94, 0x9a, 0x5b, 0x81, 0x96, 0x4e, 0xa3, 0x42,
|
||||||
|
0x42, 0xd5, 0x05, 0x52, 0xab, 0x3c, 0x67, 0x40,
|
||||||
|
0x79, 0xf9, 0x4b, 0x58, 0x39, 0xf6, 0xd0, 0x97,
|
||||||
|
0x48, 0xf4, 0x77, 0xb8, 0xac, 0xe2, 0x10, 0x66,
|
||||||
|
0xa8, 0x04, 0x0a, 0x1e, 0xa6, 0xbb, 0x4c, 0xd9,
|
||||||
|
0x5d, 0x0c, 0x11, 0xb5, 0xe0, 0x26, 0x84, 0x50,
|
||||||
|
0x10, 0x80, 0xbf, 0xd6, 0xdc, 0x82, 0x53, 0x0a,
|
||||||
|
0xcf, 0xf6, 0xd3, 0x07, 0x45, 0xb0, 0x8e, 0x36,
|
||||||
|
0x2e, 0x60, 0x0f, 0xd0, 0xc1, 0xb9, 0xd8, 0x29,
|
||||||
|
0x6e, 0x13, 0x8e, 0xc1, 0xa8, 0x63, 0x20, 0xe0,
|
||||||
|
0x8d, 0x47, 0x8b, 0xf9, 0xa0, 0x60, 0x55, 0x53,
|
||||||
|
0x1d, 0xaf, 0x43, 0x46, 0xe5, 0x10, 0xd5, 0xcd,
|
||||||
|
0x91, 0x9e, 0x11, 0x4a, 0x6f, 0x6a, 0x13, 0xdf,
|
||||||
|
0xee, 0x7a, 0x88, 0xbe, 0x59, 0x96, 0xdb, 0x65,
|
||||||
|
0x25, 0x57, 0x9e, 0x82, 0xad, 0xc2, 0xd6, 0x28,
|
||||||
|
0x96, 0xb3, 0x7f, 0x57, 0x5d, 0xb2, 0xfa, 0x60,
|
||||||
|
0x43, 0x22, 0xa5, 0x33, 0x14, 0x99, 0x8f, 0x68,
|
||||||
|
0x5a, 0x7f, 0xaf, 0x9e, 0xe9, 0x23, 0x57, 0x9b,
|
||||||
|
0x52, 0xe9, 0x20, 0x59, 0x26, 0x89, 0x9b, 0x59,
|
||||||
|
0xb0, 0xee, 0xe8, 0x6d, 0x06, 0x8c, 0x01, 0xc2,
|
||||||
|
0xea, 0xbc, 0x7d, 0x93, 0x3f, 0x79, 0x7f, 0xeb,
|
||||||
|
0x57, 0xc9, 0x0a, 0xca, 0x37, 0x81, 0xa7, 0x82,
|
||||||
|
0xde, 0x37, 0x7d, 0x69, 0x01, 0xaa, 0x19, 0x98,
|
||||||
|
0x26, 0xfe, 0x06, 0x83, 0xeb, 0x9d, 0x26, 0xdc,
|
||||||
|
0x04, 0x5d, 0xc9, 0x05, 0xee, 0x1a, 0xd3, 0xeb,
|
||||||
|
0x20, 0x8c, 0xb7, 0x99, 0x75, 0xe0, 0x19, 0x98,
|
||||||
|
0xca, 0x83, 0xae, 0x94, 0x28, 0xbf, 0x47, 0x42,
|
||||||
|
0x92, 0x05, 0x8c, 0xaa, 0xeb, 0x99, 0x0f, 0xcc,
|
||||||
|
0x33, 0x79, 0x24, 0x62, 0xa0, 0x7a, 0x65, 0xcb,
|
||||||
|
0x53, 0xb7, 0x86, 0x0d, 0xcb, 0x44, 0x2d, 0xbf,
|
||||||
|
0xe8, 0x5d, 0x62, 0xeb, 0x21, 0x4d, 0x35, 0x86,
|
||||||
|
0x56, 0x6c, 0x51, 0xff, 0xa3, 0x45, 0xcc, 0x88,
|
||||||
|
0x09, 0x43, 0x08, 0x97, 0x13, 0x7d, 0x00, 0xd8,
|
||||||
|
0x82, 0x2d, 0xbe, 0xbe, 0x44, 0x0c, 0x2c, 0xa4,
|
||||||
|
0x4f, 0x84, 0x07, 0x20, 0x9c, 0x3f, 0xf6, 0x5b,
|
||||||
|
0x9e, 0xe8, 0x68, 0x40, 0xd3, 0x64, 0x8f, 0xb4,
|
||||||
|
0x9e, 0xac, 0xc6, 0x41, 0x11, 0xda, 0xf2, 0x60,
|
||||||
|
0xfa, 0x29, 0x9d, 0x26, 0x68, 0x5b, 0x79, 0x3a,
|
||||||
|
0xd1, 0x66, 0x78, 0xca, 0x80, 0x87, 0xae, 0xab,
|
||||||
|
0x7b, 0x29, 0x3c, 0xb0, 0xe6, 0xa2, 0x6b, 0x24,
|
||||||
|
0x81, 0xeb, 0x51, 0xf9, 0xcb, 0x4a, 0x08, 0x37,
|
||||||
|
0x2a, 0x75, 0xb5, 0xd3, 0xb3, 0x8f, 0x3d, 0x13,
|
||||||
|
0x11, 0x0c, 0xa9, 0xf7, 0xf6, 0x57, 0x7e, 0xb7,
|
||||||
|
0xa6, 0x22, 0xe8, 0x13, 0xfd, 0xf1, 0x6a, 0xe9,
|
||||||
|
0xc1, 0x94, 0xa6, 0xf5, 0xa5, 0xec, 0xfa, 0x31,
|
||||||
|
0xd2, 0x66, 0x8f, 0xe3, 0x6e, 0x9a, 0xaa, 0xb0,
|
||||||
|
0xe3, 0x04, 0x09, 0x00, 0x1e, 0x67, 0x3c, 0xbe,
|
||||||
|
0x2a, 0x8c, 0xd5, 0x1f, 0x4f, 0x55, 0x2c, 0x1d,
|
||||||
|
0x26, 0x7f, 0xc9, 0x27, 0x00, 0x88, 0x7d, 0x45,
|
||||||
|
0x4e, 0xe1, 0x36, 0xf6, 0xf5, 0xa8, 0xd4, 0xef,
|
||||||
|
0x8b, 0x26, 0x76, 0x41, 0x28, 0x87, 0xf4, 0x51,
|
||||||
|
0x14, 0x36, 0xad, 0x60, 0x8d, 0xe9, 0xe2, 0x9d,
|
||||||
|
0x3c, 0xea, 0x09, 0x51, 0x3c, 0x81, 0xdf, 0x1a,
|
||||||
|
0xc2, 0xc2, 0xf6, 0x45, 0xe1, 0x73, 0xac, 0xae,
|
||||||
|
0x85, 0x74, 0x83, 0x8f, 0x56, 0x3c, 0x36, 0x1c,
|
||||||
|
0xe0, 0x07, 0xc6, 0x6a, 0x48, 0xe4, 0x34, 0xe9,
|
||||||
|
0x81, 0x53, 0xb7, 0x53, 0x95, 0xa7, 0x94, 0x21,
|
||||||
|
0x7e, 0x32, 0x53, 0xda, 0x83, 0xd8, 0x57, 0x92,
|
||||||
|
0xd1, 0x15, 0x45, 0x86, 0x40, 0xac, 0xf1, 0x6f,
|
||||||
|
0x3c, 0x29, 0xef, 0x8d, 0x12, 0xe1, 0x9d, 0x04,
|
||||||
|
0x17, 0x3a, 0xcc, 0xa6, 0xc5, 0xe4, 0x27, 0x41,
|
||||||
|
0xcb, 0xfb, 0x5e, 0x77, 0x73, 0x5a, 0x2c, 0x03,
|
||||||
|
0xe9, 0x2b, 0x76, 0x4e, 0x69, 0xea, 0xcb, 0xb3,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IV method encblkno1, blkno 2.
|
||||||
|
*/
|
||||||
|
static const uint8_t c3des_cbc_192_encblkno1_vec2_ctxt[SECSIZE] = {
|
||||||
|
0x87, 0xb1, 0x3c, 0xd6, 0x60, 0xa0, 0x5a, 0x35,
|
||||||
|
0xf7, 0xe1, 0x6b, 0x87, 0xa0, 0x90, 0x2f, 0xc7,
|
||||||
|
0x8c, 0xed, 0x53, 0xda, 0x93, 0x32, 0x78, 0x5d,
|
||||||
|
0x24, 0x23, 0x42, 0xdd, 0x93, 0x5b, 0x2e, 0x40,
|
||||||
|
0xa1, 0xb1, 0x3b, 0xbb, 0xf0, 0x50, 0xb4, 0x61,
|
||||||
|
0xea, 0x15, 0x37, 0xf3, 0x49, 0xe1, 0xa0, 0x32,
|
||||||
|
0x88, 0x85, 0x81, 0xfd, 0xb7, 0x96, 0xd7, 0x9d,
|
||||||
|
0xd7, 0x29, 0x4b, 0x14, 0xf9, 0x18, 0x6a, 0xf6,
|
||||||
|
0x46, 0xae, 0x69, 0xdf, 0x63, 0x9a, 0xe0, 0x0b,
|
||||||
|
0x2c, 0x53, 0xd7, 0x82, 0x6f, 0xe5, 0xa0, 0x95,
|
||||||
|
0x2f, 0x61, 0x7f, 0x15, 0xff, 0xc7, 0xe8, 0x83,
|
||||||
|
0xfc, 0xfc, 0x16, 0x1c, 0x37, 0x0f, 0x9b, 0xbb,
|
||||||
|
0x14, 0xb2, 0xe2, 0xb7, 0x1f, 0x85, 0xb7, 0x07,
|
||||||
|
0x8a, 0x18, 0xed, 0xf7, 0x5f, 0x27, 0xff, 0x2f,
|
||||||
|
0x07, 0xf9, 0x9d, 0xe3, 0x79, 0x45, 0x1f, 0x51,
|
||||||
|
0x08, 0x54, 0x0f, 0x56, 0x84, 0xee, 0x87, 0x9a,
|
||||||
|
0xa9, 0x46, 0xb8, 0x77, 0x85, 0x40, 0x46, 0x50,
|
||||||
|
0xc1, 0x58, 0x07, 0xfd, 0xfa, 0x2b, 0x20, 0xd6,
|
||||||
|
0x4e, 0xba, 0x08, 0x02, 0x59, 0x3d, 0x23, 0x3b,
|
||||||
|
0x5d, 0xf9, 0x5e, 0x2f, 0xac, 0x9e, 0xa0, 0xd7,
|
||||||
|
0x3f, 0x9a, 0xdf, 0x50, 0x66, 0xcc, 0x28, 0xce,
|
||||||
|
0x93, 0xc8, 0x11, 0x5c, 0x74, 0xe2, 0x4f, 0xfd,
|
||||||
|
0xaf, 0x33, 0xbb, 0xce, 0x96, 0x1f, 0xb3, 0x46,
|
||||||
|
0x6e, 0xcd, 0xe4, 0xef, 0xfa, 0x2f, 0x93, 0xb1,
|
||||||
|
0xe5, 0x7c, 0x54, 0xbc, 0x17, 0x1f, 0xd5, 0x31,
|
||||||
|
0x0e, 0x88, 0xe7, 0xcd, 0xb0, 0xb5, 0x2e, 0x1e,
|
||||||
|
0x9e, 0x40, 0x36, 0xa5, 0xbb, 0xa7, 0x4e, 0xc8,
|
||||||
|
0x11, 0x6c, 0xae, 0x1c, 0x2d, 0xdb, 0x55, 0xd8,
|
||||||
|
0x14, 0x40, 0x02, 0xad, 0xaf, 0x19, 0x28, 0x59,
|
||||||
|
0xd7, 0x4f, 0x81, 0xd0, 0xc1, 0x54, 0x63, 0x73,
|
||||||
|
0x0e, 0xfb, 0x26, 0xf2, 0xa6, 0x80, 0xca, 0x2e,
|
||||||
|
0xf3, 0xca, 0x1e, 0xa4, 0x62, 0x07, 0x22, 0x10,
|
||||||
|
0x11, 0x6a, 0x57, 0x28, 0x45, 0x80, 0xdf, 0x34,
|
||||||
|
0x88, 0xe5, 0xf1, 0x23, 0xe0, 0xb6, 0x44, 0x51,
|
||||||
|
0x54, 0xd8, 0xb3, 0x66, 0xac, 0x46, 0x4d, 0xdf,
|
||||||
|
0xa2, 0x8e, 0x72, 0x3a, 0x1c, 0x87, 0x2a, 0x43,
|
||||||
|
0xfe, 0xdb, 0x00, 0xff, 0xb7, 0x1c, 0x13, 0xc3,
|
||||||
|
0x18, 0xfc, 0x71, 0x13, 0xe3, 0xd1, 0x1f, 0xde,
|
||||||
|
0x16, 0x63, 0x73, 0xf5, 0x0e, 0xf7, 0x18, 0xe5,
|
||||||
|
0x48, 0x8d, 0x30, 0xd9, 0x26, 0x20, 0x6d, 0xa1,
|
||||||
|
0xba, 0xde, 0xe8, 0x7d, 0x77, 0x02, 0x33, 0x0d,
|
||||||
|
0x73, 0xb2, 0xab, 0x35, 0xfd, 0xa5, 0x6e, 0x4c,
|
||||||
|
0x5c, 0x27, 0xc7, 0x7e, 0x4a, 0x28, 0xf8, 0xf5,
|
||||||
|
0x00, 0xbe, 0x4c, 0xd7, 0x2c, 0x27, 0x83, 0x16,
|
||||||
|
0x37, 0xda, 0x0c, 0xb1, 0xd7, 0x89, 0xd8, 0x8f,
|
||||||
|
0x17, 0x69, 0x1b, 0x6b, 0x48, 0x2b, 0xce, 0x9c,
|
||||||
|
0xbd, 0xf4, 0x0d, 0xb5, 0x4d, 0x12, 0x11, 0x36,
|
||||||
|
0x49, 0xd3, 0x8b, 0x52, 0xce, 0x7e, 0x47, 0xb0,
|
||||||
|
0xb5, 0x54, 0x77, 0xef, 0x90, 0xb8, 0x0e, 0xaf,
|
||||||
|
0x6f, 0x97, 0x88, 0xde, 0x6b, 0x37, 0x24, 0xdd,
|
||||||
|
0x91, 0x84, 0x00, 0x51, 0xab, 0x06, 0x96, 0x3c,
|
||||||
|
0x82, 0x73, 0xcf, 0xae, 0x8d, 0x23, 0x86, 0x59,
|
||||||
|
0x62, 0x5b, 0xeb, 0x2a, 0xaf, 0x40, 0x17, 0xed,
|
||||||
|
0x2b, 0x60, 0x73, 0x7d, 0x99, 0x95, 0x3f, 0xd6,
|
||||||
|
0x6c, 0xca, 0x1e, 0xf3, 0xb0, 0xcd, 0xd5, 0x1d,
|
||||||
|
0x53, 0xe0, 0xd2, 0x8b, 0x57, 0x7b, 0xac, 0x67,
|
||||||
|
0x5a, 0x5a, 0x0a, 0x64, 0x82, 0xab, 0x8f, 0x5a,
|
||||||
|
0x36, 0xe2, 0x45, 0x50, 0xec, 0x3e, 0x14, 0x80,
|
||||||
|
0x7c, 0xfd, 0x0c, 0xa9, 0x94, 0xfb, 0xfe, 0x72,
|
||||||
|
0xec, 0x47, 0x71, 0x2e, 0x90, 0x97, 0xf6, 0x33,
|
||||||
|
0xbd, 0x7d, 0x7e, 0x77, 0x8f, 0xad, 0xd4, 0x1d,
|
||||||
|
0x1d, 0x53, 0x0f, 0x28, 0x39, 0x77, 0x06, 0x1a,
|
||||||
|
0x75, 0xfc, 0x12, 0xe6, 0x45, 0xfc, 0x87, 0xe1,
|
||||||
|
0x46, 0xac, 0xb0, 0x73, 0xca, 0x24, 0x7c, 0x71,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IV method encblkno1, blkno 3.
|
||||||
|
*/
|
||||||
|
static const uint8_t c3des_cbc_192_encblkno1_vec3_ctxt[SECSIZE] = {
|
||||||
|
0xb1, 0xef, 0x7c, 0xd0, 0xa0, 0x6b, 0xe4, 0x88,
|
||||||
|
0x5c, 0xd7, 0xf1, 0xbf, 0x5f, 0xce, 0xda, 0x19,
|
||||||
|
0x81, 0x32, 0xbb, 0x96, 0x7e, 0xb9, 0x6e, 0xa1,
|
||||||
|
0x43, 0xde, 0x53, 0x66, 0x9c, 0x27, 0x94, 0x85,
|
||||||
|
0xcb, 0x09, 0x4e, 0x16, 0xd8, 0x60, 0x7a, 0x38,
|
||||||
|
0x27, 0x21, 0x4d, 0x08, 0xaa, 0xe2, 0x1e, 0x6e,
|
||||||
|
0xa3, 0xcb, 0x9a, 0x7f, 0xd1, 0xbf, 0x18, 0x36,
|
||||||
|
0x5a, 0x4d, 0x7a, 0x7f, 0xcf, 0x3f, 0xba, 0xa5,
|
||||||
|
0x77, 0x5b, 0xb4, 0x79, 0xdc, 0xbf, 0x2a, 0x28,
|
||||||
|
0x16, 0x27, 0x0f, 0x8b, 0xd7, 0x95, 0xc3, 0xcb,
|
||||||
|
0xa1, 0x6a, 0x49, 0x53, 0xa8, 0x0c, 0x70, 0xde,
|
||||||
|
0x90, 0x2e, 0x36, 0x74, 0x40, 0x5d, 0x81, 0x74,
|
||||||
|
0x03, 0x11, 0xbd, 0xba, 0x40, 0x8d, 0x03, 0x86,
|
||||||
|
0x2b, 0x17, 0x55, 0x20, 0xd8, 0x81, 0x30, 0xd2,
|
||||||
|
0x2a, 0xbd, 0xea, 0xff, 0x5c, 0x69, 0x9b, 0xe6,
|
||||||
|
0xe3, 0x21, 0x9a, 0x10, 0x3e, 0xb0, 0xf4, 0x7a,
|
||||||
|
0xfc, 0x6e, 0x66, 0xec, 0x44, 0x0b, 0x95, 0x8d,
|
||||||
|
0x13, 0xd4, 0xf6, 0x3e, 0xa1, 0xa1, 0xac, 0xb1,
|
||||||
|
0xd8, 0x3d, 0x86, 0xaf, 0x5e, 0xef, 0x14, 0x6a,
|
||||||
|
0x32, 0xf3, 0x13, 0x75, 0x3b, 0x64, 0x9a, 0xf4,
|
||||||
|
0xd0, 0xf5, 0x00, 0x36, 0x9e, 0xdb, 0xfd, 0xcb,
|
||||||
|
0xda, 0x1f, 0xed, 0x9d, 0x6d, 0x52, 0xd7, 0xb5,
|
||||||
|
0x48, 0xce, 0x53, 0x5e, 0xdc, 0xc8, 0xe4, 0x96,
|
||||||
|
0x04, 0x32, 0xa5, 0xcf, 0x0c, 0xba, 0xa0, 0xd0,
|
||||||
|
0x44, 0xb3, 0xe8, 0x72, 0xc6, 0xff, 0x8f, 0xd4,
|
||||||
|
0x4d, 0x0a, 0x22, 0x89, 0x74, 0x50, 0xaa, 0x65,
|
||||||
|
0x15, 0xab, 0x99, 0xc8, 0xf9, 0xa4, 0x10, 0xe6,
|
||||||
|
0xa6, 0x4b, 0x0c, 0xc8, 0xb9, 0xa7, 0x60, 0x41,
|
||||||
|
0xe7, 0x57, 0x31, 0xfa, 0x86, 0x55, 0xdf, 0x29,
|
||||||
|
0x49, 0xac, 0x55, 0x7b, 0x21, 0xf9, 0x3b, 0x1e,
|
||||||
|
0x1f, 0xb4, 0x1c, 0x0b, 0x77, 0xcb, 0x88, 0xbf,
|
||||||
|
0xa6, 0x79, 0xbf, 0x9a, 0x51, 0xc4, 0x8e, 0x59,
|
||||||
|
0x9c, 0xb3, 0x9d, 0x9d, 0x6b, 0xb2, 0x15, 0x41,
|
||||||
|
0x0d, 0x6c, 0xf7, 0x5e, 0xe2, 0xf9, 0xb3, 0x80,
|
||||||
|
0x8f, 0x03, 0x67, 0x68, 0x6e, 0x4b, 0x4d, 0x52,
|
||||||
|
0xbc, 0x9b, 0xa2, 0xd8, 0x29, 0x1e, 0x5c, 0xd7,
|
||||||
|
0x59, 0x67, 0x94, 0x40, 0x9e, 0x08, 0x15, 0x0d,
|
||||||
|
0x7e, 0xc9, 0x14, 0x53, 0xa8, 0x67, 0xb3, 0xb8,
|
||||||
|
0xaa, 0x21, 0x0f, 0x79, 0x69, 0x48, 0x52, 0xea,
|
||||||
|
0x56, 0x03, 0x7b, 0x55, 0xb7, 0xf3, 0xfe, 0xb1,
|
||||||
|
0x8a, 0x22, 0x7d, 0x75, 0x55, 0x31, 0xad, 0x20,
|
||||||
|
0x6a, 0xc2, 0xa4, 0xd1, 0x1e, 0xab, 0xdd, 0x29,
|
||||||
|
0xb5, 0xf8, 0xdd, 0x9b, 0x1a, 0xb8, 0xe7, 0xde,
|
||||||
|
0xae, 0xa1, 0xab, 0xbb, 0xf6, 0x00, 0x87, 0xc4,
|
||||||
|
0x29, 0xee, 0x2b, 0xa1, 0xa9, 0x1a, 0x46, 0x05,
|
||||||
|
0x5a, 0x12, 0x3f, 0x32, 0x81, 0x25, 0x20, 0x71,
|
||||||
|
0xb6, 0xfa, 0x1f, 0x27, 0x2a, 0x33, 0x49, 0xfc,
|
||||||
|
0x95, 0x00, 0x72, 0x6b, 0x03, 0x53, 0x94, 0x57,
|
||||||
|
0x2f, 0x47, 0x3d, 0x2d, 0x7c, 0xb4, 0xde, 0xa7,
|
||||||
|
0x96, 0x81, 0x12, 0xff, 0x2c, 0xec, 0x5c, 0x03,
|
||||||
|
0x2a, 0x8c, 0x76, 0xc4, 0xed, 0x09, 0xe6, 0x00,
|
||||||
|
0x28, 0xdb, 0x9b, 0x44, 0xb0, 0xb4, 0x7b, 0x57,
|
||||||
|
0x3b, 0xb6, 0x4f, 0x0b, 0xff, 0xf2, 0xf5, 0x02,
|
||||||
|
0x56, 0xcf, 0xd5, 0xbf, 0x71, 0xe6, 0x66, 0xf3,
|
||||||
|
0x08, 0x8e, 0x8b, 0x15, 0x57, 0x07, 0x41, 0xa3,
|
||||||
|
0x91, 0xc1, 0xe4, 0x64, 0x92, 0x89, 0xed, 0x22,
|
||||||
|
0x88, 0x8f, 0x17, 0x91, 0xde, 0xea, 0x0c, 0xa6,
|
||||||
|
0x86, 0x8e, 0x4c, 0xd9, 0x63, 0xc9, 0xe5, 0xdc,
|
||||||
|
0xd6, 0xd3, 0x7b, 0x2b, 0x65, 0xfa, 0x36, 0x47,
|
||||||
|
0x20, 0xa4, 0xe7, 0x0b, 0x52, 0xfa, 0xa6, 0xeb,
|
||||||
|
0x1d, 0x20, 0xd0, 0x4b, 0xfd, 0x88, 0x8c, 0xbb,
|
||||||
|
0x52, 0x9c, 0x2f, 0xb7, 0xba, 0x8b, 0xdd, 0x10,
|
||||||
|
0x2d, 0x7d, 0x77, 0x79, 0x40, 0xa7, 0xed, 0xf9,
|
||||||
|
0xbd, 0x2a, 0x55, 0x1f, 0x87, 0x1e, 0x3c, 0xfc,
|
||||||
|
};
|
||||||
|
|
||||||
|
const struct testvec c3des_cbc_192_1_vectors[] = {
|
||||||
|
{
|
||||||
|
.blkno = 0,
|
||||||
|
.ptxt = c3des_cbc_ptxt,
|
||||||
|
.ctxt = c3des_cbc_192_encblkno1_vec0_ctxt,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.blkno = 1,
|
||||||
|
.ptxt = c3des_cbc_ptxt,
|
||||||
|
.ctxt = c3des_cbc_192_encblkno1_vec1_ctxt,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.blkno = 2,
|
||||||
|
.ptxt = c3des_cbc_ptxt,
|
||||||
|
.ctxt = c3des_cbc_192_encblkno1_vec2_ctxt,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.blkno = 3,
|
||||||
|
.ptxt = c3des_cbc_ptxt,
|
||||||
|
.ctxt = c3des_cbc_192_encblkno1_vec3_ctxt,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IV method encblkno8, blkno 0.
|
||||||
|
*/
|
||||||
|
static const uint8_t c3des_cbc_192_encblkno8_vec0_ctxt[SECSIZE] = {
|
||||||
|
0x9e, 0x5d, 0x35, 0x56, 0xa7, 0xcc, 0xc0, 0x1c,
|
||||||
|
0x60, 0x4c, 0x42, 0x90, 0x35, 0xf3, 0xc1, 0x20,
|
||||||
|
0xf2, 0x07, 0x6f, 0xf8, 0x7c, 0x33, 0x6a, 0x74,
|
||||||
|
0xdc, 0x85, 0xbc, 0x9c, 0xa2, 0x29, 0xc6, 0x69,
|
||||||
|
0x0e, 0xef, 0x0f, 0xa9, 0x6e, 0xec, 0xf2, 0x23,
|
||||||
|
0x2f, 0x9a, 0xbe, 0x1a, 0x89, 0x22, 0x00, 0xc4,
|
||||||
|
0x5a, 0xaf, 0x4a, 0xa0, 0x4f, 0x30, 0x8f, 0x99,
|
||||||
|
0xd2, 0x93, 0x6d, 0xfa, 0xcd, 0x2f, 0xad, 0x19,
|
||||||
|
0x10, 0x14, 0x90, 0x3a, 0x4b, 0xab, 0x17, 0x2e,
|
||||||
|
0x2c, 0xe1, 0x26, 0xe5, 0x76, 0xf1, 0xd1, 0x1d,
|
||||||
|
0x4c, 0x77, 0x68, 0xfb, 0x45, 0x9a, 0x3e, 0x19,
|
||||||
|
0xe0, 0xfb, 0xdc, 0xd4, 0x0e, 0x29, 0x7c, 0x06,
|
||||||
|
0xd3, 0x45, 0xa8, 0xf7, 0x39, 0x91, 0xe6, 0x18,
|
||||||
|
0x0f, 0x81, 0xe6, 0x7d, 0x6c, 0x65, 0x2e, 0x16,
|
||||||
|
0x24, 0xa4, 0x16, 0x96, 0x0a, 0x7b, 0x5f, 0x3a,
|
||||||
|
0x0c, 0xe9, 0x0e, 0x3f, 0x34, 0x38, 0xb0, 0xe1,
|
||||||
|
0x39, 0x23, 0x5c, 0x3c, 0x00, 0xb4, 0xa0, 0xf7,
|
||||||
|
0x42, 0x18, 0x70, 0x25, 0x82, 0x13, 0x24, 0x49,
|
||||||
|
0xbb, 0x3f, 0xfb, 0xef, 0xb6, 0xc6, 0x7f, 0x3d,
|
||||||
|
0x8c, 0x17, 0x62, 0x60, 0x6f, 0xd5, 0xda, 0x2c,
|
||||||
|
0xf8, 0x85, 0xee, 0xa7, 0xc2, 0x76, 0x5d, 0x34,
|
||||||
|
0x4c, 0xe1, 0x0d, 0x36, 0x6e, 0x02, 0xdd, 0x08,
|
||||||
|
0x85, 0xe4, 0x90, 0xfe, 0x1f, 0x81, 0x4a, 0x06,
|
||||||
|
0xa6, 0x72, 0x81, 0x79, 0x47, 0xd7, 0x6d, 0x92,
|
||||||
|
0x8f, 0xb7, 0xb2, 0xfd, 0xd0, 0x60, 0x6c, 0x06,
|
||||||
|
0x44, 0xcd, 0x20, 0x28, 0xef, 0x16, 0xc3, 0x01,
|
||||||
|
0x19, 0x14, 0x34, 0x39, 0xad, 0x87, 0x9f, 0xde,
|
||||||
|
0x76, 0xb9, 0xb9, 0x87, 0x1a, 0xbd, 0x8e, 0x2c,
|
||||||
|
0xe6, 0xb3, 0xe7, 0xb6, 0x80, 0xf8, 0xc5, 0x22,
|
||||||
|
0x5f, 0x53, 0xed, 0x03, 0xfe, 0x09, 0x2c, 0x9d,
|
||||||
|
0xb6, 0x61, 0x4a, 0xbb, 0x07, 0x5d, 0xbd, 0x68,
|
||||||
|
0x74, 0xab, 0x02, 0x81, 0x64, 0x7b, 0x97, 0xa3,
|
||||||
|
0xad, 0x15, 0x99, 0x7a, 0x04, 0x33, 0xbd, 0x50,
|
||||||
|
0x94, 0x11, 0xcc, 0xf7, 0x8b, 0x77, 0x88, 0x78,
|
||||||
|
0x80, 0xfe, 0x5f, 0xa1, 0x63, 0xbc, 0xb0, 0x65,
|
||||||
|
0xcb, 0x9d, 0x4c, 0xfe, 0x66, 0x4e, 0xff, 0xe3,
|
||||||
|
0x43, 0x61, 0x99, 0x88, 0x88, 0x4c, 0xbc, 0x8a,
|
||||||
|
0xf1, 0x69, 0x00, 0xc2, 0xe5, 0xb9, 0x65, 0x8b,
|
||||||
|
0x10, 0xdf, 0x38, 0x3e, 0x9e, 0x9f, 0x87, 0xed,
|
||||||
|
0x84, 0x71, 0xe7, 0xf2, 0xb5, 0xb6, 0x11, 0xed,
|
||||||
|
0x1e, 0xd4, 0xc0, 0x6d, 0x77, 0x08, 0x4b, 0xfd,
|
||||||
|
0x95, 0xd5, 0xc0, 0xbe, 0xa6, 0xcc, 0x3b, 0xea,
|
||||||
|
0x11, 0x38, 0xa5, 0x59, 0x36, 0x2a, 0xf4, 0x98,
|
||||||
|
0x52, 0x9d, 0x3b, 0x8c, 0x8a, 0x19, 0xbd, 0xfb,
|
||||||
|
0x49, 0xcb, 0xb0, 0x57, 0x91, 0xc7, 0xf8, 0x2a,
|
||||||
|
0x89, 0xa8, 0x85, 0x03, 0xdf, 0x6e, 0xad, 0xf4,
|
||||||
|
0x8a, 0x88, 0x9a, 0x2b, 0x5d, 0xe8, 0xca, 0xa9,
|
||||||
|
0x8f, 0x18, 0xa3, 0x6a, 0x37, 0x84, 0xa9, 0x24,
|
||||||
|
0x5b, 0xce, 0xd6, 0xbe, 0x7e, 0x40, 0x86, 0x6a,
|
||||||
|
0xc3, 0x47, 0x28, 0x66, 0xf0, 0x8c, 0x2d, 0x69,
|
||||||
|
0x22, 0x64, 0x61, 0x36, 0x6a, 0x0c, 0xc4, 0x18,
|
||||||
|
0x5f, 0xd7, 0xff, 0xbc, 0xf1, 0x94, 0x16, 0xfb,
|
||||||
|
0x26, 0xa7, 0x80, 0xa4, 0x2d, 0x72, 0xc6, 0x9d,
|
||||||
|
0xa7, 0xed, 0x04, 0x13, 0x0f, 0xe7, 0xf8, 0x93,
|
||||||
|
0x57, 0x6b, 0xd5, 0xa4, 0xad, 0x9a, 0x97, 0xeb,
|
||||||
|
0x97, 0xe7, 0x60, 0x01, 0x89, 0x3f, 0x88, 0xf2,
|
||||||
|
0xee, 0xf3, 0x79, 0xd6, 0x5a, 0x03, 0x94, 0x07,
|
||||||
|
0xd3, 0x33, 0xc8, 0xda, 0x15, 0x17, 0x0a, 0x8f,
|
||||||
|
0xbd, 0x58, 0x1b, 0xfe, 0x3d, 0x77, 0x5d, 0x8f,
|
||||||
|
0x4e, 0x0e, 0x98, 0x7d, 0x02, 0x63, 0x94, 0x73,
|
||||||
|
0x4a, 0x58, 0x47, 0xed, 0x52, 0xfc, 0x85, 0x19,
|
||||||
|
0x5d, 0x2f, 0xfa, 0x07, 0x44, 0xbd, 0x8e, 0xcb,
|
||||||
|
0x20, 0x63, 0x9d, 0x2b, 0x61, 0x5c, 0x19, 0x71,
|
||||||
|
0x80, 0xe5, 0x25, 0x5b, 0x2e, 0xc5, 0xfe, 0x1a,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IV method encblkno8, blkno 1.
|
||||||
|
*/
|
||||||
|
static const uint8_t c3des_cbc_192_encblkno8_vec1_ctxt[SECSIZE] = {
|
||||||
|
0xf4, 0xb0, 0xb0, 0xcb, 0x79, 0xcc, 0x8c, 0x0a,
|
||||||
|
0x3b, 0xc7, 0x43, 0x4e, 0x62, 0x9d, 0xde, 0xb4,
|
||||||
|
0xab, 0xa5, 0x62, 0x63, 0x32, 0xa7, 0x18, 0x2b,
|
||||||
|
0xe3, 0xee, 0x44, 0xc6, 0x6f, 0xb2, 0xdc, 0x21,
|
||||||
|
0xc5, 0xc8, 0x9e, 0x32, 0x71, 0x4c, 0x7a, 0x82,
|
||||||
|
0x8d, 0xe0, 0xad, 0x91, 0x88, 0x0c, 0x41, 0x83,
|
||||||
|
0x28, 0x0d, 0xed, 0xa7, 0xeb, 0x48, 0xb1, 0x31,
|
||||||
|
0xfa, 0x40, 0xd9, 0x44, 0x19, 0xee, 0x8d, 0x2c,
|
||||||
|
0x7d, 0xe2, 0x39, 0xa0, 0x39, 0xaa, 0x86, 0xab,
|
||||||
|
0xb5, 0x68, 0xe5, 0x83, 0x06, 0x61, 0xec, 0xe6,
|
||||||
|
0xc2, 0x85, 0xb2, 0x46, 0xf4, 0x5b, 0x0e, 0x34,
|
||||||
|
0x7e, 0x0c, 0xa0, 0xda, 0xef, 0x58, 0x9c, 0x39,
|
||||||
|
0x95, 0xa2, 0xca, 0xd3, 0x3b, 0x4d, 0x76, 0xe3,
|
||||||
|
0x34, 0x6d, 0x08, 0xa4, 0xba, 0x88, 0x58, 0x39,
|
||||||
|
0xb4, 0xe4, 0x6b, 0xb6, 0x32, 0x50, 0x2c, 0xe2,
|
||||||
|
0x0a, 0x37, 0xbc, 0x98, 0x38, 0x32, 0x17, 0x1b,
|
||||||
|
0x12, 0xef, 0xdc, 0x9d, 0x91, 0x09, 0x8e, 0xd8,
|
||||||
|
0xc3, 0xf8, 0x7b, 0x35, 0x41, 0x3b, 0xf8, 0xf5,
|
||||||
|
0x37, 0x48, 0x04, 0xf7, 0x94, 0xbf, 0x54, 0x8d,
|
||||||
|
0x79, 0x49, 0x8f, 0xf0, 0x3f, 0xb7, 0x90, 0x76,
|
||||||
|
0x14, 0x09, 0xc6, 0x8c, 0xba, 0x1a, 0x30, 0x1b,
|
||||||
|
0xbb, 0xd9, 0xe2, 0xb5, 0xe8, 0xd9, 0x9b, 0x68,
|
||||||
|
0x60, 0x90, 0xd3, 0x4a, 0xe8, 0x65, 0x7b, 0xaa,
|
||||||
|
0xb0, 0xda, 0x69, 0x1d, 0x45, 0x78, 0x2c, 0x3b,
|
||||||
|
0x59, 0x29, 0x3c, 0x26, 0x9a, 0xd2, 0xa5, 0xfd,
|
||||||
|
0xb7, 0x16, 0x59, 0x7c, 0x46, 0xea, 0x99, 0xd0,
|
||||||
|
0x06, 0x01, 0x3f, 0xd2, 0x23, 0xcc, 0xde, 0xb8,
|
||||||
|
0xaa, 0x88, 0x17, 0x03, 0xe1, 0x48, 0x2c, 0xdd,
|
||||||
|
0xce, 0xd1, 0x2c, 0xce, 0x37, 0xee, 0xe6, 0xa6,
|
||||||
|
0x47, 0x8c, 0x07, 0xe5, 0xfe, 0x01, 0xc6, 0x27,
|
||||||
|
0xfe, 0x3f, 0x9d, 0x30, 0x18, 0x36, 0xe7, 0xa7,
|
||||||
|
0x37, 0x1d, 0xcf, 0x6d, 0x4c, 0x82, 0xec, 0x58,
|
||||||
|
0xa1, 0x6f, 0x56, 0xc6, 0x08, 0x25, 0x94, 0xda,
|
||||||
|
0xae, 0x1a, 0x4f, 0xda, 0xb2, 0xf4, 0xbf, 0x94,
|
||||||
|
0xff, 0x66, 0x6a, 0xb1, 0x1f, 0x42, 0xfe, 0x32,
|
||||||
|
0xa4, 0x0e, 0x3d, 0x6a, 0x16, 0x44, 0xe0, 0xac,
|
||||||
|
0xe8, 0xc1, 0xe2, 0xa8, 0x73, 0xab, 0xac, 0x58,
|
||||||
|
0xb1, 0xbc, 0x94, 0xb2, 0x6a, 0xe4, 0x45, 0xf5,
|
||||||
|
0x90, 0x6b, 0x82, 0xeb, 0x9e, 0x22, 0x9e, 0xb2,
|
||||||
|
0x27, 0x3e, 0xc8, 0x55, 0xf4, 0x8f, 0xda, 0x04,
|
||||||
|
0xa3, 0x9c, 0xa4, 0x79, 0xbd, 0x79, 0xd3, 0xbd,
|
||||||
|
0xbe, 0x72, 0x7f, 0x90, 0xef, 0xc3, 0x34, 0x17,
|
||||||
|
0x72, 0x6f, 0xb4, 0xfe, 0x62, 0x56, 0xc3, 0xd6,
|
||||||
|
0x43, 0xc8, 0x4c, 0x76, 0x91, 0x04, 0x97, 0x4c,
|
||||||
|
0x84, 0x98, 0x56, 0xb7, 0x7b, 0x4f, 0xd5, 0xcf,
|
||||||
|
0x1b, 0x9c, 0x09, 0xe3, 0x1d, 0xdf, 0x0e, 0xfa,
|
||||||
|
0x39, 0xc8, 0x48, 0x43, 0x84, 0xec, 0x79, 0xc8,
|
||||||
|
0x7f, 0x4f, 0xa8, 0xc0, 0xb4, 0xde, 0x8b, 0x79,
|
||||||
|
0xcb, 0x9c, 0x42, 0x81, 0x49, 0xdc, 0x39, 0xb5,
|
||||||
|
0x31, 0xa6, 0x22, 0xba, 0x71, 0xb8, 0x2d, 0x1d,
|
||||||
|
0xc8, 0x17, 0xd8, 0x9d, 0x26, 0x2b, 0xd5, 0xcf,
|
||||||
|
0x57, 0x46, 0x0a, 0x61, 0x7e, 0xb7, 0xc3, 0x9c,
|
||||||
|
0xa6, 0x44, 0x60, 0x2d, 0x30, 0xb8, 0x10, 0x47,
|
||||||
|
0x7d, 0x7e, 0x87, 0x76, 0xc1, 0x4e, 0x85, 0x77,
|
||||||
|
0xbc, 0x30, 0x32, 0x56, 0x0a, 0x5b, 0x1c, 0xd0,
|
||||||
|
0xf6, 0x47, 0x48, 0x22, 0xf4, 0x6e, 0x38, 0xc5,
|
||||||
|
0xab, 0xe2, 0xd0, 0x4d, 0x40, 0x27, 0xab, 0x8f,
|
||||||
|
0x43, 0xb1, 0x60, 0x29, 0x07, 0xd0, 0xf5, 0x25,
|
||||||
|
0xe5, 0xfa, 0xe7, 0x46, 0x32, 0x37, 0xb9, 0xae,
|
||||||
|
0x2e, 0x02, 0x8c, 0x94, 0x15, 0x69, 0xd6, 0x74,
|
||||||
|
0xb4, 0x36, 0xdd, 0x94, 0x70, 0xa7, 0x16, 0x7b,
|
||||||
|
0x4c, 0xd3, 0x48, 0x83, 0xc5, 0xb2, 0xb0, 0x6a,
|
||||||
|
0xfe, 0x7e, 0xd4, 0xe5, 0x6d, 0xa5, 0x96, 0x20,
|
||||||
|
0x08, 0x59, 0xbd, 0x0c, 0x3d, 0x55, 0xa5, 0x03,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IV method encblkno8, blkno 2.
|
||||||
|
*/
|
||||||
|
static const uint8_t c3des_cbc_192_encblkno8_vec2_ctxt[SECSIZE] = {
|
||||||
|
0xea, 0x7c, 0x8c, 0x8e, 0x3e, 0x61, 0x34, 0x3d,
|
||||||
|
0xe0, 0x7f, 0xd3, 0xe1, 0x3a, 0xb9, 0xc8, 0xf2,
|
||||||
|
0x98, 0xdc, 0x59, 0x26, 0xd2, 0xd8, 0xa7, 0x7f,
|
||||||
|
0x41, 0x98, 0x24, 0xa8, 0x28, 0x0c, 0x88, 0x55,
|
||||||
|
0x91, 0xdb, 0x29, 0x17, 0x70, 0xd7, 0x03, 0xff,
|
||||||
|
0xbd, 0x0e, 0xbf, 0xf8, 0x73, 0x92, 0x19, 0xe9,
|
||||||
|
0x92, 0x67, 0xdb, 0x08, 0x94, 0x77, 0x71, 0x2d,
|
||||||
|
0x00, 0xad, 0x26, 0x42, 0x2d, 0xac, 0x8c, 0x67,
|
||||||
|
0x6f, 0xb3, 0x8e, 0x36, 0x22, 0xeb, 0x1f, 0x8c,
|
||||||
|
0xd4, 0x9b, 0x9f, 0xa6, 0xa9, 0xb1, 0x52, 0x65,
|
||||||
|
0x9a, 0xfe, 0xcc, 0x92, 0x48, 0x75, 0xf6, 0xb8,
|
||||||
|
0x59, 0xfe, 0x0e, 0x67, 0x93, 0xce, 0x3b, 0x7e,
|
||||||
|
0x51, 0x74, 0xe5, 0x24, 0x35, 0x08, 0x68, 0x21,
|
||||||
|
0x6a, 0x7f, 0xdd, 0x8c, 0xfd, 0xcd, 0x6d, 0x90,
|
||||||
|
0xc5, 0x3b, 0x26, 0x9e, 0x00, 0xf4, 0x1e, 0x70,
|
||||||
|
0xd3, 0xe7, 0xe8, 0x2f, 0x52, 0x87, 0x76, 0x84,
|
||||||
|
0xbb, 0x5c, 0x76, 0x5a, 0xc8, 0xea, 0x74, 0xe2,
|
||||||
|
0x9e, 0x85, 0xf6, 0x53, 0x85, 0x1a, 0x6e, 0x02,
|
||||||
|
0x0d, 0x32, 0x11, 0xc4, 0xec, 0xee, 0x79, 0x27,
|
||||||
|
0xda, 0xca, 0xc0, 0x0b, 0x8e, 0x2d, 0xb7, 0x7d,
|
||||||
|
0x8c, 0x6e, 0xfb, 0xa3, 0xa8, 0x24, 0x24, 0x62,
|
||||||
|
0xc8, 0xdd, 0xc7, 0x16, 0x09, 0x33, 0x0f, 0xe5,
|
||||||
|
0xc8, 0x60, 0x3d, 0xb6, 0xbf, 0x6c, 0x28, 0xd2,
|
||||||
|
0x0b, 0x9c, 0xd9, 0xcb, 0x64, 0x49, 0xe4, 0x80,
|
||||||
|
0x72, 0x58, 0xaa, 0xaa, 0x7e, 0x1d, 0x9f, 0xd7,
|
||||||
|
0x29, 0x15, 0x65, 0xfc, 0xfd, 0x3f, 0xe1, 0x82,
|
||||||
|
0x25, 0x3c, 0xd4, 0xbe, 0x59, 0x79, 0x63, 0xd1,
|
||||||
|
0xd6, 0x0e, 0xda, 0x00, 0xf3, 0xaa, 0x13, 0xd3,
|
||||||
|
0xed, 0xef, 0xca, 0x8b, 0x97, 0x15, 0x2d, 0x10,
|
||||||
|
0x6f, 0xcf, 0xee, 0xc7, 0x21, 0xad, 0xe3, 0xe4,
|
||||||
|
0xd8, 0x95, 0x21, 0x1f, 0xc0, 0x06, 0x3a, 0xbc,
|
||||||
|
0xbb, 0x2a, 0x92, 0x78, 0x76, 0x9d, 0x1e, 0x7b,
|
||||||
|
0xb5, 0x29, 0xaf, 0x96, 0x75, 0x2b, 0x41, 0xbd,
|
||||||
|
0xae, 0x79, 0x28, 0x72, 0xe7, 0x54, 0xc4, 0x08,
|
||||||
|
0xd3, 0xd2, 0xac, 0x96, 0xd0, 0x0f, 0x9b, 0x68,
|
||||||
|
0x7d, 0x3f, 0xc2, 0xdd, 0x3d, 0xfc, 0xca, 0xcd,
|
||||||
|
0x11, 0x71, 0xd9, 0x48, 0x53, 0x9f, 0xd3, 0x79,
|
||||||
|
0x7d, 0x47, 0x71, 0x2a, 0x6d, 0x9e, 0xa9, 0x47,
|
||||||
|
0xa1, 0xf7, 0x97, 0x80, 0x83, 0x70, 0x6b, 0xfe,
|
||||||
|
0x10, 0x11, 0x6a, 0x0e, 0xdd, 0xde, 0x22, 0x3c,
|
||||||
|
0x19, 0x30, 0x73, 0x73, 0x2e, 0x4b, 0x54, 0x17,
|
||||||
|
0xc3, 0x2e, 0xe9, 0xce, 0xe0, 0xe3, 0xa0, 0x1a,
|
||||||
|
0x28, 0xd1, 0x50, 0xa8, 0xd2, 0x40, 0xe2, 0x1b,
|
||||||
|
0xfa, 0x49, 0x06, 0x49, 0x8b, 0x4b, 0xd9, 0xd5,
|
||||||
|
0xf5, 0x50, 0xae, 0x64, 0x19, 0xe1, 0xd9, 0x4e,
|
||||||
|
0xbb, 0x29, 0x70, 0x66, 0x46, 0xa8, 0x7e, 0x5b,
|
||||||
|
0xdc, 0xe2, 0xd5, 0x9d, 0x56, 0x6d, 0x4c, 0xe6,
|
||||||
|
0x0e, 0x6b, 0x71, 0x40, 0x82, 0xf7, 0xb3, 0xad,
|
||||||
|
0x23, 0x17, 0xe3, 0x1c, 0x61, 0x1d, 0x3b, 0x71,
|
||||||
|
0xfc, 0x06, 0x17, 0xec, 0x6c, 0x77, 0x98, 0x27,
|
||||||
|
0xc7, 0x4b, 0x65, 0x17, 0x81, 0xe7, 0xcb, 0xce,
|
||||||
|
0x09, 0x76, 0x82, 0x82, 0x4a, 0x53, 0x67, 0xa0,
|
||||||
|
0x05, 0x25, 0x4c, 0xc4, 0xa7, 0xad, 0xa7, 0xaf,
|
||||||
|
0xa0, 0x11, 0xd7, 0x73, 0x3b, 0x30, 0xbf, 0x53,
|
||||||
|
0x50, 0x9b, 0xd8, 0xf3, 0x32, 0x15, 0xdd, 0x36,
|
||||||
|
0x88, 0xc2, 0x39, 0x51, 0xb6, 0xb8, 0x0d, 0x5c,
|
||||||
|
0x20, 0x4e, 0x24, 0xee, 0x95, 0x32, 0x61, 0x25,
|
||||||
|
0xda, 0x73, 0x0d, 0x8a, 0x58, 0xe6, 0xcc, 0xad,
|
||||||
|
0x79, 0x3d, 0xef, 0x29, 0x0c, 0x9f, 0xe1, 0xa7,
|
||||||
|
0x22, 0x1e, 0xea, 0x7a, 0x4f, 0xfb, 0xc1, 0x1f,
|
||||||
|
0x17, 0xca, 0x69, 0xd6, 0xa4, 0xce, 0x6e, 0xc0,
|
||||||
|
0x70, 0xa3, 0x08, 0x32, 0x87, 0xb4, 0x6b, 0x80,
|
||||||
|
0x5c, 0x7f, 0x88, 0x5c, 0xbf, 0x07, 0xd8, 0xe9,
|
||||||
|
0xdd, 0xd2, 0x76, 0xa9, 0xaa, 0xd9, 0x55, 0x48,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IV method encblkno8, blkno 3.
|
||||||
|
*/
|
||||||
|
static const uint8_t c3des_cbc_192_encblkno8_vec3_ctxt[SECSIZE] = {
|
||||||
|
0xf3, 0x49, 0xda, 0x5c, 0xde, 0x9d, 0x3e, 0x9d,
|
||||||
|
0xb9, 0xc2, 0x6e, 0x96, 0xa9, 0x93, 0x10, 0x73,
|
||||||
|
0x0e, 0x26, 0x39, 0xd6, 0x9f, 0x04, 0x5f, 0x69,
|
||||||
|
0x54, 0xa3, 0x7c, 0x46, 0x7b, 0x18, 0x93, 0xc0,
|
||||||
|
0xbb, 0x0c, 0x96, 0x6f, 0xb0, 0xbf, 0xce, 0x67,
|
||||||
|
0x33, 0x3e, 0x56, 0xe8, 0x6b, 0x4d, 0x3f, 0xc8,
|
||||||
|
0x3c, 0xc6, 0x89, 0x2c, 0x0b, 0x95, 0x3a, 0xaf,
|
||||||
|
0xc0, 0xf3, 0x1f, 0x0e, 0x07, 0x01, 0xa6, 0x35,
|
||||||
|
0x19, 0x79, 0x91, 0x24, 0xaa, 0x0d, 0xf0, 0x53,
|
||||||
|
0x27, 0x7d, 0xbb, 0xa6, 0xb6, 0x44, 0x31, 0x4b,
|
||||||
|
0xd4, 0xcf, 0xf6, 0x6d, 0x18, 0xa2, 0x28, 0x8a,
|
||||||
|
0xc1, 0x0a, 0xbe, 0x57, 0x0c, 0x61, 0x5f, 0xd9,
|
||||||
|
0x12, 0x14, 0xfe, 0xe2, 0xc7, 0x10, 0x72, 0xee,
|
||||||
|
0x19, 0xb8, 0x16, 0x0b, 0x88, 0x87, 0xce, 0xf3,
|
||||||
|
0xfe, 0x57, 0x37, 0xd1, 0xa2, 0xf7, 0xd0, 0x5e,
|
||||||
|
0x73, 0xde, 0x39, 0x35, 0xbc, 0xde, 0xed, 0x61,
|
||||||
|
0x4b, 0x31, 0xdc, 0xfe, 0x3c, 0x4d, 0x98, 0xa9,
|
||||||
|
0x36, 0xb0, 0x34, 0x5b, 0xb4, 0xb7, 0x79, 0x25,
|
||||||
|
0x6e, 0x24, 0x7e, 0x10, 0xfe, 0x20, 0xd5, 0x16,
|
||||||
|
0x86, 0xaf, 0xcd, 0x26, 0x34, 0xd3, 0x2e, 0xdc,
|
||||||
|
0x7c, 0x69, 0xe3, 0xc5, 0x62, 0x0c, 0xba, 0x29,
|
||||||
|
0x9c, 0x4b, 0x2f, 0x39, 0x45, 0xe1, 0xcf, 0xc5,
|
||||||
|
0xfe, 0x35, 0xb6, 0x2f, 0xb1, 0x1a, 0x90, 0xe1,
|
||||||
|
0xa7, 0x39, 0xe8, 0x1e, 0x5f, 0xac, 0xab, 0x1e,
|
||||||
|
0x32, 0xba, 0xc5, 0x92, 0x39, 0x62, 0x37, 0x2c,
|
||||||
|
0x49, 0xf1, 0x62, 0x90, 0xf7, 0x1e, 0x10, 0xce,
|
||||||
|
0x8e, 0x95, 0xa3, 0xc6, 0xd8, 0xe5, 0xc8, 0xdf,
|
||||||
|
0xcc, 0x94, 0x7d, 0x26, 0xab, 0x29, 0xbb, 0x9d,
|
||||||
|
0xf3, 0x73, 0xce, 0xac, 0x76, 0xdf, 0x75, 0x2a,
|
||||||
|
0x3e, 0x8f, 0x47, 0xff, 0x76, 0xfe, 0xea, 0xd4,
|
||||||
|
0x4a, 0xa9, 0x36, 0x9d, 0x12, 0x45, 0xb7, 0x99,
|
||||||
|
0x81, 0xb6, 0x77, 0x98, 0x13, 0xfb, 0x5a, 0xe5,
|
||||||
|
0x40, 0x87, 0x61, 0x0d, 0x10, 0x76, 0xf6, 0x3e,
|
||||||
|
0x48, 0xac, 0xc4, 0x27, 0x87, 0xcd, 0x07, 0xde,
|
||||||
|
0x0b, 0x23, 0x97, 0x61, 0x3d, 0x18, 0x64, 0x7f,
|
||||||
|
0xbf, 0xd6, 0x87, 0xc1, 0x11, 0xfb, 0xf9, 0xda,
|
||||||
|
0x14, 0xa1, 0x01, 0xf8, 0x7e, 0xea, 0x5b, 0x5b,
|
||||||
|
0xdd, 0x09, 0xf9, 0x31, 0x80, 0x3c, 0xee, 0x34,
|
||||||
|
0x2d, 0xda, 0x71, 0xd9, 0x32, 0x7d, 0x45, 0xb2,
|
||||||
|
0x53, 0xea, 0xd5, 0x7c, 0x85, 0x45, 0xce, 0x1d,
|
||||||
|
0x2b, 0xe9, 0xd7, 0x95, 0xf8, 0x8c, 0x08, 0xe4,
|
||||||
|
0xd0, 0x2f, 0x60, 0x75, 0x02, 0xf3, 0xde, 0xeb,
|
||||||
|
0x46, 0x40, 0xa8, 0xd2, 0x37, 0xd6, 0xca, 0x5d,
|
||||||
|
0xb9, 0xf4, 0x51, 0x31, 0x8a, 0x1a, 0x82, 0xbd,
|
||||||
|
0x6f, 0x6d, 0x88, 0x2b, 0x63, 0x0f, 0xe1, 0xf0,
|
||||||
|
0xcf, 0x13, 0x79, 0x1d, 0x78, 0x82, 0x66, 0xa1,
|
||||||
|
0xef, 0xdb, 0x34, 0x50, 0xd2, 0x71, 0x47, 0x49,
|
||||||
|
0x41, 0x74, 0xd9, 0x0b, 0x14, 0x38, 0x1f, 0xc3,
|
||||||
|
0x09, 0x4d, 0xb3, 0xa6, 0x03, 0x3f, 0x56, 0x67,
|
||||||
|
0xd7, 0x51, 0x4c, 0x8a, 0x1d, 0x37, 0x99, 0xfb,
|
||||||
|
0xe1, 0x84, 0x57, 0x55, 0x9b, 0xf8, 0x73, 0x63,
|
||||||
|
0x68, 0x73, 0x89, 0x52, 0x06, 0xe7, 0x34, 0xe7,
|
||||||
|
0x1a, 0x15, 0x7e, 0xd9, 0x84, 0xa3, 0x0e, 0x68,
|
||||||
|
0x14, 0x1c, 0xe8, 0x23, 0x9e, 0xe3, 0x8f, 0x71,
|
||||||
|
0x02, 0x9b, 0x87, 0xd4, 0xd9, 0x1b, 0xd1, 0x9e,
|
||||||
|
0x9e, 0xa0, 0x7e, 0x49, 0x8e, 0xaa, 0x89, 0xb5,
|
||||||
|
0x16, 0x48, 0x07, 0xb3, 0x3d, 0x9e, 0x4c, 0x35,
|
||||||
|
0x3e, 0x94, 0xa9, 0xf8, 0x82, 0x50, 0x6a, 0x41,
|
||||||
|
0x28, 0x3e, 0x9f, 0x9a, 0x1a, 0x5d, 0x02, 0x7c,
|
||||||
|
0xd0, 0x32, 0x52, 0xa5, 0xee, 0x09, 0x27, 0x2d,
|
||||||
|
0x49, 0x17, 0xf7, 0x92, 0xa1, 0x63, 0x9d, 0x2a,
|
||||||
|
0xfd, 0x53, 0x26, 0x14, 0x7c, 0x92, 0x72, 0xa6,
|
||||||
|
0x38, 0x18, 0x8f, 0xb5, 0x54, 0xb3, 0x69, 0x63,
|
||||||
|
0x6a, 0xdc, 0xb1, 0x5a, 0x12, 0x7a, 0x0b, 0xa3,
|
||||||
|
};
|
||||||
|
|
||||||
|
const struct testvec c3des_cbc_192_8_vectors[] = {
|
||||||
|
{
|
||||||
|
.blkno = 0,
|
||||||
|
.ptxt = c3des_cbc_ptxt,
|
||||||
|
.ctxt = c3des_cbc_192_encblkno8_vec0_ctxt,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.blkno = 1,
|
||||||
|
.ptxt = c3des_cbc_ptxt,
|
||||||
|
.ctxt = c3des_cbc_192_encblkno8_vec1_ctxt,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.blkno = 2,
|
||||||
|
.ptxt = c3des_cbc_ptxt,
|
||||||
|
.ctxt = c3des_cbc_192_encblkno8_vec2_ctxt,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.blkno = 3,
|
||||||
|
.ptxt = c3des_cbc_ptxt,
|
||||||
|
.ctxt = c3des_cbc_192_encblkno8_vec3_ctxt,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static int
|
||||||
|
open_disk(const char *devpath, const char *imgpath, size_t size)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
|
||||||
|
if (fd < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (ftruncate(fd, size) < 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
if (rump_pub_etfs_register_withsize(devpath,
|
||||||
|
imgpath, RUMP_ETFS_BLK, 0, size) < 0) {
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
unlink(imgpath);
|
||||||
|
return fd;
|
||||||
|
fail:
|
||||||
|
close(fd);
|
||||||
|
unlink(imgpath);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
open_cgd(int devno)
|
||||||
|
{
|
||||||
|
char devpath[32];
|
||||||
|
|
||||||
|
sprintf(devpath, "/dev/rcgd%d%c", devno, getrawpartition() + 'a');
|
||||||
|
|
||||||
|
return rump_sys_open(devpath, O_RDWR, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
configure_cgd(int fd, const char *dkpath, const char *alg,
|
||||||
|
const char *ivmethod, const char *key, size_t keylen)
|
||||||
|
{
|
||||||
|
struct cgd_ioctl ci;
|
||||||
|
|
||||||
|
memset(&ci, 0, sizeof(ci));
|
||||||
|
ci.ci_disk = dkpath;
|
||||||
|
ci.ci_alg = alg;
|
||||||
|
ci.ci_ivmethod = ivmethod;
|
||||||
|
ci.ci_keylen = 8 * keylen - 8; /* Exclude the NUL terminator. */
|
||||||
|
ci.ci_key = key;
|
||||||
|
ci.ci_blocksize = 64;
|
||||||
|
|
||||||
|
return rump_sys_ioctl(fd, CGDIOCSET, &ci);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
unconfigure_cgd(int fd)
|
||||||
|
{
|
||||||
|
struct cgd_ioctl ci;
|
||||||
|
|
||||||
|
return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
write_testvec(int cgdfd, const struct testvec *tv)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (rump_sys_write(cgdfd, tv->ptxt, SECSIZE) != SECSIZE)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
read_testvec(int cgdfd, const struct testvec *tv)
|
||||||
|
{
|
||||||
|
char *buf;
|
||||||
|
int res = -1;
|
||||||
|
|
||||||
|
buf = malloc(SECSIZE);
|
||||||
|
if (buf == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
if (rump_sys_read(cgdfd, buf, SECSIZE) != SECSIZE)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
res = memcmp(buf, tv->ptxt, SECSIZE);
|
||||||
|
fail:
|
||||||
|
free(buf);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
check_testvec(int dkfd, const struct testvec *tv)
|
||||||
|
{
|
||||||
|
char *buf;
|
||||||
|
int res = -1;
|
||||||
|
|
||||||
|
buf = malloc(SECSIZE);
|
||||||
|
if (buf == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (lseek(dkfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
if (read(dkfd, buf, SECSIZE) != SECSIZE)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
res = memcmp(buf, tv->ctxt, SECSIZE);
|
||||||
|
fail:
|
||||||
|
free(buf);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(cgd_3des_cbc_192_encblkno1);
|
||||||
|
ATF_TC_HEAD(cgd_3des_cbc_192_encblkno1, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test 3des-cbc with 192 bits key, ivmethod encblkno1");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(cgd_3des_cbc_192_encblkno1, tc)
|
||||||
|
{
|
||||||
|
const char imgpath[] = "3des-cbc-192-encblkno1.img";
|
||||||
|
const char *dkpath = "/dev/dk";
|
||||||
|
const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
|
||||||
|
int dkfd, cgdfd;
|
||||||
|
|
||||||
|
rump_init();
|
||||||
|
|
||||||
|
RL(dkfd = open_disk(dkpath, imgpath, dksize));
|
||||||
|
|
||||||
|
RL(cgdfd = open_cgd(0));
|
||||||
|
RL(configure_cgd(cgdfd, dkpath, "3des-cbc", "encblkno1",
|
||||||
|
c3des_cbc_192_key, sizeof(c3des_cbc_192_key)));
|
||||||
|
|
||||||
|
ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_1_vectors[0]), 0);
|
||||||
|
ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_1_vectors[1]), 0);
|
||||||
|
ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_1_vectors[2]), 0);
|
||||||
|
ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_1_vectors[3]), 0);
|
||||||
|
|
||||||
|
RL(unconfigure_cgd(cgdfd));
|
||||||
|
RL(configure_cgd(cgdfd, dkpath, "3des-cbc", "encblkno1",
|
||||||
|
c3des_cbc_192_key, sizeof(c3des_cbc_192_key)));
|
||||||
|
|
||||||
|
ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_1_vectors[0]), 0);
|
||||||
|
ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_1_vectors[1]), 0);
|
||||||
|
ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_1_vectors[2]), 0);
|
||||||
|
ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_1_vectors[3]), 0);
|
||||||
|
|
||||||
|
RL(unconfigure_cgd(cgdfd));
|
||||||
|
RL(rump_sys_close(cgdfd));
|
||||||
|
|
||||||
|
ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_1_vectors[0]), 0);
|
||||||
|
ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_1_vectors[1]), 0);
|
||||||
|
ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_1_vectors[2]), 0);
|
||||||
|
ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_1_vectors[3]), 0);
|
||||||
|
|
||||||
|
RL(close(dkfd));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(cgd_3des_cbc_192_encblkno8);
|
||||||
|
ATF_TC_HEAD(cgd_3des_cbc_192_encblkno8, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test 3des-cbc with 192 bits key, ivmethod encblkno8");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(cgd_3des_cbc_192_encblkno8, tc)
|
||||||
|
{
|
||||||
|
const char imgpath[] = "3des-cbc-192-encblkno8.img";
|
||||||
|
const char *dkpath = "/dev/dk";
|
||||||
|
const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
|
||||||
|
int dkfd, cgdfd;
|
||||||
|
|
||||||
|
rump_init();
|
||||||
|
|
||||||
|
RL(dkfd = open_disk(dkpath, imgpath, dksize));
|
||||||
|
|
||||||
|
RL(cgdfd = open_cgd(0));
|
||||||
|
RL(configure_cgd(cgdfd, dkpath, "3des-cbc", "encblkno8",
|
||||||
|
c3des_cbc_192_key, sizeof(c3des_cbc_192_key)));
|
||||||
|
|
||||||
|
ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_8_vectors[0]), 0);
|
||||||
|
ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_8_vectors[1]), 0);
|
||||||
|
ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_8_vectors[2]), 0);
|
||||||
|
ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_8_vectors[3]), 0);
|
||||||
|
|
||||||
|
RL(unconfigure_cgd(cgdfd));
|
||||||
|
RL(configure_cgd(cgdfd, dkpath, "3des-cbc", "encblkno8",
|
||||||
|
c3des_cbc_192_key, sizeof(c3des_cbc_192_key)));
|
||||||
|
|
||||||
|
ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_8_vectors[0]), 0);
|
||||||
|
ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_8_vectors[1]), 0);
|
||||||
|
ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_8_vectors[2]), 0);
|
||||||
|
ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_8_vectors[3]), 0);
|
||||||
|
|
||||||
|
RL(unconfigure_cgd(cgdfd));
|
||||||
|
RL(rump_sys_close(cgdfd));
|
||||||
|
|
||||||
|
ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_8_vectors[0]), 0);
|
||||||
|
ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_8_vectors[1]), 0);
|
||||||
|
ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_8_vectors[2]), 0);
|
||||||
|
ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_8_vectors[3]), 0);
|
||||||
|
|
||||||
|
RL(close(dkfd));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TP_ADD_TCS(tp)
|
||||||
|
{
|
||||||
|
|
||||||
|
ATF_TP_ADD_TC(tp, cgd_3des_cbc_192_encblkno1);
|
||||||
|
ATF_TP_ADD_TC(tp, cgd_3des_cbc_192_encblkno8);
|
||||||
|
|
||||||
|
return atf_no_error();
|
||||||
|
}
|
3606
contrib/netbsd-tests/dev/cgd/t_cgd_aes.c
Normal file
3606
contrib/netbsd-tests/dev/cgd/t_cgd_aes.c
Normal file
File diff suppressed because it is too large
Load Diff
2341
contrib/netbsd-tests/dev/cgd/t_cgd_blowfish.c
Normal file
2341
contrib/netbsd-tests/dev/cgd/t_cgd_blowfish.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: ffs_common.sh,v 1.2 2013/07/29 13:15:24 skrll Exp $
|
# $NetBSD: ffs_common.sh,v 1.3 2016/10/08 13:23:53 gson Exp $
|
||||||
|
|
||||||
create_ffs()
|
create_ffs()
|
||||||
{
|
{
|
||||||
@ -45,7 +45,7 @@ test_case()
|
|||||||
|
|
||||||
eval "${name}_head() { \
|
eval "${name}_head() { \
|
||||||
atf_set "descr" "${descr}"
|
atf_set "descr" "${descr}"
|
||||||
atf_set "timeout" "60"
|
atf_set "timeout" "120"
|
||||||
}"
|
}"
|
||||||
eval "${name}_body() { \
|
eval "${name}_body() { \
|
||||||
RUMP_SOCKETS_LIST=\${RUMP_SOCKET}; \
|
RUMP_SOCKETS_LIST=\${RUMP_SOCKET}; \
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
/* Test case written by Bharat Joshi */
|
/* Test case written by Bharat Joshi */
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: t_fifo.c,v 1.1 2011/12/21 00:17:07 christos Exp $");
|
__RCSID("$NetBSD: t_fifo.c,v 1.2 2017/01/10 22:36:29 christos Exp $");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_psshfs.sh,v 1.7 2013/03/16 07:54:04 jmmv Exp $
|
# $NetBSD: t_psshfs.sh,v 1.8 2016/09/05 08:53:57 christos Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -262,6 +262,26 @@ setattr_cache_cleanup() {
|
|||||||
stop_ssh
|
stop_ssh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atf_test_case read_empty_file cleanup
|
||||||
|
read_empty_file_head() {
|
||||||
|
atf_set "descr" "Checks whether an empty file can be read"
|
||||||
|
# This test is supposed to make sure psshfs does not hang
|
||||||
|
# when reading from an empty file, hence the timeout.
|
||||||
|
atf_set "timeout" 8
|
||||||
|
}
|
||||||
|
read_empty_file_body() {
|
||||||
|
require_puffs
|
||||||
|
start_ssh
|
||||||
|
atf_check mkdir root mnt
|
||||||
|
atf_check -x ': > root/empty'
|
||||||
|
mount_psshfs root mnt
|
||||||
|
atf_check cat mnt/empty
|
||||||
|
}
|
||||||
|
read_empty_file_cleanup() {
|
||||||
|
umount mnt
|
||||||
|
stop_ssh
|
||||||
|
}
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# Initialization.
|
# Initialization.
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
@ -271,4 +291,5 @@ atf_init_test_cases() {
|
|||||||
atf_add_test_case pwd
|
atf_add_test_case pwd
|
||||||
atf_add_test_case ls
|
atf_add_test_case ls
|
||||||
#atf_add_test_case setattr_cache
|
#atf_add_test_case setattr_cache
|
||||||
|
atf_add_test_case read_empty_file
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_basic.c,v 1.12 2013/10/19 17:45:00 christos Exp $ */
|
/* $NetBSD: t_basic.c,v 1.13 2016/12/01 14:49:04 hannken Exp $ */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
@ -286,7 +286,7 @@ ATF_TC_BODY(inactive_reclaim, tc)
|
|||||||
rump_sys_close(fd);
|
rump_sys_close(fd);
|
||||||
syncbar(FSTEST_MNTNAME);
|
syncbar(FSTEST_MNTNAME);
|
||||||
|
|
||||||
ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], 1);
|
ATF_REQUIRE(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE] > 0);
|
||||||
ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 1);
|
ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 1);
|
||||||
|
|
||||||
FSTEST_EXIT();
|
FSTEST_EXIT();
|
||||||
@ -383,7 +383,7 @@ ATF_TC_BODY(unlink_accessible, tc)
|
|||||||
syncbar(FSTEST_MNTNAME);
|
syncbar(FSTEST_MNTNAME);
|
||||||
|
|
||||||
ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 1);
|
ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 1);
|
||||||
ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], ianow+1);
|
ATF_REQUIRE(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE] > ianow);
|
||||||
|
|
||||||
ATF_REQUIRE_STREQ(buf, MAGICSTR);
|
ATF_REQUIRE_STREQ(buf, MAGICSTR);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_vnops.c,v 1.55 2016/01/28 10:10:09 martin Exp $ */
|
/* $NetBSD: t_vnops.c,v 1.58 2016/08/29 02:31:46 kre Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||||
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <atf-c.h>
|
#include <atf-c.h>
|
||||||
@ -55,10 +56,10 @@
|
|||||||
atf_tc_skip("symlinks not supported by file system")
|
atf_tc_skip("symlinks not supported by file system")
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
md(char *buf, const char *base, const char *tail)
|
md(char *buf, size_t buflen, const char *base, const char *tail)
|
||||||
{
|
{
|
||||||
|
|
||||||
sprintf(buf, "%s/%s", base, tail);
|
snprintf(buf, buflen, "%s/%s", base, tail);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,11 +70,11 @@ lookup_simple(const atf_tc_t *tc, const char *mountpath)
|
|||||||
struct stat sb1, sb2;
|
struct stat sb1, sb2;
|
||||||
|
|
||||||
strcpy(final, mountpath);
|
strcpy(final, mountpath);
|
||||||
sprintf(pb, "%s/../%s", mountpath, basename(final));
|
snprintf(pb, sizeof(pb), "%s/../%s", mountpath, basename(final));
|
||||||
if (rump_sys_stat(pb, &sb1) == -1)
|
if (rump_sys_stat(pb, &sb1) == -1)
|
||||||
atf_tc_fail_errno("stat 1");
|
atf_tc_fail_errno("stat 1");
|
||||||
|
|
||||||
sprintf(pb, "%s/./../%s", mountpath, basename(final));
|
snprintf(pb, sizeof(pb), "%s/./../%s", mountpath, basename(final));
|
||||||
if (rump_sys_stat(pb, &sb2) == -1)
|
if (rump_sys_stat(pb, &sb2) == -1)
|
||||||
atf_tc_fail_errno("stat 2");
|
atf_tc_fail_errno("stat 2");
|
||||||
|
|
||||||
@ -85,22 +86,38 @@ lookup_complex(const atf_tc_t *tc, const char *mountpath)
|
|||||||
{
|
{
|
||||||
char pb[MAXPATHLEN];
|
char pb[MAXPATHLEN];
|
||||||
struct stat sb1, sb2;
|
struct stat sb1, sb2;
|
||||||
|
struct timespec atplus1, onesec;
|
||||||
|
|
||||||
USES_DIRS;
|
USES_DIRS;
|
||||||
|
|
||||||
if (FSTYPE_UDF(tc))
|
snprintf(pb, sizeof(pb), "%s/dir", mountpath);
|
||||||
atf_tc_expect_fail("PR kern/49033");
|
|
||||||
|
|
||||||
sprintf(pb, "%s/dir", mountpath);
|
|
||||||
if (rump_sys_mkdir(pb, 0777) == -1)
|
if (rump_sys_mkdir(pb, 0777) == -1)
|
||||||
atf_tc_fail_errno("mkdir");
|
atf_tc_fail_errno("mkdir");
|
||||||
if (rump_sys_stat(pb, &sb1) == -1)
|
if (rump_sys_stat(pb, &sb1) == -1)
|
||||||
atf_tc_fail_errno("stat 1");
|
atf_tc_fail_errno("stat 1");
|
||||||
|
|
||||||
sprintf(pb, "%s/./dir/../././dir/.", mountpath);
|
snprintf(pb, sizeof(pb), "%s/./dir/../././dir/.", mountpath);
|
||||||
if (rump_sys_stat(pb, &sb2) == -1)
|
if (rump_sys_stat(pb, &sb2) == -1)
|
||||||
atf_tc_fail_errno("stat 2");
|
atf_tc_fail_errno("stat 2");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The lookup is permitted to modify the access time of
|
||||||
|
* any directories searched - such a directory is the
|
||||||
|
* subject of this test. Any difference should cause
|
||||||
|
* the 2nd lookup atime tp be >= the first, if it is ==, all is
|
||||||
|
* OK (atime is not required to be modified by the search, or
|
||||||
|
* both references may happen within the came clock tick), if the
|
||||||
|
* 2nd lookup atime is > the first, but not "too much" greater,
|
||||||
|
* just set it back, so the memcmp just below succeeds
|
||||||
|
* (assuming all else is OK).
|
||||||
|
*/
|
||||||
|
onesec.tv_sec = 1;
|
||||||
|
onesec.tv_nsec = 0;
|
||||||
|
timespecadd(&sb1.st_atimespec, &onesec, &atplus1);
|
||||||
|
if (timespeccmp(&sb2.st_atimespec, &sb1.st_atimespec, >) &&
|
||||||
|
timespeccmp(&sb2.st_atimespec, &atplus1, <))
|
||||||
|
sb2.st_atimespec = sb1.st_atimespec;
|
||||||
|
|
||||||
if (memcmp(&sb1, &sb2, sizeof(sb1)) != 0) {
|
if (memcmp(&sb1, &sb2, sizeof(sb1)) != 0) {
|
||||||
printf("what\tsb1\t\tsb2\n");
|
printf("what\tsb1\t\tsb2\n");
|
||||||
|
|
||||||
@ -133,9 +150,6 @@ lookup_complex(const atf_tc_t *tc, const char *mountpath)
|
|||||||
|
|
||||||
atf_tc_fail("stat results differ, see ouput for more details");
|
atf_tc_fail("stat results differ, see ouput for more details");
|
||||||
}
|
}
|
||||||
if (FSTYPE_UDF(tc))
|
|
||||||
atf_tc_fail("random failure of PR kern/49033 "
|
|
||||||
"did not happen this time");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -147,7 +161,7 @@ dir_simple(const atf_tc_t *tc, const char *mountpath)
|
|||||||
USES_DIRS;
|
USES_DIRS;
|
||||||
|
|
||||||
/* check we can create directories */
|
/* check we can create directories */
|
||||||
sprintf(pb, "%s/dir", mountpath);
|
snprintf(pb, sizeof(pb), "%s/dir", mountpath);
|
||||||
if (rump_sys_mkdir(pb, 0777) == -1)
|
if (rump_sys_mkdir(pb, 0777) == -1)
|
||||||
atf_tc_fail_errno("mkdir");
|
atf_tc_fail_errno("mkdir");
|
||||||
if (rump_sys_stat(pb, &sb) == -1)
|
if (rump_sys_stat(pb, &sb) == -1)
|
||||||
@ -169,11 +183,11 @@ dir_notempty(const atf_tc_t *tc, const char *mountpath)
|
|||||||
USES_DIRS;
|
USES_DIRS;
|
||||||
|
|
||||||
/* check we can create directories */
|
/* check we can create directories */
|
||||||
sprintf(pb, "%s/dir", mountpath);
|
snprintf(pb, sizeof(pb), "%s/dir", mountpath);
|
||||||
if (rump_sys_mkdir(pb, 0777) == -1)
|
if (rump_sys_mkdir(pb, 0777) == -1)
|
||||||
atf_tc_fail_errno("mkdir");
|
atf_tc_fail_errno("mkdir");
|
||||||
|
|
||||||
sprintf(pb2, "%s/dir/file", mountpath);
|
snprintf(pb2, sizeof(pb2), "%s/dir/file", mountpath);
|
||||||
fd = rump_sys_open(pb2, O_RDWR | O_CREAT, 0777);
|
fd = rump_sys_open(pb2, O_RDWR | O_CREAT, 0777);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
atf_tc_fail_errno("create file");
|
atf_tc_fail_errno("create file");
|
||||||
@ -205,9 +219,9 @@ dir_rmdirdotdot(const atf_tc_t *tc, const char *mp)
|
|||||||
RL(rump_sys_mkdir("subtest", 0777));
|
RL(rump_sys_mkdir("subtest", 0777));
|
||||||
RL(rump_sys_chdir("subtest"));
|
RL(rump_sys_chdir("subtest"));
|
||||||
|
|
||||||
md(pb, mp, "test/subtest");
|
md(pb, sizeof(pb), mp, "test/subtest");
|
||||||
RL(rump_sys_rmdir(pb));
|
RL(rump_sys_rmdir(pb));
|
||||||
md(pb, mp, "test");
|
md(pb, sizeof(pb), mp, "test");
|
||||||
RL(rump_sys_rmdir(pb));
|
RL(rump_sys_rmdir(pb));
|
||||||
|
|
||||||
if (FSTYPE_NFS(tc))
|
if (FSTYPE_NFS(tc))
|
||||||
@ -225,7 +239,7 @@ checkfile(const char *path, struct stat *refp)
|
|||||||
struct stat sb;
|
struct stat sb;
|
||||||
static int n = 1;
|
static int n = 1;
|
||||||
|
|
||||||
md(buf, path, "file");
|
md(buf, sizeof(buf), path, "file");
|
||||||
if (rump_sys_stat(buf, &sb) == -1)
|
if (rump_sys_stat(buf, &sb) == -1)
|
||||||
atf_tc_fail_errno("cannot stat file %d (%s)", n, buf);
|
atf_tc_fail_errno("cannot stat file %d (%s)", n, buf);
|
||||||
if (memcmp(&sb, refp, sizeof(sb)) != 0)
|
if (memcmp(&sb, refp, sizeof(sb)) != 0)
|
||||||
@ -244,18 +258,18 @@ rename_dir(const atf_tc_t *tc, const char *mp)
|
|||||||
|
|
||||||
USES_DIRS;
|
USES_DIRS;
|
||||||
|
|
||||||
md(pb1, mp, "dir1");
|
md(pb1, sizeof(pb1), mp, "dir1");
|
||||||
if (rump_sys_mkdir(pb1, 0777) == -1)
|
if (rump_sys_mkdir(pb1, 0777) == -1)
|
||||||
atf_tc_fail_errno("mkdir 1");
|
atf_tc_fail_errno("mkdir 1");
|
||||||
|
|
||||||
md(pb2, mp, "dir2");
|
md(pb2, sizeof(pb2), mp, "dir2");
|
||||||
if (rump_sys_mkdir(pb2, 0777) == -1)
|
if (rump_sys_mkdir(pb2, 0777) == -1)
|
||||||
atf_tc_fail_errno("mkdir 2");
|
atf_tc_fail_errno("mkdir 2");
|
||||||
md(pb2, mp, "dir2/subdir");
|
md(pb2, sizeof(pb2), mp, "dir2/subdir");
|
||||||
if (rump_sys_mkdir(pb2, 0777) == -1)
|
if (rump_sys_mkdir(pb2, 0777) == -1)
|
||||||
atf_tc_fail_errno("mkdir 3");
|
atf_tc_fail_errno("mkdir 3");
|
||||||
|
|
||||||
md(pb3, mp, "dir1/file");
|
md(pb3, sizeof(pb3), mp, "dir1/file");
|
||||||
if (rump_sys_mknod(pb3, S_IFREG | 0777, -1) == -1)
|
if (rump_sys_mknod(pb3, S_IFREG | 0777, -1) == -1)
|
||||||
atf_tc_fail_errno("create file");
|
atf_tc_fail_errno("create file");
|
||||||
if (rump_sys_stat(pb3, &ref) == -1)
|
if (rump_sys_stat(pb3, &ref) == -1)
|
||||||
@ -266,13 +280,13 @@ rename_dir(const atf_tc_t *tc, const char *mp)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* rename within directory */
|
/* rename within directory */
|
||||||
md(pb3, mp, "dir3");
|
md(pb3, sizeof(pb3), mp, "dir3");
|
||||||
if (rump_sys_rename(pb1, pb3) == -1)
|
if (rump_sys_rename(pb1, pb3) == -1)
|
||||||
atf_tc_fail_errno("rename 1");
|
atf_tc_fail_errno("rename 1");
|
||||||
checkfile(pb3, &ref);
|
checkfile(pb3, &ref);
|
||||||
|
|
||||||
/* rename directory onto itself (two ways, should fail) */
|
/* rename directory onto itself (two ways, should fail) */
|
||||||
md(pb1, mp, "dir3/.");
|
md(pb1, sizeof(pb1), mp, "dir3/.");
|
||||||
if (rump_sys_rename(pb1, pb3) != -1 || errno != EINVAL)
|
if (rump_sys_rename(pb1, pb3) != -1 || errno != EINVAL)
|
||||||
atf_tc_fail_errno("rename 2");
|
atf_tc_fail_errno("rename 2");
|
||||||
if (rump_sys_rename(pb3, pb1) != -1 || errno != EISDIR)
|
if (rump_sys_rename(pb3, pb1) != -1 || errno != EISDIR)
|
||||||
@ -281,13 +295,13 @@ rename_dir(const atf_tc_t *tc, const char *mp)
|
|||||||
checkfile(pb3, &ref);
|
checkfile(pb3, &ref);
|
||||||
|
|
||||||
/* rename father of directory into directory */
|
/* rename father of directory into directory */
|
||||||
md(pb1, mp, "dir2/dir");
|
md(pb1, sizeof(pb1), mp, "dir2/dir");
|
||||||
md(pb2, mp, "dir2");
|
md(pb2, sizeof(pb2), mp, "dir2");
|
||||||
if (rump_sys_rename(pb2, pb1) != -1 || errno != EINVAL)
|
if (rump_sys_rename(pb2, pb1) != -1 || errno != EINVAL)
|
||||||
atf_tc_fail_errno("rename 4");
|
atf_tc_fail_errno("rename 4");
|
||||||
|
|
||||||
/* same for grandfather */
|
/* same for grandfather */
|
||||||
md(pb1, mp, "dir2/subdir/dir2");
|
md(pb1, sizeof(pb1), mp, "dir2/subdir/dir2");
|
||||||
if (rump_sys_rename(pb2, pb1) != -1 || errno != EINVAL)
|
if (rump_sys_rename(pb2, pb1) != -1 || errno != EINVAL)
|
||||||
atf_tc_fail("rename 5");
|
atf_tc_fail("rename 5");
|
||||||
|
|
||||||
@ -298,29 +312,29 @@ rename_dir(const atf_tc_t *tc, const char *mp)
|
|||||||
atf_tc_fail("rename 6");
|
atf_tc_fail("rename 6");
|
||||||
|
|
||||||
/* cross-directory rename */
|
/* cross-directory rename */
|
||||||
md(pb1, mp, "dir3");
|
md(pb1, sizeof(pb1), mp, "dir3");
|
||||||
md(pb2, mp, "dir2/somedir");
|
md(pb2, sizeof(pb2), mp, "dir2/somedir");
|
||||||
if (rump_sys_rename(pb1, pb2) == -1)
|
if (rump_sys_rename(pb1, pb2) == -1)
|
||||||
atf_tc_fail_errno("rename 7");
|
atf_tc_fail_errno("rename 7");
|
||||||
checkfile(pb2, &ref);
|
checkfile(pb2, &ref);
|
||||||
|
|
||||||
/* move to parent directory */
|
/* move to parent directory */
|
||||||
md(pb1, mp, "dir2/somedir/../../dir3");
|
md(pb1, sizeof(pb1), mp, "dir2/somedir/../../dir3");
|
||||||
if (rump_sys_rename(pb2, pb1) == -1)
|
if (rump_sys_rename(pb2, pb1) == -1)
|
||||||
atf_tc_fail_errno("rename 8");
|
atf_tc_fail_errno("rename 8");
|
||||||
md(pb1, mp, "dir2/../dir3");
|
md(pb1, sizeof(pb1), mp, "dir2/../dir3");
|
||||||
checkfile(pb1, &ref);
|
checkfile(pb1, &ref);
|
||||||
|
|
||||||
/* atomic cross-directory rename */
|
/* atomic cross-directory rename */
|
||||||
md(pb3, mp, "dir2/subdir");
|
md(pb3, sizeof(pb3), mp, "dir2/subdir");
|
||||||
if (rump_sys_rename(pb1, pb3) == -1)
|
if (rump_sys_rename(pb1, pb3) == -1)
|
||||||
atf_tc_fail_errno("rename 9");
|
atf_tc_fail_errno("rename 9");
|
||||||
checkfile(pb3, &ref);
|
checkfile(pb3, &ref);
|
||||||
|
|
||||||
/* rename directory over an empty directory */
|
/* rename directory over an empty directory */
|
||||||
md(pb1, mp, "parent");
|
md(pb1, sizeof(pb1), mp, "parent");
|
||||||
md(pb2, mp, "parent/dir1");
|
md(pb2, sizeof(pb2), mp, "parent/dir1");
|
||||||
md(pb3, mp, "parent/dir2");
|
md(pb3, sizeof(pb3), mp, "parent/dir2");
|
||||||
RL(rump_sys_mkdir(pb1, 0777));
|
RL(rump_sys_mkdir(pb1, 0777));
|
||||||
RL(rump_sys_mkdir(pb2, 0777));
|
RL(rump_sys_mkdir(pb2, 0777));
|
||||||
RL(rump_sys_mkdir(pb3, 0777));
|
RL(rump_sys_mkdir(pb3, 0777));
|
||||||
@ -467,15 +481,15 @@ create_many(const atf_tc_t *tc, const char *mp)
|
|||||||
for (i = 0; i < nfiles; i++) {
|
for (i = 0; i < nfiles; i++) {
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
sprintf(buf, TESTFN "%d", i);
|
snprintf(buf, sizeof(buf), TESTFN "%d", i);
|
||||||
RL(fd = rump_sys_open(buf, O_RDWR|O_CREAT|O_EXCL, 0666));
|
RL(fd = rump_sys_open(buf, O_RDWR|O_CREAT|O_EXCL, 0666));
|
||||||
RL(rump_sys_close(fd));
|
RL(rump_sys_close(fd));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wipe them out */
|
/* wipe them out */
|
||||||
for (i = 0; i < nfiles; i++) {
|
for (i = 0; i < nfiles; i++) {
|
||||||
sprintf(buf, TESTFN "%d", i);
|
snprintf(buf, sizeof(buf), TESTFN "%d", i);
|
||||||
RL(rump_sys_unlink(buf));
|
RLF(rump_sys_unlink(buf), "%s", buf);
|
||||||
}
|
}
|
||||||
#undef TESTFN
|
#undef TESTFN
|
||||||
|
|
||||||
@ -499,12 +513,12 @@ create_nonalphanum(const atf_tc_t *tc, const char *mp)
|
|||||||
|
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
int fd;
|
int fd;
|
||||||
sprintf(buf, "%c", i);
|
snprintf(buf, sizeof(buf), "%c", i);
|
||||||
fd = rump_sys_open(buf, O_RDWR|O_CREAT|O_EXCL, 0666);
|
fd = rump_sys_open(buf, O_RDWR|O_CREAT|O_EXCL, 0666);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
continue;
|
continue;
|
||||||
RL(rump_sys_close(fd));
|
RLF(rump_sys_close(fd), "%d", fd);
|
||||||
RL(rump_sys_unlink(buf));
|
RLF(rump_sys_unlink(buf), "%s", buf);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
@ -632,7 +646,7 @@ symlink_len(const atf_tc_t *tc, const char *mp, size_t len)
|
|||||||
|
|
||||||
USES_SYMLINKS;
|
USES_SYMLINKS;
|
||||||
|
|
||||||
RL(rump_sys_chdir(mp));
|
RLF(rump_sys_chdir(mp), "%s", mp);
|
||||||
|
|
||||||
buf = malloc(len + 1);
|
buf = malloc(len + 1);
|
||||||
ATF_REQUIRE(buf);
|
ATF_REQUIRE(buf);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: h_macros.h,v 1.12 2016/08/04 11:49:07 jakllsch Exp $ */
|
/* $NetBSD: h_macros.h,v 1.13 2016/08/20 15:49:08 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||||
@ -45,6 +45,8 @@
|
|||||||
ATF_CHECK_MSG((x) != (v), "%s: %s", #x, strerror(errno))
|
ATF_CHECK_MSG((x) != (v), "%s: %s", #x, strerror(errno))
|
||||||
|
|
||||||
#define RL(x) REQUIRE_LIBC(x, -1)
|
#define RL(x) REQUIRE_LIBC(x, -1)
|
||||||
|
#define RLF(x, fmt, arg) \
|
||||||
|
ATF_CHECK_MSG((x) != -1, "%s [" fmt "]: %s", #x, arg, strerror(errno))
|
||||||
#define RZ(x) \
|
#define RZ(x) \
|
||||||
do { \
|
do { \
|
||||||
int RZ_rv = x; \
|
int RZ_rv = x; \
|
||||||
|
136
contrib/netbsd-tests/kernel/msg.h
Normal file
136
contrib/netbsd-tests/kernel/msg.h
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
/* $NetBSD: msg.h,v 1.1 2016/12/05 20:10:10 christos Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
* by Christos Zoulas.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct msg_fds {
|
||||||
|
int pfd[2];
|
||||||
|
int cfd[2];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define CLOSEFD(fd) do { \
|
||||||
|
if (fd != -1) { \
|
||||||
|
close(fd); \
|
||||||
|
fd = -1; \
|
||||||
|
} \
|
||||||
|
} while (/*CONSTCOND*/ 0)
|
||||||
|
|
||||||
|
static int
|
||||||
|
msg_open(struct msg_fds *fds)
|
||||||
|
{
|
||||||
|
if (pipe(fds->pfd) == -1)
|
||||||
|
return -1;
|
||||||
|
if (pipe(fds->cfd) == -1) {
|
||||||
|
close(fds->pfd[0]);
|
||||||
|
close(fds->pfd[1]);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
msg_close(struct msg_fds *fds)
|
||||||
|
{
|
||||||
|
CLOSEFD(fds->pfd[0]);
|
||||||
|
CLOSEFD(fds->pfd[1]);
|
||||||
|
CLOSEFD(fds->cfd[0]);
|
||||||
|
CLOSEFD(fds->cfd[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
msg_write_child(const char *info, struct msg_fds *fds, void *msg, size_t len)
|
||||||
|
{
|
||||||
|
ssize_t rv;
|
||||||
|
CLOSEFD(fds->cfd[1]);
|
||||||
|
CLOSEFD(fds->pfd[0]);
|
||||||
|
|
||||||
|
printf("Send %s\n", info);
|
||||||
|
rv = write(fds->pfd[1], msg, len);
|
||||||
|
if (rv != (ssize_t)len)
|
||||||
|
return 1;
|
||||||
|
// printf("Wait %s\n", info);
|
||||||
|
rv = read(fds->cfd[0], msg, len);
|
||||||
|
if (rv != (ssize_t)len)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
msg_write_parent(const char *info, struct msg_fds *fds, void *msg, size_t len)
|
||||||
|
{
|
||||||
|
ssize_t rv;
|
||||||
|
CLOSEFD(fds->pfd[1]);
|
||||||
|
CLOSEFD(fds->cfd[0]);
|
||||||
|
|
||||||
|
printf("Send %s\n", info);
|
||||||
|
rv = write(fds->cfd[1], msg, len);
|
||||||
|
if (rv != (ssize_t)len)
|
||||||
|
return 1;
|
||||||
|
// printf("Wait %s\n", info);
|
||||||
|
rv = read(fds->pfd[0], msg, len);
|
||||||
|
if (rv != (ssize_t)len)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
msg_read_parent(const char *info, struct msg_fds *fds, void *msg, size_t len)
|
||||||
|
{
|
||||||
|
ssize_t rv;
|
||||||
|
CLOSEFD(fds->pfd[1]);
|
||||||
|
CLOSEFD(fds->cfd[0]);
|
||||||
|
|
||||||
|
printf("Wait %s\n", info);
|
||||||
|
rv = read(fds->pfd[0], msg, len);
|
||||||
|
if (rv != (ssize_t)len)
|
||||||
|
return 1;
|
||||||
|
// printf("Send %s\n", info);
|
||||||
|
rv = write(fds->cfd[1], msg, len);
|
||||||
|
if (rv != (ssize_t)len)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
msg_read_child(const char *info, struct msg_fds *fds, void *msg, size_t len)
|
||||||
|
{
|
||||||
|
ssize_t rv;
|
||||||
|
CLOSEFD(fds->cfd[1]);
|
||||||
|
CLOSEFD(fds->pfd[0]);
|
||||||
|
|
||||||
|
printf("Wait %s\n", info);
|
||||||
|
rv = read(fds->cfd[0], msg, len);
|
||||||
|
if (rv != (ssize_t)len)
|
||||||
|
return 1;
|
||||||
|
// printf("Send %s\n", info);
|
||||||
|
rv = write(fds->pfd[1], msg, len);
|
||||||
|
if (rv != (ssize_t)len)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_mqueue.c,v 1.4 2014/03/02 19:56:48 jmmv Exp $ */
|
/* $NetBSD: t_mqueue.c,v 1.5 2017/01/10 22:10:22 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test for POSIX message queue priority handling.
|
* Test for POSIX message queue priority handling.
|
||||||
@ -14,6 +14,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <atf-c.h>
|
#include <atf-c.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
208
contrib/netbsd-tests/kernel/t_ptrace.c
Normal file
208
contrib/netbsd-tests/kernel/t_ptrace.c
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
/* $NetBSD: t_ptrace.c,v 1.17 2016/11/13 22:59:31 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <sys/cdefs.h>
|
||||||
|
__RCSID("$NetBSD: t_ptrace.c,v 1.17 2016/11/13 22:59:31 kamil Exp $");
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/ptrace.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#include <err.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <atf-c.h>
|
||||||
|
|
||||||
|
#include "../h_macros.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A child process cannot call atf functions and expect them to magically
|
||||||
|
* work like in the parent.
|
||||||
|
* The printf(3) messaging from a child will not work out of the box as well
|
||||||
|
* without estabilishing a communication protocol with its parent. To not
|
||||||
|
* overcomplicate the tests - do not log from a child and use err(3)/errx(3)
|
||||||
|
* wrapped with FORKEE_ASSERT()/FORKEE_ASSERTX() as that is guaranteed to work.
|
||||||
|
*/
|
||||||
|
#define FORKEE_ASSERTX(x) \
|
||||||
|
do { \
|
||||||
|
int ret = (x); \
|
||||||
|
if (!ret) \
|
||||||
|
errx(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: %s", \
|
||||||
|
__FILE__, __LINE__, __func__, #x); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define FORKEE_ASSERT(x) \
|
||||||
|
do { \
|
||||||
|
int ret = (x); \
|
||||||
|
if (!ret) \
|
||||||
|
err(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: %s", \
|
||||||
|
__FILE__, __LINE__, __func__, #x); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
ATF_TC(attach_pid0);
|
||||||
|
ATF_TC_HEAD(attach_pid0, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Assert that a debugger cannot attach to PID 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(attach_pid0, tc)
|
||||||
|
{
|
||||||
|
errno = 0;
|
||||||
|
ATF_REQUIRE_ERRNO(EPERM, ptrace(PT_ATTACH, 0, NULL, 0) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(attach_pid1);
|
||||||
|
ATF_TC_HEAD(attach_pid1, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Assert that a debugger cannot attach to PID 1 (as non-root)");
|
||||||
|
|
||||||
|
atf_tc_set_md_var(tc, "require.user", "unprivileged");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(attach_pid1, tc)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_ERRNO(EPERM, ptrace(PT_ATTACH, 1, NULL, 0) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(attach_pid1_securelevel);
|
||||||
|
ATF_TC_HEAD(attach_pid1_securelevel, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Assert that a debugger cannot attach to PID 1 with "
|
||||||
|
"securelevel >= 1 (as root)");
|
||||||
|
|
||||||
|
atf_tc_set_md_var(tc, "require.user", "root");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(attach_pid1_securelevel, tc)
|
||||||
|
{
|
||||||
|
int level;
|
||||||
|
size_t len = sizeof(level);
|
||||||
|
|
||||||
|
ATF_REQUIRE(sysctlbyname("kern.securelevel", &level, &len, NULL, 0)
|
||||||
|
!= -1);
|
||||||
|
|
||||||
|
if (level < 1) {
|
||||||
|
atf_tc_skip("Test must be run with securelevel >= 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_REQUIRE_ERRNO(EPERM, ptrace(PT_ATTACH, 1, NULL, 0) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(attach_self);
|
||||||
|
ATF_TC_HEAD(attach_self, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Assert that a debugger cannot attach to self (as it's nonsense)");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(attach_self, tc)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_ERRNO(EINVAL, ptrace(PT_ATTACH, getpid(), NULL, 0) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(attach_chroot);
|
||||||
|
ATF_TC_HEAD(attach_chroot, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Assert that a debugger cannot trace another process unless the "
|
||||||
|
"process's root directory is at or below the tracing process's "
|
||||||
|
"root");
|
||||||
|
|
||||||
|
atf_tc_set_md_var(tc, "require.user", "root");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(attach_chroot, tc)
|
||||||
|
{
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
pid_t child;
|
||||||
|
int fds_toparent[2], fds_fromparent[2];
|
||||||
|
int rv;
|
||||||
|
uint8_t msg = 0xde; /* dummy message for IPC based on pipe(2) */
|
||||||
|
|
||||||
|
(void)memset(buf, '\0', sizeof(buf));
|
||||||
|
ATF_REQUIRE(getcwd(buf, sizeof(buf)) != NULL);
|
||||||
|
(void)strlcat(buf, "/dir", sizeof(buf));
|
||||||
|
|
||||||
|
ATF_REQUIRE(mkdir(buf, 0500) == 0);
|
||||||
|
ATF_REQUIRE(chdir(buf) == 0);
|
||||||
|
|
||||||
|
ATF_REQUIRE(pipe(fds_toparent) == 0);
|
||||||
|
ATF_REQUIRE(pipe(fds_fromparent) == 0);
|
||||||
|
child = atf_utils_fork();
|
||||||
|
if (child == 0) {
|
||||||
|
FORKEE_ASSERT(close(fds_toparent[0]) == 0);
|
||||||
|
FORKEE_ASSERT(close(fds_fromparent[1]) == 0);
|
||||||
|
|
||||||
|
FORKEE_ASSERT(chroot(buf) == 0);
|
||||||
|
|
||||||
|
rv = write(fds_toparent[1], &msg, sizeof(msg));
|
||||||
|
FORKEE_ASSERTX(rv == sizeof(msg));
|
||||||
|
|
||||||
|
ATF_REQUIRE_ERRNO(EPERM,
|
||||||
|
ptrace(PT_ATTACH, getppid(), NULL, 0) == -1);
|
||||||
|
|
||||||
|
rv = read(fds_fromparent[0], &msg, sizeof(msg));
|
||||||
|
FORKEE_ASSERTX(rv == sizeof(msg));
|
||||||
|
|
||||||
|
_exit(0);
|
||||||
|
}
|
||||||
|
ATF_REQUIRE(close(fds_toparent[1]) == 0);
|
||||||
|
ATF_REQUIRE(close(fds_fromparent[0]) == 0);
|
||||||
|
|
||||||
|
printf("Waiting for chrooting of the child PID %d", child);
|
||||||
|
rv = read(fds_toparent[0], &msg, sizeof(msg));
|
||||||
|
ATF_REQUIRE(rv == sizeof(msg));
|
||||||
|
|
||||||
|
printf("Child is ready, it will try to PT_ATTACH to parent\n");
|
||||||
|
rv = write(fds_fromparent[1], &msg, sizeof(msg));
|
||||||
|
ATF_REQUIRE(rv == sizeof(msg));
|
||||||
|
|
||||||
|
printf("fds_fromparent is no longer needed - close it\n");
|
||||||
|
ATF_REQUIRE(close(fds_fromparent[1]) == 0);
|
||||||
|
|
||||||
|
printf("fds_toparent is no longer needed - close it\n");
|
||||||
|
ATF_REQUIRE(close(fds_toparent[0]) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TP_ADD_TCS(tp)
|
||||||
|
{
|
||||||
|
setvbuf(stdout, NULL, _IONBF, 0);
|
||||||
|
setvbuf(stderr, NULL, _IONBF, 0);
|
||||||
|
ATF_TP_ADD_TC(tp, attach_pid0);
|
||||||
|
ATF_TP_ADD_TC(tp, attach_pid1);
|
||||||
|
ATF_TP_ADD_TC(tp, attach_pid1_securelevel);
|
||||||
|
ATF_TP_ADD_TC(tp, attach_self);
|
||||||
|
ATF_TP_ADD_TC(tp, attach_chroot);
|
||||||
|
|
||||||
|
return atf_no_error();
|
||||||
|
}
|
5082
contrib/netbsd-tests/kernel/t_ptrace_wait.c
Normal file
5082
contrib/netbsd-tests/kernel/t_ptrace_wait.c
Normal file
File diff suppressed because it is too large
Load Diff
431
contrib/netbsd-tests/kernel/t_ptrace_wait.h
Normal file
431
contrib/netbsd-tests/kernel/t_ptrace_wait.h
Normal file
@ -0,0 +1,431 @@
|
|||||||
|
/* $NetBSD: t_ptrace_wait.h,v 1.7 2017/01/09 22:09:20 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Detect plain wait(2) use-case */
|
||||||
|
#if !defined(TWAIT_WAITPID) && \
|
||||||
|
!defined(TWAIT_WAITID) && \
|
||||||
|
!defined(TWAIT_WAIT3) && \
|
||||||
|
!defined(TWAIT_WAIT4) && \
|
||||||
|
!defined(TWAIT_WAIT6)
|
||||||
|
#define TWAIT_WAIT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There are two classes of wait(2)-like functions:
|
||||||
|
* - wait4(2)-like accepting pid_t, optional options parameter, struct rusage*
|
||||||
|
* - wait6(2)-like accepting idtype_t, id_t, struct wrusage, mandatory options
|
||||||
|
*
|
||||||
|
* The TWAIT_FNAME value is to be used for convenience in debug messages.
|
||||||
|
*
|
||||||
|
* The TWAIT_GENERIC() macro is designed to reuse the same unmodified
|
||||||
|
* code with as many wait(2)-like functions as possible.
|
||||||
|
*
|
||||||
|
* In a common use-case wait4(2) and wait6(2)-like function can work the almost
|
||||||
|
* the same way, however there are few important differences:
|
||||||
|
* wait6(2) must specify P_PID for idtype to match wpid from wait4(2).
|
||||||
|
* To behave like wait4(2), wait6(2) the 'options' to wait must include
|
||||||
|
* WEXITED|WTRUNCATED.
|
||||||
|
*
|
||||||
|
* There are two helper macros (they purpose it to mach more than one
|
||||||
|
* wait(2)-like function):
|
||||||
|
* The TWAIT_HAVE_STATUS - specifies whether a function can retrieve
|
||||||
|
* status (as integer value).
|
||||||
|
* The TWAIT_HAVE_PID - specifies whether a function can request
|
||||||
|
* exact process identifier
|
||||||
|
* The TWAIT_HAVE_RUSAGE - specifies whether a function can request
|
||||||
|
* the struct rusage value
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(TWAIT_WAIT)
|
||||||
|
# define TWAIT_FNAME "wait"
|
||||||
|
# define TWAIT_WAIT4TYPE(a,b,c,d) wait((b))
|
||||||
|
# define TWAIT_GENERIC(a,b,c) wait((b))
|
||||||
|
# define TWAIT_HAVE_STATUS 1
|
||||||
|
#elif defined(TWAIT_WAITPID)
|
||||||
|
# define TWAIT_FNAME "waitpid"
|
||||||
|
# define TWAIT_WAIT4TYPE(a,b,c,d) waitpid((a),(b),(c))
|
||||||
|
# define TWAIT_GENERIC(a,b,c) waitpid((a),(b),(c))
|
||||||
|
# define TWAIT_HAVE_PID 1
|
||||||
|
# define TWAIT_HAVE_STATUS 1
|
||||||
|
#elif defined(TWAIT_WAITID)
|
||||||
|
# define TWAIT_FNAME "waitid"
|
||||||
|
# define TWAIT_GENERIC(a,b,c) \
|
||||||
|
waitid(P_PID,(a),NULL,(c)|WEXITED|WTRAPPED)
|
||||||
|
# define TWAIT_WAIT6TYPE(a,b,c,d,e,f) waitid((a),(b),(f),(d))
|
||||||
|
# define TWAIT_HAVE_PID 1
|
||||||
|
#elif defined(TWAIT_WAIT3)
|
||||||
|
# define TWAIT_FNAME "wait3"
|
||||||
|
# define TWAIT_WAIT4TYPE(a,b,c,d) wait3((b),(c),(d))
|
||||||
|
# define TWAIT_GENERIC(a,b,c) wait3((b),(c),NULL)
|
||||||
|
# define TWAIT_HAVE_STATUS 1
|
||||||
|
# define TWAIT_HAVE_RUSAGE 1
|
||||||
|
#elif defined(TWAIT_WAIT4)
|
||||||
|
# define TWAIT_FNAME "wait4"
|
||||||
|
# define TWAIT_WAIT4TYPE(a,b,c,d) wait4((a),(b),(c),(d))
|
||||||
|
# define TWAIT_GENERIC(a,b,c) wait4((a),(b),(c),NULL)
|
||||||
|
# define TWAIT_HAVE_PID 1
|
||||||
|
# define TWAIT_HAVE_STATUS 1
|
||||||
|
# define TWAIT_HAVE_RUSAGE 1
|
||||||
|
#elif defined(TWAIT_WAIT6)
|
||||||
|
# define TWAIT_FNAME "wait6"
|
||||||
|
# define TWAIT_WAIT6TYPE(a,b,c,d,e,f) wait6((a),(b),(c),(d),(e),(f))
|
||||||
|
# define TWAIT_GENERIC(a,b,c) \
|
||||||
|
wait6(P_PID,(a),(b),(c)|WEXITED|WTRAPPED,NULL,NULL)
|
||||||
|
# define TWAIT_HAVE_PID 1
|
||||||
|
# define TWAIT_HAVE_STATUS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There are 3 groups of tests:
|
||||||
|
* - TWAIT_GENERIC() (wait, wait2, waitpid, wait3, wait4, wait6)
|
||||||
|
* - TWAIT_WAIT4TYPE() (wait2, waitpid, wait3, wait4)
|
||||||
|
* - TWAIT_WAIT6TYPE() (waitid, wait6)
|
||||||
|
*
|
||||||
|
* Tests only in the above categories are allowed. However some tests are not
|
||||||
|
* possible in the context requested functionality to be verified, therefore
|
||||||
|
* there are helper macros:
|
||||||
|
* - TWAIT_HAVE_PID (wait2, waitpid, waitid, wait4, wait6)
|
||||||
|
* - TWAIT_HAVE_STATUS (wait, wait2, waitpid, wait3, wait4, wait6)
|
||||||
|
* - TWAIT_HAVE_RUSAGE (wait3, wait4)
|
||||||
|
* - TWAIT_HAVE_RETPID (wait, wait2, waitpid, wait3, wait4, wait6)
|
||||||
|
*
|
||||||
|
* If there is an intention to test e.g. wait6(2) specific features in the
|
||||||
|
* ptrace(2) context, find the most matching group and with #ifdefs reduce
|
||||||
|
* functionality of less featured than wait6(2) interface (TWAIT_WAIT6TYPE).
|
||||||
|
*
|
||||||
|
* For clarity never use negative preprocessor checks, like:
|
||||||
|
* #if !defined(TWAIT_WAIT4)
|
||||||
|
* always refer to checks for positive values.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TEST_REQUIRE_EQ(x, y) \
|
||||||
|
do { \
|
||||||
|
uintmax_t vx = (x); \
|
||||||
|
uintmax_t vy = (y); \
|
||||||
|
int ret = vx == vy; \
|
||||||
|
if (!ret) \
|
||||||
|
ATF_REQUIRE_EQ_MSG(vx, vy, "%s(%ju) == %s(%ju)", \
|
||||||
|
#x, vx, #y, vy); \
|
||||||
|
} while (/*CONSTCOND*/0)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A child process cannot call atf functions and expect them to magically
|
||||||
|
* work like in the parent.
|
||||||
|
* The printf(3) messaging from a child will not work out of the box as well
|
||||||
|
* without estabilishing a communication protocol with its parent. To not
|
||||||
|
* overcomplicate the tests - do not log from a child and use err(3)/errx(3)
|
||||||
|
* wrapped with FORKEE_ASSERT()/FORKEE_ASSERTX() as that is guaranteed to work.
|
||||||
|
*/
|
||||||
|
#define FORKEE_ASSERT_EQ(x, y) \
|
||||||
|
do { \
|
||||||
|
uintmax_t vx = (x); \
|
||||||
|
uintmax_t vy = (y); \
|
||||||
|
int ret = vx == vy; \
|
||||||
|
if (!ret) \
|
||||||
|
errx(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: " \
|
||||||
|
"%s(%ju) == %s(%ju)", __FILE__, __LINE__, __func__, \
|
||||||
|
#x, vx, #y, vy); \
|
||||||
|
} while (/*CONSTCOND*/0)
|
||||||
|
|
||||||
|
#define FORKEE_ASSERTX(x) \
|
||||||
|
do { \
|
||||||
|
int ret = (x); \
|
||||||
|
if (!ret) \
|
||||||
|
errx(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: %s",\
|
||||||
|
__FILE__, __LINE__, __func__, #x); \
|
||||||
|
} while (/*CONSTCOND*/0)
|
||||||
|
|
||||||
|
#define FORKEE_ASSERT(x) \
|
||||||
|
do { \
|
||||||
|
int ret = (x); \
|
||||||
|
if (!ret) \
|
||||||
|
err(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: %s",\
|
||||||
|
__FILE__, __LINE__, __func__, #x); \
|
||||||
|
} while (/*CONSTCOND*/0)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Simplify logic for functions using general purpose registers add HAVE_GPREGS
|
||||||
|
*
|
||||||
|
* For platforms that do not implement all needed calls for simplicity assume
|
||||||
|
* that they are unsupported at all.
|
||||||
|
*/
|
||||||
|
#if defined(PT_GETREGS) \
|
||||||
|
&& defined(PT_SETREGS) \
|
||||||
|
&& defined(PTRACE_REG_PC) \
|
||||||
|
&& defined(PTRACE_REG_SET_PC) \
|
||||||
|
&& defined(PTRACE_REG_SP) \
|
||||||
|
&& defined(PTRACE_REG_INTRV)
|
||||||
|
#define HAVE_GPREGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Add guards for floating point registers */
|
||||||
|
#if defined(PT_GETFPREGS) \
|
||||||
|
&& defined(PT_SETFPREGS)
|
||||||
|
#define HAVE_FPREGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Add guards for cpu debug registers */
|
||||||
|
#if defined(PT_GETDBREGS) \
|
||||||
|
&& defined(PT_SETDBREGS)
|
||||||
|
#define HAVE_DBREGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If waitid(2) returns because one or more processes have a state change to
|
||||||
|
* report, 0 is returned. If an error is detected, a value of -1 is returned
|
||||||
|
* and errno is set to indicate the error. If WNOHANG is specified and there
|
||||||
|
* are no stopped, continued or exited children, 0 is returned.
|
||||||
|
*/
|
||||||
|
#if defined(TWAIT_WAITID)
|
||||||
|
#define TWAIT_REQUIRE_SUCCESS(a,b) TEST_REQUIRE_EQ((a), 0)
|
||||||
|
#define TWAIT_REQUIRE_FAILURE(a,b) ATF_REQUIRE_ERRNO((a),(b) == -1)
|
||||||
|
#define FORKEE_REQUIRE_SUCCESS(a,b) FORKEE_ASSERT_EQ(a, 0)
|
||||||
|
#define FORKEE_REQUIRE_FAILURE(a,b) \
|
||||||
|
FORKEE_ASSERTX(((a) == errno) && ((b) == -1))
|
||||||
|
#else
|
||||||
|
#define TWAIT_REQUIRE_SUCCESS(a,b) TEST_REQUIRE_EQ((a), (b))
|
||||||
|
#define TWAIT_REQUIRE_FAILURE(a,b) ATF_REQUIRE_ERRNO((a),(b) == -1)
|
||||||
|
#define FORKEE_REQUIRE_SUCCESS(a,b) FORKEE_ASSERT_EQ(a, b)
|
||||||
|
#define FORKEE_REQUIRE_FAILURE(a,b) \
|
||||||
|
FORKEE_ASSERTX(((a) == errno) && ((b) == -1))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Helper tools to verify whether status reports exited value
|
||||||
|
*/
|
||||||
|
#if TWAIT_HAVE_STATUS
|
||||||
|
static void __used
|
||||||
|
validate_status_exited(int status, int expected)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_MSG(WIFEXITED(status), "Reported !exited process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFCONTINUED(status), "Reported continued process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFSIGNALED(status), "Reported signaled process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFSTOPPED(status), "Reported stopped process");
|
||||||
|
|
||||||
|
ATF_REQUIRE_EQ_MSG(WEXITSTATUS(status), expected,
|
||||||
|
"The process has exited with invalid value %d != %d",
|
||||||
|
WEXITSTATUS(status), expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __used
|
||||||
|
forkee_status_exited(int status, int expected)
|
||||||
|
{
|
||||||
|
FORKEE_ASSERTX(WIFEXITED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFCONTINUED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFSIGNALED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFSTOPPED(status));
|
||||||
|
|
||||||
|
FORKEE_ASSERT_EQ(WEXITSTATUS(status), expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __used
|
||||||
|
validate_status_continued(int status)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_MSG(!WIFEXITED(status), "Reported exited process");
|
||||||
|
ATF_REQUIRE_MSG(WIFCONTINUED(status), "Reported !continued process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFSIGNALED(status), "Reported signaled process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFSTOPPED(status), "Reported stopped process");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __used
|
||||||
|
forkee_status_continued(int status)
|
||||||
|
{
|
||||||
|
FORKEE_ASSERTX(!WIFEXITED(status));
|
||||||
|
FORKEE_ASSERTX(WIFCONTINUED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFSIGNALED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFSTOPPED(status));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __used
|
||||||
|
validate_status_signaled(int status, int expected_termsig, int expected_core)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_MSG(!WIFEXITED(status), "Reported exited process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFCONTINUED(status), "Reported continued process");
|
||||||
|
ATF_REQUIRE_MSG(WIFSIGNALED(status), "Reported !signaled process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFSTOPPED(status), "Reported stopped process");
|
||||||
|
|
||||||
|
ATF_REQUIRE_EQ_MSG(WTERMSIG(status), expected_termsig,
|
||||||
|
"Unexpected signal received");
|
||||||
|
|
||||||
|
ATF_REQUIRE_EQ_MSG(WCOREDUMP(status), expected_core,
|
||||||
|
"Unexpectedly core file %s generated", expected_core ? "not" : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __used
|
||||||
|
forkee_status_signaled(int status, int expected_termsig, int expected_core)
|
||||||
|
{
|
||||||
|
FORKEE_ASSERTX(!WIFEXITED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFCONTINUED(status));
|
||||||
|
FORKEE_ASSERTX(WIFSIGNALED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFSTOPPED(status));
|
||||||
|
|
||||||
|
FORKEE_ASSERT_EQ(WTERMSIG(status), expected_termsig);
|
||||||
|
FORKEE_ASSERT_EQ(WCOREDUMP(status), expected_core);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __used
|
||||||
|
validate_status_stopped(int status, int expected)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_MSG(!WIFEXITED(status), "Reported exited process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFCONTINUED(status), "Reported continued process");
|
||||||
|
ATF_REQUIRE_MSG(!WIFSIGNALED(status), "Reported signaled process");
|
||||||
|
ATF_REQUIRE_MSG(WIFSTOPPED(status), "Reported !stopped process");
|
||||||
|
|
||||||
|
char st[128], ex[128];
|
||||||
|
strlcpy(st, strsignal(WSTOPSIG(status)), sizeof(st));
|
||||||
|
strlcpy(ex, strsignal(expected), sizeof(ex));
|
||||||
|
|
||||||
|
ATF_REQUIRE_EQ_MSG(WSTOPSIG(status), expected,
|
||||||
|
"Unexpected stop signal received [%s] != [%s]", st, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __used
|
||||||
|
forkee_status_stopped(int status, int expected)
|
||||||
|
{
|
||||||
|
FORKEE_ASSERTX(!WIFEXITED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFCONTINUED(status));
|
||||||
|
FORKEE_ASSERTX(!WIFSIGNALED(status));
|
||||||
|
FORKEE_ASSERTX(WIFSTOPPED(status));
|
||||||
|
|
||||||
|
FORKEE_ASSERT_EQ(WSTOPSIG(status), expected);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define validate_status_exited(a,b)
|
||||||
|
#define forkee_status_exited(a,b)
|
||||||
|
#define validate_status_continued(a,b)
|
||||||
|
#define forkee_status_continued(a,b)
|
||||||
|
#define validate_status_signaled(a,b,c)
|
||||||
|
#define forkee_status_signaled(a,b,c)
|
||||||
|
#define validate_status_stopped(a,b)
|
||||||
|
#define forkee_status_stopped(a,b)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This function is currently designed to be run in the main/parent process */
|
||||||
|
static void __used
|
||||||
|
await_zombie(pid_t process)
|
||||||
|
{
|
||||||
|
struct kinfo_proc2 p;
|
||||||
|
size_t len = sizeof(p);
|
||||||
|
|
||||||
|
const int name[] = {
|
||||||
|
[0] = CTL_KERN,
|
||||||
|
[1] = KERN_PROC2,
|
||||||
|
[2] = KERN_PROC_PID,
|
||||||
|
[3] = process,
|
||||||
|
[4] = sizeof(p),
|
||||||
|
[5] = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
const size_t namelen = __arraycount(name);
|
||||||
|
|
||||||
|
/* Await the process becoming a zombie */
|
||||||
|
while(1) {
|
||||||
|
ATF_REQUIRE(sysctl(name, namelen, &p, &len, NULL, 0) == 0);
|
||||||
|
|
||||||
|
if (p.p_stat == LSZOMB)
|
||||||
|
break;
|
||||||
|
|
||||||
|
ATF_REQUIRE(usleep(1000) == 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Happy number sequence -- this function is used to just consume cpu cycles */
|
||||||
|
#define HAPPY_NUMBER 1
|
||||||
|
|
||||||
|
/* If n is not happy then its sequence ends in the cycle:
|
||||||
|
* 4, 16, 37, 58, 89, 145, 42, 20, 4, ... */
|
||||||
|
#define SAD_NUMBER 4
|
||||||
|
|
||||||
|
/* Calculate the sum of the squares of the digits of n */
|
||||||
|
static unsigned __used
|
||||||
|
dsum(unsigned n)
|
||||||
|
{
|
||||||
|
unsigned sum, x;
|
||||||
|
for (sum = 0; n; n /= 10) {
|
||||||
|
x = n % 10;
|
||||||
|
sum += x * x;
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX: Disabled optimization is required to make tests for hardware assisted
|
||||||
|
* traps in .text functional
|
||||||
|
*
|
||||||
|
* Tested with GCC 5.4 on NetBSD 7.99.47 amd64
|
||||||
|
*/
|
||||||
|
static int __used
|
||||||
|
#ifdef __clang__
|
||||||
|
__attribute__((__optnone__))
|
||||||
|
#else
|
||||||
|
__attribute__((__optimize__("O0")))
|
||||||
|
#endif
|
||||||
|
check_happy(unsigned n)
|
||||||
|
{
|
||||||
|
for (;;) {
|
||||||
|
unsigned total = dsum(n);
|
||||||
|
|
||||||
|
if (total == HAPPY_NUMBER)
|
||||||
|
return 1;
|
||||||
|
if (total == SAD_NUMBER)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
n = total;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(TWAIT_HAVE_PID)
|
||||||
|
#define ATF_TP_ADD_TC_HAVE_PID(a,b) ATF_TP_ADD_TC(a,b)
|
||||||
|
#else
|
||||||
|
#define ATF_TP_ADD_TC_HAVE_PID(a,b)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_GPREGS)
|
||||||
|
#define ATF_TP_ADD_TC_HAVE_GPREGS(a,b) ATF_TP_ADD_TC(a,b)
|
||||||
|
#else
|
||||||
|
#define ATF_TP_ADD_TC_HAVE_GPREGS(a,b)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_FPREGS)
|
||||||
|
#define ATF_TP_ADD_TC_HAVE_FPREGS(a,b) ATF_TP_ADD_TC(a,b)
|
||||||
|
#else
|
||||||
|
#define ATF_TP_ADD_TC_HAVE_FPREGS(a,b)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PT_STEP)
|
||||||
|
#define ATF_TP_ADD_TC_PT_STEP(a,b) ATF_TP_ADD_TC(a,b)
|
||||||
|
#else
|
||||||
|
#define ATF_TP_ADD_TC_PT_STEP(a,b)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__HAVE_PTRACE_WATCHPOINTS)
|
||||||
|
#define ATF_TP_ADD_TC_HAVE_PTRACE_WATCHPOINTS(a,b) ATF_TP_ADD_TC(a,b)
|
||||||
|
#else
|
||||||
|
#define ATF_TP_ADD_TC_HAVE_PTRACE_WATCHPOINTS(a,b)
|
||||||
|
#endif
|
30
contrib/netbsd-tests/kernel/t_ptrace_wait3.c
Normal file
30
contrib/netbsd-tests/kernel/t_ptrace_wait3.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* $NetBSD: t_ptrace_wait3.c,v 1.1 2016/11/07 21:09:03 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TWAIT_WAIT3
|
||||||
|
#include "t_ptrace_wait.c"
|
30
contrib/netbsd-tests/kernel/t_ptrace_wait4.c
Normal file
30
contrib/netbsd-tests/kernel/t_ptrace_wait4.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* $NetBSD: t_ptrace_wait4.c,v 1.1 2016/11/07 21:09:03 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TWAIT_WAIT4
|
||||||
|
#include "t_ptrace_wait.c"
|
30
contrib/netbsd-tests/kernel/t_ptrace_wait6.c
Normal file
30
contrib/netbsd-tests/kernel/t_ptrace_wait6.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* $NetBSD: t_ptrace_wait6.c,v 1.1 2016/11/07 21:09:03 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TWAIT_WAIT6
|
||||||
|
#include "t_ptrace_wait.c"
|
30
contrib/netbsd-tests/kernel/t_ptrace_waitid.c
Normal file
30
contrib/netbsd-tests/kernel/t_ptrace_waitid.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* $NetBSD: t_ptrace_waitid.c,v 1.1 2016/11/07 21:09:03 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TWAIT_WAITID
|
||||||
|
#include "t_ptrace_wait.c"
|
30
contrib/netbsd-tests/kernel/t_ptrace_waitpid.c
Normal file
30
contrib/netbsd-tests/kernel/t_ptrace_waitpid.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* $NetBSD: t_ptrace_waitpid.c,v 1.1 2016/11/07 21:09:03 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TWAIT_WAITPID
|
||||||
|
#include "t_ptrace_wait.c"
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
|
/* $NetBSD: exec_prot_support.c,v 1.2 2016/12/31 11:51:20 martin Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||||
@ -30,12 +30,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
|
__RCSID("$NetBSD: exec_prot_support.c,v 1.2 2016/12/31 11:51:20 martin Exp $");
|
||||||
|
|
||||||
#include "../../common/exec_prot.h"
|
#include "../../common/exec_prot.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
exec_prot_support(void)
|
exec_prot_support(void)
|
||||||
{
|
{
|
||||||
return NOTIMPL;
|
|
||||||
|
return PERPAGE_XP;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
|
/* $NetBSD: return_one.S,v 1.2 2016/12/31 11:51:20 martin Exp $ */
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
.globl return_one, return_one_end;
|
.global return_one_end
|
||||||
|
|
||||||
return_one: return_one_end:
|
ENTRY(return_one)
|
||||||
nop
|
return_one:
|
||||||
|
retl
|
||||||
|
mov 1, %o0
|
||||||
|
return_one_end:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: h_db.c,v 1.1 2011/01/07 15:05:58 pgoyette Exp $ */
|
/* $NetBSD: h_db.c,v 1.3 2016/09/24 21:18:22 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993, 1994
|
* Copyright (c) 1992, 1993, 1994
|
||||||
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)dbtest.c 8.17 (Berkeley) 9/1/94";
|
static char sccsid[] = "@(#)dbtest.c 8.17 (Berkeley) 9/1/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: h_db.c,v 1.1 2011/01/07 15:05:58 pgoyette Exp $");
|
__RCSID("$NetBSD: h_db.c,v 1.3 2016/09/24 21:18:22 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -57,12 +57,13 @@ __RCSID("$NetBSD: h_db.c,v 1.1 2011/01/07 15:05:58 pgoyette Exp $");
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <db.h>
|
#include <db.h>
|
||||||
|
#include "btree.h"
|
||||||
|
|
||||||
enum S { COMMAND, COMPARE, GET, PUT, REMOVE, SEQ, SEQFLAG, KEY, DATA };
|
enum S { COMMAND, COMPARE, GET, PUT, REMOVE, SEQ, SEQFLAG, KEY, DATA };
|
||||||
|
|
||||||
static void compare(DBT *, DBT *);
|
static void compare(DBT *, DBT *);
|
||||||
static DBTYPE dbtype(const char *);
|
static DBTYPE dbtype(const char *);
|
||||||
static void dump(DB *, int);
|
static void dump(DB *, int, int);
|
||||||
static void get(DB *, DBT *);
|
static void get(DB *, DBT *);
|
||||||
static void getdata(DB *, DBT *, DBT *);
|
static void getdata(DB *, DBT *, DBT *);
|
||||||
static void put(DB *, DBT *, DBT *);
|
static void put(DB *, DBT *, DBT *);
|
||||||
@ -73,6 +74,9 @@ static void *rfile(char *, size_t *);
|
|||||||
static void seq(DB *, DBT *);
|
static void seq(DB *, DBT *);
|
||||||
static u_int setflags(char *);
|
static u_int setflags(char *);
|
||||||
static void *setinfo(DBTYPE, char *);
|
static void *setinfo(DBTYPE, char *);
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
static void unlinkpg(DB *);
|
||||||
|
#endif
|
||||||
static void usage(void) __attribute__((__noreturn__));
|
static void usage(void) __attribute__((__noreturn__));
|
||||||
static void *xcopy(void *, size_t);
|
static void *xcopy(void *, size_t);
|
||||||
static void chkcmd(enum S);
|
static void chkcmd(enum S);
|
||||||
@ -82,6 +86,9 @@ static void chkkey(enum S);
|
|||||||
#ifdef STATISTICS
|
#ifdef STATISTICS
|
||||||
extern void __bt_stat(DB *);
|
extern void __bt_stat(DB *);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
extern int __bt_relink(BTREE *, PAGE *);
|
||||||
|
#endif
|
||||||
|
|
||||||
static DBTYPE type; /* Database type. */
|
static DBTYPE type; /* Database type. */
|
||||||
static void *infop; /* Iflags. */
|
static void *infop; /* Iflags. */
|
||||||
@ -315,8 +322,16 @@ lkey: switch (command) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
dump(dbp, p[1] == 'r');
|
dump(dbp, p[1] == 'r', 0);
|
||||||
break;
|
break;
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
case 'O':
|
||||||
|
dump(dbp, p[1] == 'r', 1);
|
||||||
|
break;
|
||||||
|
case 'u':
|
||||||
|
unlinkpg(dbp);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
errx(1, "line %zu: %s: unknown command character",
|
errx(1, "line %zu: %s: unknown command character",
|
||||||
lineno, p);
|
lineno, p);
|
||||||
@ -483,17 +498,25 @@ seq(DB *dbp, DBT *kp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dump(DB *dbp, int rev)
|
dump(DB *dbp, int rev, int recurse)
|
||||||
{
|
{
|
||||||
DBT key, data;
|
DBT key, data;
|
||||||
int xflags, nflags;
|
int xflags, nflags;
|
||||||
|
|
||||||
if (rev) {
|
if (rev) {
|
||||||
xflags = R_LAST;
|
xflags = R_LAST;
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
nflags = recurse ? R_RPREV : R_PREV;
|
||||||
|
#else
|
||||||
nflags = R_PREV;
|
nflags = R_PREV;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
xflags = R_FIRST;
|
xflags = R_FIRST;
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
nflags = recurse ? R_RNEXT : R_NEXT;
|
||||||
|
#else
|
||||||
nflags = R_NEXT;
|
nflags = R_NEXT;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
for (;; xflags = nflags)
|
for (;; xflags = nflags)
|
||||||
switch (dbp->seq(dbp, &key, &data, xflags)) {
|
switch (dbp->seq(dbp, &key, &data, xflags)) {
|
||||||
@ -511,6 +534,42 @@ dump(DB *dbp, int rev)
|
|||||||
done: return;
|
done: return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
void
|
||||||
|
unlinkpg(DB *dbp)
|
||||||
|
{
|
||||||
|
BTREE *t = dbp->internal;
|
||||||
|
PAGE *h = NULL;
|
||||||
|
pgno_t pg;
|
||||||
|
|
||||||
|
for (pg = P_ROOT; pg < t->bt_mp->npages;
|
||||||
|
mpool_put(t->bt_mp, h, 0), pg++) {
|
||||||
|
if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
|
||||||
|
break;
|
||||||
|
/* Look for a nonempty leaf page that has both left
|
||||||
|
* and right siblings. */
|
||||||
|
if (h->prevpg == P_INVALID || h->nextpg == P_INVALID)
|
||||||
|
continue;
|
||||||
|
if (NEXTINDEX(h) == 0)
|
||||||
|
continue;
|
||||||
|
if ((h->flags & (P_BLEAF | P_RLEAF)))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (h == NULL || pg == t->bt_mp->npages) {
|
||||||
|
errx(1, "%s: no appropriate page found", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (__bt_relink(t, h) != 0) {
|
||||||
|
perror("unlinkpg");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
h->prevpg = P_INVALID;
|
||||||
|
h->nextpg = P_INVALID;
|
||||||
|
cleanup:
|
||||||
|
mpool_put(t->bt_mp, h, MPOOL_DIRTY);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static u_int
|
static u_int
|
||||||
setflags(char *s)
|
setflags(char *s)
|
||||||
{
|
{
|
||||||
@ -725,7 +784,11 @@ static void
|
|||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"Usage: %s [-l] [-f file] [-i info] [-o file] type script\n",
|
#ifdef __NetBSD__
|
||||||
getprogname());
|
"Usage: %s [-lu] [-f file] [-i info] [-o file] [-O file] "
|
||||||
|
#else
|
||||||
|
"Usage: %s [-l] [-f file] [-i info] [-o file] "
|
||||||
|
#endif
|
||||||
|
"type script\n", getprogname());
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_db.sh,v 1.6 2015/11/18 18:35:35 christos Exp $
|
# $NetBSD: t_db.sh,v 1.7 2016/09/24 20:12:33 christos Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 The NetBSD Foundation, Inc.
|
# Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -563,6 +563,7 @@ delete_recno_body()
|
|||||||
|
|
||||||
h_repeated()
|
h_repeated()
|
||||||
{
|
{
|
||||||
|
local type="$1"
|
||||||
TMPDIR="$(pwd)/db_dir"; export TMPDIR
|
TMPDIR="$(pwd)/db_dir"; export TMPDIR
|
||||||
mkdir ${TMPDIR}
|
mkdir ${TMPDIR}
|
||||||
|
|
||||||
@ -581,7 +582,7 @@ h_repeated()
|
|||||||
}
|
}
|
||||||
}' >in
|
}' >in
|
||||||
|
|
||||||
$(prog_db) btree in
|
$(prog_db) $type in
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_test_case repeated_btree
|
atf_test_case repeated_btree
|
||||||
@ -641,11 +642,10 @@ duplicate_btree_body()
|
|||||||
|
|
||||||
h_cursor_flags()
|
h_cursor_flags()
|
||||||
{
|
{
|
||||||
|
local type=$1
|
||||||
TMPDIR="$(pwd)/db_dir"; export TMPDIR
|
TMPDIR="$(pwd)/db_dir"; export TMPDIR
|
||||||
mkdir ${TMPDIR}
|
mkdir ${TMPDIR}
|
||||||
|
|
||||||
type=$1
|
|
||||||
|
|
||||||
echo $SEVEN_SEVEN |
|
echo $SEVEN_SEVEN |
|
||||||
awk '{
|
awk '{
|
||||||
for (i = 1; i <= 20; ++i)
|
for (i = 1; i <= 20; ++i)
|
||||||
@ -784,6 +784,7 @@ h_byte_orders()
|
|||||||
echo p
|
echo p
|
||||||
echo k$i
|
echo k$i
|
||||||
echo d$i
|
echo d$i
|
||||||
|
echo S
|
||||||
echo g
|
echo g
|
||||||
echo k$i
|
echo k$i
|
||||||
done >in
|
done >in
|
||||||
@ -974,6 +975,298 @@ bsize_torture_body()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atf_test_case btree_weird_page_split
|
||||||
|
btree_weird_page_split_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" \
|
||||||
|
"Test for a weird page split condition where an insertion " \
|
||||||
|
"into index 0 of a page that would cause the new item to " \
|
||||||
|
"be the only item on the left page results in index 0 of " \
|
||||||
|
"the right page being erroneously skipped; this only " \
|
||||||
|
"happens with one particular key+data length for each page size."
|
||||||
|
}
|
||||||
|
btree_weird_page_split_body()
|
||||||
|
{
|
||||||
|
for psize in 512 1024 2048 4096 8192; do
|
||||||
|
echo " page size $psize"
|
||||||
|
kdsizes=`awk 'BEGIN {
|
||||||
|
psize = '$psize'; hsize = int(psize/2);
|
||||||
|
for (kdsize = hsize-40; kdsize <= hsize; kdsize++) {
|
||||||
|
print kdsize;
|
||||||
|
}
|
||||||
|
}' /dev/null`
|
||||||
|
|
||||||
|
# Use a series of keylen+datalen values in the right
|
||||||
|
# neighborhood to find the one that triggers the bug.
|
||||||
|
# We could compute the exact size that triggers the
|
||||||
|
# bug but this additional fuzz may be useful.
|
||||||
|
|
||||||
|
# Insert keys in reverse order to maximize the chances
|
||||||
|
# for a split on index 0.
|
||||||
|
|
||||||
|
for kdsize in $kdsizes; do
|
||||||
|
awk 'BEGIN {
|
||||||
|
kdsize = '$kdsize';
|
||||||
|
for (i = 8; i-- > 0; ) {
|
||||||
|
s = sprintf("a%03d:%09d", i, kdsize);
|
||||||
|
for (j = 0; j < kdsize-20; j++) {
|
||||||
|
s = s "x";
|
||||||
|
}
|
||||||
|
printf("p\nka%03d\nd%s\n", i, s);
|
||||||
|
}
|
||||||
|
print "o";
|
||||||
|
}' /dev/null > in
|
||||||
|
sed -n 's/^d//p' in | sort > exp
|
||||||
|
atf_check -o file:exp \
|
||||||
|
"$(prog_db)" -i psize=$psize btree in
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Extremely tricky test attempting to replicate some unusual database
|
||||||
|
# corruption seen in the field: pieces of the database becoming
|
||||||
|
# inaccessible to random access, sequential access, or both. The
|
||||||
|
# hypothesis is that at least some of these are triggered by the bug
|
||||||
|
# in page splits on index 0 with a particular exact keylen+datalen.
|
||||||
|
# (See Test 40.) For psize=4096, this size is exactly 2024.
|
||||||
|
|
||||||
|
# The order of operations here relies on very specific knowledge of
|
||||||
|
# the internals of the btree access method in order to place records
|
||||||
|
# at specific offsets in a page and to create certain keys on internal
|
||||||
|
# pages. The to-be-split page immediately prior to the bug-triggering
|
||||||
|
# split has the following properties:
|
||||||
|
#
|
||||||
|
# * is not the leftmost leaf page
|
||||||
|
# * key on the parent page is compares less than the key of the item
|
||||||
|
# on index 0
|
||||||
|
# * triggering record's key also compares greater than the key on the
|
||||||
|
# parent page
|
||||||
|
|
||||||
|
# Additionally, we prime the mpool LRU chain so that the head page on
|
||||||
|
# the chain has the following properties:
|
||||||
|
#
|
||||||
|
# * record at index 0 is located where it will not get overwritten by
|
||||||
|
# items written to the right-hand page during the split
|
||||||
|
# * key of the record at index 0 compares less than the key of the
|
||||||
|
# bug-triggering record
|
||||||
|
|
||||||
|
# If the page-split bug exists, this test appears to create a database
|
||||||
|
# where some records are inaccessible to a search, but still remain in
|
||||||
|
# the file and are accessible by sequential traversal. At least one
|
||||||
|
# record gets duplicated out of sequence.
|
||||||
|
|
||||||
|
atf_test_case btree_tricky_page_split
|
||||||
|
btree_tricky_page_split_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" \
|
||||||
|
"btree: no unsearchables due to page split on index 0"
|
||||||
|
}
|
||||||
|
btree_tricky_page_split_body()
|
||||||
|
{
|
||||||
|
list=`(for i in a b c d; do
|
||||||
|
for j in 990 998 999; do
|
||||||
|
echo g ${i}${j} 1024
|
||||||
|
done
|
||||||
|
done;
|
||||||
|
echo g y997 2014
|
||||||
|
for i in y z; do
|
||||||
|
for j in 998 999; do
|
||||||
|
echo g ${i}${j} 1024
|
||||||
|
done
|
||||||
|
done)`
|
||||||
|
# Exact number for trigger condition accounts for newlines
|
||||||
|
# retained by dbtest with -ofile but not without; we use
|
||||||
|
# -ofile, so count newlines. keylen=5,datalen=5+2014 for
|
||||||
|
# psize=4096 here.
|
||||||
|
(cat - <<EOF
|
||||||
|
p z999 1024
|
||||||
|
p z998 1024
|
||||||
|
p y999 1024
|
||||||
|
p y990 1024
|
||||||
|
p d999 1024
|
||||||
|
p d990 1024
|
||||||
|
p c999 1024
|
||||||
|
p c990 1024
|
||||||
|
p b999 1024
|
||||||
|
p b990 1024
|
||||||
|
p a999 1024
|
||||||
|
p a990 1024
|
||||||
|
p y998 1024
|
||||||
|
r y990
|
||||||
|
p d998 1024
|
||||||
|
p d990 1024
|
||||||
|
p c998 1024
|
||||||
|
p c990 1024
|
||||||
|
p b998 1024
|
||||||
|
p b990 1024
|
||||||
|
p a998 1024
|
||||||
|
p a990 1024
|
||||||
|
p y997 2014
|
||||||
|
S
|
||||||
|
o
|
||||||
|
EOF
|
||||||
|
echo "$list") |
|
||||||
|
# awk script input:
|
||||||
|
# {p|g|r} key [datasize]
|
||||||
|
awk '/^[pgr]/{
|
||||||
|
printf("%s\nk%s\n", $1, $2);
|
||||||
|
}
|
||||||
|
/^p/{
|
||||||
|
s = $2;
|
||||||
|
for (i = 0; i < $3; i++) {
|
||||||
|
s = s "x";
|
||||||
|
}
|
||||||
|
printf("d%s\n", s);
|
||||||
|
}
|
||||||
|
!/^[pgr]/{
|
||||||
|
print $0;
|
||||||
|
}' > in
|
||||||
|
(echo "$list"; echo "$list") | awk '{
|
||||||
|
s = $2;
|
||||||
|
for (i = 0; i < $3; i++) {
|
||||||
|
s = s "x";
|
||||||
|
}
|
||||||
|
print s;
|
||||||
|
}' > exp
|
||||||
|
atf_check -o file:exp \
|
||||||
|
"$(prog_db)" -i psize=4096 btree in
|
||||||
|
}
|
||||||
|
|
||||||
|
# Begin FreeBSD
|
||||||
|
if false; then
|
||||||
|
# End FreeBSD
|
||||||
|
atf_test_case btree_recursive_traversal
|
||||||
|
btree_recursive_traversal_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" \
|
||||||
|
"btree: Test for recursive traversal successfully " \
|
||||||
|
"retrieving records that are inaccessible to normal " \
|
||||||
|
"sequential 'sibling-link' traversal. This works by " \
|
||||||
|
"unlinking a few leaf pages but leaving their parent " \
|
||||||
|
"links intact. To verify that the unlink actually makes " \
|
||||||
|
"records inaccessible, the test first uses 'o' to do a " \
|
||||||
|
"normal sequential traversal, followed by 'O' to do a " \
|
||||||
|
"recursive traversal."
|
||||||
|
}
|
||||||
|
btree_recursive_traversal_body()
|
||||||
|
{
|
||||||
|
fill="abcdefghijklmnopqrstuvwxyzy"
|
||||||
|
script='{
|
||||||
|
for (i = 0; i < 20000; i++) {
|
||||||
|
printf("p\nkAA%05d\nd%05d%s\n", i, i, $0);
|
||||||
|
}
|
||||||
|
print "u";
|
||||||
|
print "u";
|
||||||
|
print "u";
|
||||||
|
print "u";
|
||||||
|
}'
|
||||||
|
(echo $fill | awk "$script"; echo o) > in1
|
||||||
|
echo $fill |
|
||||||
|
awk '{
|
||||||
|
for (i = 0; i < 20000; i++) {
|
||||||
|
if (i >= 5 && i <= 40)
|
||||||
|
continue;
|
||||||
|
printf("%05d%s\n", i, $0);
|
||||||
|
}
|
||||||
|
}' > exp1
|
||||||
|
atf_check -o file:exp1 \
|
||||||
|
"$(prog_db)" -i psize=512 btree in1
|
||||||
|
echo $fill |
|
||||||
|
awk '{
|
||||||
|
for (i = 0; i < 20000; i++) {
|
||||||
|
printf("%05d%s\n", i, $0);
|
||||||
|
}
|
||||||
|
}' > exp2
|
||||||
|
(echo $fill | awk "$script"; echo O) > in2
|
||||||
|
atf_check -o file:exp2 \
|
||||||
|
"$(prog_db)" -i psize=512 btree in2
|
||||||
|
}
|
||||||
|
# Begin FreeBSD
|
||||||
|
fi
|
||||||
|
# End FreeBSD
|
||||||
|
|
||||||
|
atf_test_case btree_byteswap_unaligned_access_bksd
|
||||||
|
btree_byteswap_unaligned_access_bksd_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" \
|
||||||
|
"btree: big key, small data, byteswap unaligned access"
|
||||||
|
}
|
||||||
|
btree_byteswap_unaligned_access_bksd_body()
|
||||||
|
{
|
||||||
|
(echo foo; echo bar) |
|
||||||
|
awk '{
|
||||||
|
s = $0
|
||||||
|
for (i = 0; i < 488; i++) {
|
||||||
|
s = s "x";
|
||||||
|
}
|
||||||
|
printf("p\nk%s\ndx\n", s);
|
||||||
|
}' > in
|
||||||
|
for order in 1234 4321; do
|
||||||
|
atf_check \
|
||||||
|
"$(prog_db)" -o out -i psize=512,lorder=$order btree in
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case btree_byteswap_unaligned_access_skbd
|
||||||
|
btree_byteswap_unaligned_access_skbd_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" \
|
||||||
|
"btree: small key, big data, byteswap unaligned access"
|
||||||
|
}
|
||||||
|
btree_byteswap_unaligned_access_skbd_body()
|
||||||
|
{
|
||||||
|
# 484 = 512 - 20 (header) - 7 ("foo1234") - 1 (newline)
|
||||||
|
(echo foo1234; echo bar1234) |
|
||||||
|
awk '{
|
||||||
|
s = $0
|
||||||
|
for (i = 0; i < 484; i++) {
|
||||||
|
s = s "x";
|
||||||
|
}
|
||||||
|
printf("p\nk%s\nd%s\n", $0, s);
|
||||||
|
}' > in
|
||||||
|
for order in 1234 4321; do
|
||||||
|
atf_check \
|
||||||
|
"$(prog_db)" -o out -i psize=512,lorder=$order btree in
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case btree_known_byte_order
|
||||||
|
btree_known_byte_order_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" \
|
||||||
|
"btree: small key, big data, known byte order"
|
||||||
|
}
|
||||||
|
btree_known_byte_order_body()
|
||||||
|
{
|
||||||
|
local a="-i psize=512,lorder="
|
||||||
|
|
||||||
|
(echo foo1234; echo bar1234) |
|
||||||
|
awk '{
|
||||||
|
s = $0
|
||||||
|
for (i = 0; i < 484; i++) {
|
||||||
|
s = s "x";
|
||||||
|
}
|
||||||
|
printf("%s\n", s);
|
||||||
|
}' > exp
|
||||||
|
(echo foo1234; echo bar1234) |
|
||||||
|
awk '{
|
||||||
|
s = $0
|
||||||
|
for (i = 0; i < 484; i++) {
|
||||||
|
s = s "x";
|
||||||
|
}
|
||||||
|
printf("p\nk%s\nd%s\n", $0, s);
|
||||||
|
}' > in1
|
||||||
|
for order in 1234 4321; do
|
||||||
|
atf_check \
|
||||||
|
"$(prog_db)" -f out.$order $a$order btree in1
|
||||||
|
done
|
||||||
|
(echo g; echo kfoo1234; echo g; echo kbar1234) > in2
|
||||||
|
for order in 1234 4321; do
|
||||||
|
atf_check -o file:exp \
|
||||||
|
"$(prog_db)" -s -f out.$order $a$order btree in2
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
atf_init_test_cases()
|
atf_init_test_cases()
|
||||||
{
|
{
|
||||||
atf_add_test_case small_btree
|
atf_add_test_case small_btree
|
||||||
@ -1002,4 +1295,16 @@ atf_init_test_cases()
|
|||||||
atf_add_test_case bsize_ffactor
|
atf_add_test_case bsize_ffactor
|
||||||
atf_add_test_case four_char_hash
|
atf_add_test_case four_char_hash
|
||||||
atf_add_test_case bsize_torture
|
atf_add_test_case bsize_torture
|
||||||
|
atf_add_test_case btree_weird_page_split
|
||||||
|
atf_add_test_case btree_tricky_page_split
|
||||||
|
# Begin FreeBSD
|
||||||
|
if false; then
|
||||||
|
# End FreeBSD
|
||||||
|
atf_add_test_case btree_recursive_traversal
|
||||||
|
# Begin FreeBSD
|
||||||
|
fi
|
||||||
|
# End FreeBSD
|
||||||
|
atf_add_test_case btree_byteswap_unaligned_access_bksd
|
||||||
|
atf_add_test_case btree_byteswap_unaligned_access_skbd
|
||||||
|
atf_add_test_case btree_known_byte_order
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_dir.c,v 1.8 2017/01/11 07:26:17 christos Exp $ */
|
/* $NetBSD: t_dir.c,v 1.10 2017/01/11 18:15:02 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||||
@ -75,33 +75,40 @@ ATF_TC_BODY(seekdir_basic, tc)
|
|||||||
|
|
||||||
/* skip two for . and .. */
|
/* skip two for . and .. */
|
||||||
entry = readdir(dp);
|
entry = readdir(dp);
|
||||||
|
ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s",
|
||||||
|
".", strerror(errno));
|
||||||
|
|
||||||
entry = readdir(dp);
|
entry = readdir(dp);
|
||||||
|
ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s",
|
||||||
|
"..", strerror(errno));
|
||||||
|
|
||||||
/* get first entry */
|
/* get first entry */
|
||||||
entry = readdir(dp);
|
entry = readdir(dp);
|
||||||
|
ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s",
|
||||||
|
"first", strerror(errno));
|
||||||
|
|
||||||
here = telldir(dp);
|
here = telldir(dp);
|
||||||
ATF_REQUIRE_MSG(here != -1,
|
ATF_REQUIRE_MSG(here != -1, "telldir failed: %s", strerror(errno));
|
||||||
"telldir failed: %s", strerror(errno));
|
|
||||||
|
|
||||||
/* get second entry */
|
/* get second entry */
|
||||||
entry = readdir(dp);
|
entry = readdir(dp);
|
||||||
#ifdef __FreeBSD__
|
ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s",
|
||||||
ATF_REQUIRE_MSG(entry != NULL,
|
"second", strerror(errno));
|
||||||
"readdir failed: %s", strerror(errno));
|
|
||||||
#endif
|
|
||||||
wasname = strdup(entry->d_name);
|
wasname = strdup(entry->d_name);
|
||||||
if (wasname == NULL)
|
if (wasname == NULL)
|
||||||
atf_tc_fail("cannot allocate memory");
|
atf_tc_fail("cannot allocate memory");
|
||||||
|
|
||||||
/* get third entry */
|
/* get third entry */
|
||||||
entry = readdir(dp);
|
entry = readdir(dp);
|
||||||
|
ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s",
|
||||||
|
"third", strerror(errno));
|
||||||
|
|
||||||
/* try to return to the position after the first entry */
|
/* try to return to the position after the first entry */
|
||||||
seekdir(dp, here);
|
seekdir(dp, here);
|
||||||
entry = readdir(dp);
|
entry = readdir(dp);
|
||||||
|
ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s",
|
||||||
if (entry == NULL)
|
"first[1]", strerror(errno));
|
||||||
atf_tc_fail("entry 1 not found");
|
|
||||||
if (strcmp(entry->d_name, wasname) != 0)
|
if (strcmp(entry->d_name, wasname) != 0)
|
||||||
atf_tc_fail("1st seekdir found wrong name");
|
atf_tc_fail("1st seekdir found wrong name");
|
||||||
|
|
||||||
@ -109,18 +116,17 @@ ATF_TC_BODY(seekdir_basic, tc)
|
|||||||
seekdir(dp, here);
|
seekdir(dp, here);
|
||||||
here = telldir(dp);
|
here = telldir(dp);
|
||||||
entry = readdir(dp);
|
entry = readdir(dp);
|
||||||
|
ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s",
|
||||||
if (entry == NULL)
|
"second[1]", strerror(errno));
|
||||||
atf_tc_fail("entry 2 not found");
|
|
||||||
if (strcmp(entry->d_name, wasname) != 0)
|
if (strcmp(entry->d_name, wasname) != 0)
|
||||||
atf_tc_fail("2nd seekdir found wrong name");
|
atf_tc_fail("2nd seekdir found wrong name");
|
||||||
|
|
||||||
/* One more time, to make sure that telldir() doesn't affect result */
|
/* One more time, to make sure that telldir() doesn't affect result */
|
||||||
seekdir(dp, here);
|
seekdir(dp, here);
|
||||||
entry = readdir(dp);
|
entry = readdir(dp);
|
||||||
|
ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s",
|
||||||
|
"third[1]", strerror(errno));
|
||||||
|
|
||||||
if (entry == NULL)
|
|
||||||
atf_tc_fail("entry 3 not found");
|
|
||||||
if (strcmp(entry->d_name, wasname) != 0)
|
if (strcmp(entry->d_name, wasname) != 0)
|
||||||
atf_tc_fail("3rd seekdir found wrong name");
|
atf_tc_fail("3rd seekdir found wrong name");
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_fnmatch.c,v 1.6 2014/10/12 22:33:41 christos Exp $ */
|
/* $NetBSD: t_fnmatch.c,v 1.7 2016/10/31 05:08:53 dholland Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2012 The NetBSD Foundation, Inc.
|
* Copyright (c) 2012 The NetBSD Foundation, Inc.
|
||||||
@ -29,7 +29,7 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: t_fnmatch.c,v 1.6 2014/10/12 22:33:41 christos Exp $");
|
__RCSID("$NetBSD: t_fnmatch.c,v 1.7 2016/10/31 05:08:53 dholland Exp $");
|
||||||
|
|
||||||
#include <atf-c.h>
|
#include <atf-c.h>
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
@ -166,6 +166,7 @@ ATF_TC_BODY(fnmatch_initialbracket, tc)
|
|||||||
ATF_CHECK(fnmatch("[!]a-]", "b", 0) == 0);
|
ATF_CHECK(fnmatch("[!]a-]", "b", 0) == 0);
|
||||||
ATF_CHECK(fnmatch("[]-_]", "^", 0) == 0); /* range: ']', '^', '_' */
|
ATF_CHECK(fnmatch("[]-_]", "^", 0) == 0); /* range: ']', '^', '_' */
|
||||||
ATF_CHECK(fnmatch("[!]-_]", "X", 0) == 0);
|
ATF_CHECK(fnmatch("[!]-_]", "X", 0) == 0);
|
||||||
|
ATF_CHECK(fnmatch("[A-\\\\]", "[", 0) == 0);
|
||||||
ATF_CHECK(fnmatch("[a-z]/[a-z]", "a/b", 0) == 0);
|
ATF_CHECK(fnmatch("[a-z]/[a-z]", "a/b", 0) == 0);
|
||||||
ATF_CHECK(fnmatch("[*]/b", "*/b", 0) == 0);
|
ATF_CHECK(fnmatch("[*]/b", "*/b", 0) == 0);
|
||||||
ATF_CHECK(fnmatch("[?]/b", "?/b", 0) == 0);
|
ATF_CHECK(fnmatch("[?]/b", "?/b", 0) == 0);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* $NetBSD: t_rpc.c,v 1.9 2015/11/27 13:59:40 christos Exp $ */
|
/* $NetBSD: t_rpc.c,v 1.10 2016/08/27 14:36:22 christos Exp $ */
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: t_rpc.c,v 1.9 2015/11/27 13:59:40 christos Exp $");
|
__RCSID("$NetBSD: t_rpc.c,v 1.10 2016/08/27 14:36:22 christos Exp $");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@ -21,7 +21,7 @@ __RCSID("$NetBSD: t_rpc.c,v 1.9 2015/11/27 13:59:40 christos Exp $");
|
|||||||
|
|
||||||
#define SKIPX(ev, msg, ...) do { \
|
#define SKIPX(ev, msg, ...) do { \
|
||||||
atf_tc_skip(msg, __VA_ARGS__); \
|
atf_tc_skip(msg, __VA_ARGS__); \
|
||||||
return; \
|
return ev; \
|
||||||
} while(/*CONSTCOND*/0)
|
} while(/*CONSTCOND*/0)
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
@ -32,8 +32,8 @@ __RCSID("$NetBSD: t_rpc.c,v 1.9 2015/11/27 13:59:40 christos Exp $");
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define ERRX(ev, msg, ...) errx(ev, msg, __VA_ARGS__)
|
#define ERRX(ev, msg, ...) errx(EXIT_FAILURE, msg, __VA_ARGS__)
|
||||||
#define SKIPX(ev, msg, ...) errx(ev, msg, __VA_ARGS__)
|
#define SKIPX(ev, msg, ...) errx(EXIT_FAILURE, msg, __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -83,7 +83,7 @@ onehost(const char *host, const char *transp)
|
|||||||
__rpc_control(CLCR_SET_RPCB_TIMEOUT, &tv);
|
__rpc_control(CLCR_SET_RPCB_TIMEOUT, &tv);
|
||||||
|
|
||||||
if ((clnt = clnt_create(host, RPCBPROG, RPCBVERS, transp)) == NULL)
|
if ((clnt = clnt_create(host, RPCBPROG, RPCBVERS, transp)) == NULL)
|
||||||
SKIPX(EXIT_FAILURE, "clnt_create (%s)", clnt_spcreateerror(""));
|
SKIPX(, "clnt_create (%s)", clnt_spcreateerror(""));
|
||||||
|
|
||||||
tv.tv_sec = 1;
|
tv.tv_sec = 1;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
@ -95,7 +95,7 @@ onehost(const char *host, const char *transp)
|
|||||||
if (clnt_call(clnt, RPCBPROC_NULL, xdr_void, NULL, xdr_void, NULL, tv)
|
if (clnt_call(clnt, RPCBPROC_NULL, xdr_void, NULL, xdr_void, NULL, tv)
|
||||||
!= RPC_SUCCESS)
|
!= RPC_SUCCESS)
|
||||||
#endif
|
#endif
|
||||||
ERRX(EXIT_FAILURE, "clnt_call (%s)", clnt_sperror(clnt, ""));
|
ERRX(, "clnt_call (%s)", clnt_sperror(clnt, ""));
|
||||||
clnt_control(clnt, CLGET_SVC_ADDR, (char *) &addr);
|
clnt_control(clnt, CLGET_SVC_ADDR, (char *) &addr);
|
||||||
reply(NULL, &addr, NULL);
|
reply(NULL, &addr, NULL);
|
||||||
}
|
}
|
||||||
@ -117,13 +117,13 @@ server(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
switch (rqstp->rq_proc) {
|
switch (rqstp->rq_proc) {
|
||||||
case NULLPROC:
|
case NULLPROC:
|
||||||
if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
|
if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
|
||||||
ERRX(EXIT_FAILURE, "svc_sendreply failed %d", 0);
|
ERRX(, "svc_sendreply failed %d", 0);
|
||||||
return;
|
return;
|
||||||
case PLUSONE:
|
case PLUSONE:
|
||||||
break;
|
break;
|
||||||
case DESTROY:
|
case DESTROY:
|
||||||
if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
|
if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
|
||||||
ERRX(EXIT_FAILURE, "svc_sendreply failed %d", 0);
|
ERRX(, "svc_sendreply failed %d", 0);
|
||||||
svc_destroy(transp);
|
svc_destroy(transp);
|
||||||
exit(0);
|
exit(0);
|
||||||
default:
|
default:
|
||||||
@ -138,7 +138,7 @@ server(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
DPRINTF("About to increment\n");
|
DPRINTF("About to increment\n");
|
||||||
num++;
|
num++;
|
||||||
if (!svc_sendreply(transp, (xdrproc_t)xdr_int, (void *)&num))
|
if (!svc_sendreply(transp, (xdrproc_t)xdr_int, (void *)&num))
|
||||||
ERRX(EXIT_FAILURE, "svc_sendreply failed %d", 1);
|
ERRX(, "svc_sendreply failed %d", 1);
|
||||||
DPRINTF("Leaving server procedure.\n");
|
DPRINTF("Leaving server procedure.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,13 +195,9 @@ regtest(const char *hostname, const char *transp, const char *arg, int p)
|
|||||||
svc_fdset_init(p ? SVC_FDSET_POLL : 0);
|
svc_fdset_init(p ? SVC_FDSET_POLL : 0);
|
||||||
#endif
|
#endif
|
||||||
if (!svc_create(server, PROGNUM, VERSNUM, transp))
|
if (!svc_create(server, PROGNUM, VERSNUM, transp))
|
||||||
#ifdef __NetBSD__
|
|
||||||
ERRX(EXIT_FAILURE, "Cannot create server %d", num);
|
|
||||||
#else
|
|
||||||
{
|
{
|
||||||
SKIPXI(EXIT_FAILURE, "Cannot create server %d", num);
|
SKIPXI(EXIT_FAILURE, "Cannot create server %d", num);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
switch ((pid = fork())) {
|
switch ((pid = fork())) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_memcpy.c,v 1.5 2013/03/17 02:23:31 christos Exp $ */
|
/* $NetBSD: t_memcpy.c,v 1.6 2017/01/11 18:05:54 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||||
@ -108,12 +108,8 @@ ATF_TC_BODY(memcpy_basic, tc)
|
|||||||
if (i != j)
|
if (i != j)
|
||||||
runTest(start[i], start[j]);
|
runTest(start[i], start[j]);
|
||||||
MD5End(mc, result);
|
MD5End(mc, result);
|
||||||
#ifdef __NetBSD__
|
|
||||||
ATF_REQUIRE_EQ(strcmp(result, goodResult), 0);
|
|
||||||
#else
|
|
||||||
ATF_REQUIRE_EQ_MSG(strcmp(result, goodResult), 0, "%s != %s",
|
ATF_REQUIRE_EQ_MSG(strcmp(result, goodResult), 0, "%s != %s",
|
||||||
result, goodResult);
|
result, goodResult);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ATF_TC(memccpy_simple);
|
ATF_TC(memccpy_simple);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_memmem.c,v 1.2 2011/07/07 08:27:36 jruoho Exp $ */
|
/* $NetBSD: t_memmem.c,v 1.3 2017/01/11 18:07:37 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2005 The NetBSD Foundation, Inc.
|
* Copyright (c) 2005 The NetBSD Foundation, Inc.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: cpp_atomic_ops_linkable.cc,v 1.4 2016/02/27 18:50:39 joerg Exp $ */
|
/* $NetBSD: cpp_atomic_ops_linkable.cc,v 1.5 2017/01/11 12:10:26 joerg Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014 The NetBSD Foundation, Inc.
|
* Copyright (c) 2014 The NetBSD Foundation, Inc.
|
||||||
@ -58,19 +58,13 @@ private:
|
|||||||
volatile std::atomic<T> m_val;
|
volatile std::atomic<T> m_val;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__clang__) && defined(__sparc64__)
|
|
||||||
#define NO_SHORT_ATOMICS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#ifndef NO_SHORT_ATOMICS
|
|
||||||
ATest<char>();
|
ATest<char>();
|
||||||
ATest<signed char>();
|
ATest<signed char>();
|
||||||
ATest<unsigned char>();
|
ATest<unsigned char>();
|
||||||
ATest<short>();
|
ATest<short>();
|
||||||
ATest<unsigned short>();
|
ATest<unsigned short>();
|
||||||
#endif
|
|
||||||
ATest<int>();
|
ATest<int>();
|
||||||
ATest<unsigned int>();
|
ATest<unsigned int>();
|
||||||
ATest<long>();
|
ATest<long>();
|
||||||
@ -79,29 +73,23 @@ int main(int argc, char **argv)
|
|||||||
ATest<long long>();
|
ATest<long long>();
|
||||||
ATest<unsigned long long>();
|
ATest<unsigned long long>();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SHORT_ATOMICS
|
|
||||||
ATest<char16_t>();
|
ATest<char16_t>();
|
||||||
#endif
|
|
||||||
ATest<char32_t>();
|
ATest<char32_t>();
|
||||||
ATest<wchar_t>();
|
ATest<wchar_t>();
|
||||||
#ifndef NO_SHORT_ATOMICS
|
|
||||||
ATest<int_least8_t>();
|
ATest<int_least8_t>();
|
||||||
ATest<uint_least8_t>();
|
ATest<uint_least8_t>();
|
||||||
ATest<int_least16_t>();
|
ATest<int_least16_t>();
|
||||||
ATest<uint_least16_t>();
|
ATest<uint_least16_t>();
|
||||||
#endif
|
|
||||||
ATest<int_least32_t>();
|
ATest<int_least32_t>();
|
||||||
ATest<uint_least32_t>();
|
ATest<uint_least32_t>();
|
||||||
#ifdef __HAVE_ATOMIC64_OPS
|
#ifdef __HAVE_ATOMIC64_OPS
|
||||||
ATest<int_least64_t>();
|
ATest<int_least64_t>();
|
||||||
ATest<uint_least64_t>();
|
ATest<uint_least64_t>();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SHORT_ATOMICS
|
|
||||||
ATest<int_fast8_t>();
|
ATest<int_fast8_t>();
|
||||||
ATest<uint_fast8_t>();
|
ATest<uint_fast8_t>();
|
||||||
ATest<int_fast16_t>();
|
ATest<int_fast16_t>();
|
||||||
ATest<uint_fast16_t>();
|
ATest<uint_fast16_t>();
|
||||||
#endif
|
|
||||||
ATest<int_fast32_t>();
|
ATest<int_fast32_t>();
|
||||||
ATest<uint_fast32_t>();
|
ATest<uint_fast32_t>();
|
||||||
#ifdef __HAVE_ATOMIC64_OPS
|
#ifdef __HAVE_ATOMIC64_OPS
|
||||||
@ -115,5 +103,5 @@ int main(int argc, char **argv)
|
|||||||
#ifdef __HAVE_ATOMIC64_OPS
|
#ifdef __HAVE_ATOMIC64_OPS
|
||||||
ATest<intmax_t>();
|
ATest<intmax_t>();
|
||||||
ATest<uintmax_t>();
|
ATest<uintmax_t>();
|
||||||
#endif /* NO_SHORT_ATOMICS */
|
#endif
|
||||||
}
|
}
|
||||||
|
63
contrib/netbsd-tests/lib/libc/sys/t_clock_nanosleep.c
Normal file
63
contrib/netbsd-tests/lib/libc/sys/t_clock_nanosleep.c
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
/* $NetBSD: t_clock_nanosleep.c,v 1.1 2016/11/11 15:30:44 njoly Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <sys/cdefs.h>
|
||||||
|
__RCSID("$NetBSD: t_clock_nanosleep.c,v 1.1 2016/11/11 15:30:44 njoly Exp $");
|
||||||
|
|
||||||
|
#include <atf-c.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
ATF_TC(clock_nanosleep_remain);
|
||||||
|
ATF_TC_HEAD(clock_nanosleep_remain, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Check clock_nanosleep(2) remaining time");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(clock_nanosleep_remain, tc)
|
||||||
|
{
|
||||||
|
struct timespec rqtp, rmtp;
|
||||||
|
|
||||||
|
rqtp.tv_sec = 0; rqtp.tv_nsec = 0;
|
||||||
|
rmtp.tv_sec = -1; rmtp.tv_nsec = -1;
|
||||||
|
ATF_REQUIRE(clock_nanosleep(CLOCK_REALTIME, 0, &rqtp, &rmtp) == 0);
|
||||||
|
ATF_CHECK(rmtp.tv_sec == 0 && rmtp.tv_nsec == 0);
|
||||||
|
|
||||||
|
ATF_REQUIRE(clock_gettime(CLOCK_REALTIME, &rqtp) == 0);
|
||||||
|
rmtp.tv_sec = -1; rmtp.tv_nsec = -1;
|
||||||
|
ATF_REQUIRE(clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &rqtp, &rmtp) == 0);
|
||||||
|
ATF_CHECK(rmtp.tv_sec == -1 && rmtp.tv_nsec == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TP_ADD_TCS(tp)
|
||||||
|
{
|
||||||
|
|
||||||
|
ATF_TP_ADD_TC(tp, clock_nanosleep_remain);
|
||||||
|
|
||||||
|
return atf_no_error();
|
||||||
|
}
|
@ -56,6 +56,10 @@ sighandler(int signo)
|
|||||||
/* Nothing. */
|
/* Nothing. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#define asm __asm
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
work(void)
|
work(void)
|
||||||
{
|
{
|
||||||
|
345
contrib/netbsd-tests/lib/libc/sys/t_wait_noproc.c
Normal file
345
contrib/netbsd-tests/lib/libc/sys/t_wait_noproc.c
Normal file
@ -0,0 +1,345 @@
|
|||||||
|
/* $NetBSD: t_wait_noproc.c,v 1.5 2016/11/09 17:50:19 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <sys/cdefs.h>
|
||||||
|
__RCSID("$NetBSD: t_wait_noproc.c,v 1.5 2016/11/09 17:50:19 kamil Exp $");
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <sys/param.h> /* For NBBY -- it's in sys/types.h on NetBSD */
|
||||||
|
#endif
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <atf-c.h>
|
||||||
|
|
||||||
|
#ifndef TWAIT_OPTION
|
||||||
|
#define TWAIT_OPTION 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TWAIT_OPTION == 0
|
||||||
|
ATF_TC(wait);
|
||||||
|
ATF_TC_HEAD(wait, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that wait(2) returns ECHILD for no child");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(wait, tc)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD, wait(NULL) == -1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ATF_TC(waitpid);
|
||||||
|
ATF_TC_HEAD(waitpid, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that waitpid(2) returns ECHILD for WAIT_ANY and option %s",
|
||||||
|
___STRING(TWAIT_OPTION));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(waitpid, tc)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD, waitpid(WAIT_ANY, NULL, TWAIT_OPTION) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(waitid);
|
||||||
|
ATF_TC_HEAD(waitid, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that waitid(2) returns ECHILD for P_ALL and option %s",
|
||||||
|
___STRING(TWAIT_OPTION));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(waitid, tc)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD,
|
||||||
|
waitid(P_ALL, 0, NULL,
|
||||||
|
WTRAPPED | WEXITED | TWAIT_OPTION) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(wait3);
|
||||||
|
ATF_TC_HEAD(wait3, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that wait3(2) returns ECHILD for no child");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(wait3, tc)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD, wait3(NULL, TWAIT_OPTION, NULL) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(wait4);
|
||||||
|
ATF_TC_HEAD(wait4, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that wait4(2) returns ECHILD for WAIT_ANY and option %s",
|
||||||
|
___STRING(TWAIT_OPTION));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(wait4, tc)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD,
|
||||||
|
wait4(WAIT_ANY, NULL, TWAIT_OPTION, NULL) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(wait6);
|
||||||
|
ATF_TC_HEAD(wait6, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that wait6(2) returns ECHILD for P_ALL and option %s",
|
||||||
|
___STRING(TWAIT_OPTION));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(wait6, tc)
|
||||||
|
{
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD,
|
||||||
|
wait6(P_ALL, 0, NULL,
|
||||||
|
WTRAPPED | WEXITED | TWAIT_OPTION, NULL, NULL) == -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Generator of valid combinations of options
|
||||||
|
* Usage: i = 0; while ((o = get_options_wait6(i++)) != -1) {}
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
get_options6(size_t pos)
|
||||||
|
{
|
||||||
|
int rv = 0;
|
||||||
|
size_t n;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* waitid(2) must specify at least one of WEXITED, WUNTRACED,
|
||||||
|
* WSTOPPED, WTRAPPED or WCONTINUED. Single option WNOWAIT
|
||||||
|
* isn't valid.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const int matrix[] = {
|
||||||
|
WNOWAIT, /* First in order to blacklist it easily */
|
||||||
|
WEXITED,
|
||||||
|
WUNTRACED,
|
||||||
|
WSTOPPED, /* SUS compatibility, equal to WUNTRACED */
|
||||||
|
WTRAPPED,
|
||||||
|
WCONTINUED
|
||||||
|
};
|
||||||
|
|
||||||
|
const size_t M = (1 << __arraycount(matrix)) - 1;
|
||||||
|
|
||||||
|
/* Skip empty and sole WNOWAIT option */
|
||||||
|
pos+=2;
|
||||||
|
|
||||||
|
if (pos > M)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (n = 0; n < __arraycount(matrix); n++) {
|
||||||
|
if (pos & __BIT(n))
|
||||||
|
rv |= matrix[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Generator of valid combinations of options
|
||||||
|
* Usage: i = 0; while ((o = get_options_wait4(i++)) != -1) {}
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
get_options4(size_t pos)
|
||||||
|
{
|
||||||
|
int rv = 0;
|
||||||
|
size_t n;
|
||||||
|
|
||||||
|
const int special[] = {
|
||||||
|
0,
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
WALLSIG,
|
||||||
|
WALTSIG,
|
||||||
|
__WALL, /* Linux compatibility, equal to WALLSIG */
|
||||||
|
__WCLONE /* Linux compatibility, equal to WALTSIG */
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
const int matrix[] = {
|
||||||
|
WNOWAIT,
|
||||||
|
WEXITED,
|
||||||
|
WUNTRACED,
|
||||||
|
WSTOPPED, /* SUS compatibility, equal to WUNTRACED */
|
||||||
|
WTRAPPED,
|
||||||
|
WCONTINUED
|
||||||
|
};
|
||||||
|
|
||||||
|
const size_t M = (1 << __arraycount(special)) - 1;
|
||||||
|
|
||||||
|
if (pos < __arraycount(special))
|
||||||
|
return special[pos];
|
||||||
|
|
||||||
|
pos -= __arraycount(special);
|
||||||
|
|
||||||
|
++pos; /* Don't start with empty mask */
|
||||||
|
|
||||||
|
if (pos > M)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (n = 0; n < __arraycount(special); n++) {
|
||||||
|
if (pos & __BIT(n))
|
||||||
|
rv |= matrix[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(waitpid_options);
|
||||||
|
ATF_TC_HEAD(waitpid_options, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that waitpid(2) returns ECHILD for WAIT_ANY and valid "
|
||||||
|
"combination of options with%s WNOHANG",
|
||||||
|
TWAIT_OPTION == 0 ? "out" : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(waitpid_options, tc)
|
||||||
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
int o;
|
||||||
|
|
||||||
|
while((o = get_options4(i++)) != -1) {
|
||||||
|
printf("Testing waitpid(2) with options %x\n", o);
|
||||||
|
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD,
|
||||||
|
waitpid(WAIT_ANY, NULL, o | TWAIT_OPTION) == -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(waitid_options);
|
||||||
|
ATF_TC_HEAD(waitid_options, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that waitid(2) returns ECHILD for P_ALL and valid "
|
||||||
|
"combination of options with%s WNOHANG",
|
||||||
|
TWAIT_OPTION == 0 ? "out" : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(waitid_options, tc)
|
||||||
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
int o;
|
||||||
|
|
||||||
|
while((o = get_options6(i++)) != -1) {
|
||||||
|
printf("Testing waitid(2) with options %x\n", o);
|
||||||
|
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD,
|
||||||
|
waitid(P_ALL, 0, NULL, o | TWAIT_OPTION) == -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(wait3_options);
|
||||||
|
ATF_TC_HEAD(wait3_options, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that wait3(2) returns ECHILD for no child");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(wait3_options, tc)
|
||||||
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
int o;
|
||||||
|
|
||||||
|
while((o = get_options4(i++)) != -1) {
|
||||||
|
printf("Testing wait3(2) with options %x\n", o);
|
||||||
|
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD,
|
||||||
|
wait3(NULL, o | TWAIT_OPTION, NULL) == -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(wait4_options);
|
||||||
|
ATF_TC_HEAD(wait4_options, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that wait4(2) returns ECHILD for WAIT_ANY and option %s",
|
||||||
|
___STRING(TWAIT_OPTION));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(wait4_options, tc)
|
||||||
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
int o;
|
||||||
|
|
||||||
|
while((o = get_options4(i++)) != -1) {
|
||||||
|
printf("Testing wait4(2) with options %x\n", o);
|
||||||
|
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD,
|
||||||
|
wait4(WAIT_ANY, NULL, o | TWAIT_OPTION, NULL) == -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(wait6_options);
|
||||||
|
ATF_TC_HEAD(wait6_options, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Test that wait6(2) returns ECHILD for P_ALL and option %s",
|
||||||
|
___STRING(TWAIT_OPTION));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(wait6_options, tc)
|
||||||
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
int o;
|
||||||
|
|
||||||
|
while((o = get_options6(i++)) != -1) {
|
||||||
|
printf("Testing wait6(2) with options %x\n", o);
|
||||||
|
|
||||||
|
ATF_REQUIRE_ERRNO(ECHILD,
|
||||||
|
wait6(P_ALL, 0, NULL, o | TWAIT_OPTION, NULL, NULL) == -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TP_ADD_TCS(tp)
|
||||||
|
{
|
||||||
|
|
||||||
|
#if TWAIT_OPTION == 0
|
||||||
|
ATF_TP_ADD_TC(tp, wait);
|
||||||
|
#endif
|
||||||
|
ATF_TP_ADD_TC(tp, waitpid);
|
||||||
|
ATF_TP_ADD_TC(tp, waitid);
|
||||||
|
ATF_TP_ADD_TC(tp, wait3);
|
||||||
|
ATF_TP_ADD_TC(tp, wait4);
|
||||||
|
ATF_TP_ADD_TC(tp, wait6);
|
||||||
|
|
||||||
|
ATF_TP_ADD_TC(tp, waitpid_options);
|
||||||
|
ATF_TP_ADD_TC(tp, waitid_options);
|
||||||
|
ATF_TP_ADD_TC(tp, wait3_options);
|
||||||
|
ATF_TP_ADD_TC(tp, wait4_options);
|
||||||
|
ATF_TP_ADD_TC(tp, wait6_options);
|
||||||
|
|
||||||
|
return atf_no_error();
|
||||||
|
}
|
30
contrib/netbsd-tests/lib/libc/sys/t_wait_noproc_wnohang.c
Normal file
30
contrib/netbsd-tests/lib/libc/sys/t_wait_noproc_wnohang.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* $NetBSD: t_wait_noproc_wnohang.c,v 1.1 2016/11/06 15:03:30 kamil Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TWAIT_OPTION WNOHANG
|
||||||
|
#include "t_wait_noproc.c"
|
81
contrib/netbsd-tests/lib/libm/t_casinh.c
Normal file
81
contrib/netbsd-tests/lib/libm/t_casinh.c
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
/* $NetBSD: t_casinh.c,v 1.2 2016/09/20 17:19:28 christos Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Written by Maya Rashish
|
||||||
|
* Public domain.
|
||||||
|
*
|
||||||
|
* Testing special values of casinh
|
||||||
|
* Values from ISO/IEC 9899:201x G.6.2.2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <atf-c.h>
|
||||||
|
#include <complex.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#define RE(z) (((double *)(&z))[0])
|
||||||
|
#define IM(z) (((double *)(&z))[1])
|
||||||
|
|
||||||
|
static const struct {
|
||||||
|
double input_re;
|
||||||
|
double input_im;
|
||||||
|
double result_re;
|
||||||
|
double result_im;
|
||||||
|
} values[] = {
|
||||||
|
{ +0, +0, +0, +0},
|
||||||
|
{ +5.032E3, +INFINITY, +INFINITY, +M_PI/2},
|
||||||
|
{ +INFINITY, +5.023E3, +INFINITY, +0},
|
||||||
|
{ +INFINITY, +INFINITY, +INFINITY, +M_PI/4},
|
||||||
|
#ifdef __HAVE_NANF
|
||||||
|
{ +INFINITY, +NAN, +INFINITY, +NAN},
|
||||||
|
{ +5.032E3, +NAN, +NAN, +NAN}, /* + FE_INVALID optionally raised */
|
||||||
|
{ +NAN, +0, +NAN, +0},
|
||||||
|
{ +NAN, -5.023E3, +NAN, +NAN}, /* + FE_INVALID optionally raised */
|
||||||
|
{ +NAN, +INFINITY, +INFINITY, +NAN}, /* sign of real part of result unspecified */
|
||||||
|
{ +NAN, +NAN, +NAN, +NAN},
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __HAVE_NANF
|
||||||
|
#define both_nan(a,b) (isnan(a) && isnan(b))
|
||||||
|
#else
|
||||||
|
#define both_nan(a,b) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define crude_equality(a,b) ((a == b) || both_nan(a,b))
|
||||||
|
|
||||||
|
#define ATF_COMPLEX_EQUAL(a,b) do { \
|
||||||
|
complex double ci = casinh(a); \
|
||||||
|
ATF_CHECK_MSG(crude_equality(creal(ci),creal(b)) && \
|
||||||
|
crude_equality(cimag(ci), cimag(b)), \
|
||||||
|
"for casinh([%g,%g]) = [%g,%g] != [%g,%g]", \
|
||||||
|
creal(a), cimag(a), creal(ci), cimag(ci), creal(b), cimag(b)); \
|
||||||
|
} while (0/*CONSTCOND*/)
|
||||||
|
|
||||||
|
|
||||||
|
ATF_TC(casinh);
|
||||||
|
ATF_TC_HEAD(casinh, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr","Check casinh family - special values");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(casinh, tc)
|
||||||
|
{
|
||||||
|
complex double input;
|
||||||
|
complex double result;
|
||||||
|
unsigned int i;
|
||||||
|
for (i = 0; i < __arraycount(values); i++) {
|
||||||
|
RE(input) = values[i].input_re;
|
||||||
|
IM(input) = values[i].input_im;
|
||||||
|
RE(result) = values[i].result_re;
|
||||||
|
IM(result) = values[i].result_im;
|
||||||
|
ATF_COMPLEX_EQUAL(input, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TP_ADD_TCS(tp)
|
||||||
|
{
|
||||||
|
|
||||||
|
ATF_TP_ADD_TC(tp, casinh);
|
||||||
|
|
||||||
|
return atf_no_error();
|
||||||
|
}
|
124
contrib/netbsd-tests/lib/libm/t_fe_round.c
Normal file
124
contrib/netbsd-tests/lib/libm/t_fe_round.c
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
/*
|
||||||
|
* Written by Maya Rashish <maya@NetBSD.org>
|
||||||
|
* Public domain.
|
||||||
|
*
|
||||||
|
* Testing IEEE-754 rounding modes (and lrint)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <atf-c.h>
|
||||||
|
#include <fenv.h>
|
||||||
|
#ifdef __HAVE_FENV
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/*#pragma STDC FENV_ACCESS ON gcc?? */
|
||||||
|
|
||||||
|
#define INT 9223L
|
||||||
|
|
||||||
|
#define EPSILON 0.001
|
||||||
|
|
||||||
|
static const struct {
|
||||||
|
int round_mode;
|
||||||
|
double input;
|
||||||
|
long int expected;
|
||||||
|
} values[] = {
|
||||||
|
{ FE_DOWNWARD, 3.7, 3},
|
||||||
|
{ FE_DOWNWARD, -3.7, -4},
|
||||||
|
{ FE_DOWNWARD, +0, 0},
|
||||||
|
{ FE_DOWNWARD, -INT-0.01, -INT-1},
|
||||||
|
{ FE_DOWNWARD, +INT-0.01, INT-1},
|
||||||
|
{ FE_DOWNWARD, -INT+0.01, -INT},
|
||||||
|
{ FE_DOWNWARD, +INT+0.01, INT},
|
||||||
|
#if 0 /* cpu bugs? */
|
||||||
|
{ FE_DOWNWARD, -0, -1},
|
||||||
|
|
||||||
|
{ FE_UPWARD, +0, 1},
|
||||||
|
#endif
|
||||||
|
{ FE_UPWARD, -0, 0},
|
||||||
|
{ FE_UPWARD, -123.7, -123},
|
||||||
|
{ FE_UPWARD, 123.999, 124},
|
||||||
|
{ FE_UPWARD, -INT-0.01, -INT},
|
||||||
|
{ FE_UPWARD, +INT-0.01, INT},
|
||||||
|
{ FE_UPWARD, -INT+0.01, -INT+1},
|
||||||
|
{ FE_UPWARD, +INT+0.01, INT+1},
|
||||||
|
|
||||||
|
{ FE_TOWARDZERO, 1.99, 1},
|
||||||
|
{ FE_TOWARDZERO, -1.99, -1},
|
||||||
|
{ FE_TOWARDZERO, 0.2, 0},
|
||||||
|
{ FE_TOWARDZERO, INT+0.01, INT},
|
||||||
|
{ FE_TOWARDZERO, INT-0.01, INT - 1},
|
||||||
|
{ FE_TOWARDZERO, -INT+0.01, -INT + 1},
|
||||||
|
{ FE_TOWARDZERO, +0, 0},
|
||||||
|
{ FE_TOWARDZERO, -0, 0},
|
||||||
|
|
||||||
|
{ FE_TONEAREST, -INT-0.01, -INT},
|
||||||
|
{ FE_TONEAREST, +INT-0.01, INT},
|
||||||
|
{ FE_TONEAREST, -INT+0.01, -INT},
|
||||||
|
{ FE_TONEAREST, +INT+0.01, INT},
|
||||||
|
{ FE_TONEAREST, -INT-0.501, -INT-1},
|
||||||
|
{ FE_TONEAREST, +INT-0.501, INT-1},
|
||||||
|
{ FE_TONEAREST, -INT+0.501, -INT+1},
|
||||||
|
{ FE_TONEAREST, +INT+0.501, INT+1},
|
||||||
|
{ FE_TONEAREST, +0, 0},
|
||||||
|
{ FE_TONEAREST, -0, 0},
|
||||||
|
};
|
||||||
|
|
||||||
|
ATF_TC(fe_round);
|
||||||
|
ATF_TC_HEAD(fe_round, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr","Checking IEEE 754 rounding modes using lrint");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(fe_round, tc)
|
||||||
|
{
|
||||||
|
long int received;
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < __arraycount(values); i++) {
|
||||||
|
fesetround(values[i].round_mode);
|
||||||
|
|
||||||
|
received = lrint(values[i].input);
|
||||||
|
ATF_CHECK_MSG(
|
||||||
|
(labs(received - values[i].expected) < EPSILON),
|
||||||
|
"lrint rounding wrong, difference too large\n"
|
||||||
|
"input: %f (index %d): got %ld, expected %ld\n",
|
||||||
|
values[i].input, i, received, values[i].expected);
|
||||||
|
|
||||||
|
/* Do we get the same rounding mode out? */
|
||||||
|
ATF_CHECK_MSG(
|
||||||
|
(fegetround() == values[i].round_mode),
|
||||||
|
"Didn't get the same rounding mode out!\n"
|
||||||
|
"(index %d) fed in %d rounding mode, got %d out\n",
|
||||||
|
i, fegetround(), values[i].round_mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TP_ADD_TCS(tp)
|
||||||
|
{
|
||||||
|
|
||||||
|
ATF_TP_ADD_TC(tp, fe_round);
|
||||||
|
|
||||||
|
return atf_no_error();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
ATF_TC(t_nofe_round);
|
||||||
|
|
||||||
|
ATF_TC_HEAD(t_nofe_round, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"dummy test case - no fenv.h support");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ATF_TC_BODY(t_nofe_round, tc)
|
||||||
|
{
|
||||||
|
atf_tc_skip("no fenv.h support on this architecture");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TP_ADD_TCS(tp)
|
||||||
|
{
|
||||||
|
ATF_TP_ADD_TC(tp, t_nofe_round);
|
||||||
|
return atf_no_error();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
130
contrib/netbsd-tests/lib/libm/t_ilogb.c
Normal file
130
contrib/netbsd-tests/lib/libm/t_ilogb.c
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
/* $NetBSD: t_ilogb.c,v 1.6 2016/08/26 08:01:55 christos Exp $ */
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
* by Maya Rashish.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <limits.h>
|
||||||
|
#endif
|
||||||
|
#include <atf-c.h>
|
||||||
|
#include <fenv.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#ifndef __HAVE_FENV
|
||||||
|
|
||||||
|
# define ATF_CHECK_RAISED_INVALID
|
||||||
|
# define ATF_CHECK_RAISED_NOTHING
|
||||||
|
|
||||||
|
#else
|
||||||
|
# define ATF_CHECK_RAISED_INVALID do { \
|
||||||
|
int r = fetestexcept(FE_ALL_EXCEPT); \
|
||||||
|
ATF_CHECK_MSG(r == FE_INVALID, "r=%#x != %#x\n", r, FE_INVALID); \
|
||||||
|
(void)feclearexcept(FE_ALL_EXCEPT); \
|
||||||
|
} while (/*CONSTCOND*/0)
|
||||||
|
|
||||||
|
# define ATF_CHECK_RAISED_NOTHING do { \
|
||||||
|
int r = fetestexcept(FE_ALL_EXCEPT); \
|
||||||
|
ATF_CHECK_MSG(r == 0, "r=%#x != 0\n", r); \
|
||||||
|
(void)feclearexcept(FE_ALL_EXCEPT); \
|
||||||
|
} while (/*CONSTCOND*/0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ATF_TC(ilogb);
|
||||||
|
ATF_TC_HEAD(ilogb, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr","Check ilogb family");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(ilogb, tc)
|
||||||
|
{
|
||||||
|
|
||||||
|
ATF_CHECK(ilogbf(0) == FP_ILOGB0);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
ATF_CHECK(ilogb(0) == FP_ILOGB0);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#ifdef __HAVE_LONG_DOUBLE
|
||||||
|
ATF_CHECK(ilogbl(0) == FP_ILOGB0);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ATF_CHECK(ilogbf(-0) == FP_ILOGB0);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
ATF_CHECK(ilogb(-0) == FP_ILOGB0);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#ifdef __HAVE_LONG_DOUBLE
|
||||||
|
ATF_CHECK(ilogbl(-0) == FP_ILOGB0);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ATF_CHECK(ilogbf(INFINITY) == INT_MAX);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
ATF_CHECK(ilogb(INFINITY) == INT_MAX);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#ifdef __HAVE_LONG_DOUBLE
|
||||||
|
ATF_CHECK(ilogbl(INFINITY) == INT_MAX);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ATF_CHECK(ilogbf(-INFINITY) == INT_MAX);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
ATF_CHECK(ilogb(-INFINITY) == INT_MAX);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#ifdef __HAVE_LONG_DOUBLE
|
||||||
|
ATF_CHECK(ilogbl(-INFINITY) == INT_MAX);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ATF_CHECK(ilogbf(1024) == 10);
|
||||||
|
ATF_CHECK_RAISED_NOTHING;
|
||||||
|
ATF_CHECK(ilogb(1024) == 10);
|
||||||
|
ATF_CHECK_RAISED_NOTHING;
|
||||||
|
#ifdef __HAVE_LONG_DOUBLE
|
||||||
|
ATF_CHECK(ilogbl(1024) == 10);
|
||||||
|
ATF_CHECK_RAISED_NOTHING;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __vax__
|
||||||
|
ATF_CHECK(ilogbf(NAN) == FP_ILOGBNAN);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
ATF_CHECK(ilogb(NAN) == FP_ILOGBNAN);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#ifdef __HAVE_LONG_DOUBLE
|
||||||
|
ATF_CHECK(ilogbl(NAN) == FP_ILOGBNAN);
|
||||||
|
ATF_CHECK_RAISED_INVALID;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TP_ADD_TCS(tp)
|
||||||
|
{
|
||||||
|
|
||||||
|
ATF_TP_ADD_TC(tp, ilogb);
|
||||||
|
|
||||||
|
return atf_no_error();
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_ldexp.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */
|
/* $NetBSD: t_ldexp.c,v 1.16 2016/08/25 00:32:31 maya Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||||
@ -29,7 +29,7 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: t_ldexp.c,v 1.14 2014/11/04 00:20:19 justin Exp $");
|
__RCSID("$NetBSD: t_ldexp.c,v 1.16 2016/08/25 00:32:31 maya Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
|
||||||
@ -96,10 +96,12 @@ struct ldexp_test ldexp_overflow[] = {
|
|||||||
{ 1.0, 1023, 1, " inf" },
|
{ 1.0, 1023, 1, " inf" },
|
||||||
{ 1.0, -1022, 2046, " inf" },
|
{ 1.0, -1022, 2046, " inf" },
|
||||||
{ 1.0, 1025, SKIP, " inf" },
|
{ 1.0, 1025, SKIP, " inf" },
|
||||||
|
{ 2.0, INT_MAX,SKIP, " inf" },
|
||||||
{ -1.0, 1024, SKIP, " -inf" },
|
{ -1.0, 1024, SKIP, " -inf" },
|
||||||
{ -1.0, 1023, 1, " -inf" },
|
{ -1.0, 1023, 1, " -inf" },
|
||||||
{ -1.0, -1022, 2046, " -inf" },
|
{ -1.0, -1022, 2046, " -inf" },
|
||||||
{ -1.0, 1025, SKIP, " -inf" },
|
{ -1.0, 1025, SKIP, " -inf" },
|
||||||
|
{ -2.0, INT_MAX,SKIP, " -inf" },
|
||||||
{ 0, 0, 0, NULL }
|
{ 0, 0, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -170,9 +172,7 @@ run_test(struct ldexp_test *table)
|
|||||||
|
|
||||||
v = ldexp(table->x, table->exp1);
|
v = ldexp(table->x, table->exp1);
|
||||||
|
|
||||||
if (table->exp2 == SKIP)
|
if (table->exp2 != SKIP)
|
||||||
continue;
|
|
||||||
|
|
||||||
v = ldexp(v, table->exp2);
|
v = ldexp(v, table->exp2);
|
||||||
|
|
||||||
(void)snprintf(outbuf, sizeof(outbuf), FORMAT, v);
|
(void)snprintf(outbuf, sizeof(outbuf), FORMAT, v);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_precision.c,v 1.2 2014/11/04 00:20:19 justin Exp $ */
|
/* $NetBSD: t_precision.c,v 1.3 2016/08/27 10:07:05 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2013 The NetBSD Foundation, Inc.
|
* Copyright (c) 2013 The NetBSD Foundation, Inc.
|
||||||
@ -29,7 +29,7 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: t_precision.c,v 1.2 2014/11/04 00:20:19 justin Exp $");
|
__RCSID("$NetBSD: t_precision.c,v 1.3 2016/08/27 10:07:05 christos Exp $");
|
||||||
|
|
||||||
#include <atf-c.h>
|
#include <atf-c.h>
|
||||||
|
|
||||||
@ -45,7 +45,9 @@ ATF_TC_HEAD(t_precision, tc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
volatile double x = 1;
|
volatile double x = 1;
|
||||||
|
#if __HAVE_LONG_DOUBLE
|
||||||
volatile long double y = 1;
|
volatile long double y = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
ATF_TC_BODY(t_precision, tc)
|
ATF_TC_BODY(t_precision, tc)
|
||||||
{
|
{
|
||||||
@ -58,7 +60,7 @@ ATF_TC_BODY(t_precision, tc)
|
|||||||
x += DBL_EPSILON;
|
x += DBL_EPSILON;
|
||||||
ATF_CHECK(x == 2.0);
|
ATF_CHECK(x == 2.0);
|
||||||
|
|
||||||
#if !defined(__FreeBSD__) || !defined(__i386__)
|
#if __HAVE_LONG_DOUBLE
|
||||||
y += LDBL_EPSILON;
|
y += LDBL_EPSILON;
|
||||||
ATF_CHECK(y != 1.0L);
|
ATF_CHECK(y != 1.0L);
|
||||||
y -= 1;
|
y -= 1;
|
||||||
|
@ -9,4 +9,10 @@
|
|||||||
ATF_REQUIRE_MSG(ret == 0, "%s: %s", #x, strerror(ret)); \
|
ATF_REQUIRE_MSG(ret == 0, "%s: %s", #x, strerror(ret)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define PTHREAD_REQUIRE_STATUS(x, v) \
|
||||||
|
do { \
|
||||||
|
int ret = (x); \
|
||||||
|
ATF_REQUIRE_MSG(ret == (v), "%s: %s", #x, strerror(ret)); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif // H_COMMON_H
|
#endif // H_COMMON_H
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_mutex.c,v 1.10 2016/07/31 13:01:29 christos Exp $ */
|
/* $NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||||
@ -29,12 +29,17 @@
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__COPYRIGHT("@(#) Copyright (c) 2008\
|
__COPYRIGHT("@(#) Copyright (c) 2008\
|
||||||
The NetBSD Foundation, inc. All rights reserved.");
|
The NetBSD Foundation, inc. All rights reserved.");
|
||||||
__RCSID("$NetBSD: t_mutex.c,v 1.10 2016/07/31 13:01:29 christos Exp $");
|
__RCSID("$NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $");
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <sys/time.h> /* For timespecadd */
|
||||||
|
#include <inttypes.h> /* For UINT16_MAX */
|
||||||
|
#endif
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/sched.h>
|
#include <sys/sched.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -47,6 +52,31 @@ static pthread_mutex_t mutex;
|
|||||||
static pthread_mutex_t static_mutex = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t static_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
static int global_x;
|
static int global_x;
|
||||||
|
|
||||||
|
#ifdef TIMEDMUTEX
|
||||||
|
/* This code is used for verifying non-timed specific code */
|
||||||
|
static struct timespec ts_lengthy = {
|
||||||
|
.tv_sec = UINT16_MAX,
|
||||||
|
.tv_nsec = 0
|
||||||
|
};
|
||||||
|
/* This code is used for verifying timed-only specific code */
|
||||||
|
static struct timespec ts_shortlived = {
|
||||||
|
.tv_sec = 0,
|
||||||
|
.tv_nsec = 120
|
||||||
|
};
|
||||||
|
|
||||||
|
static int
|
||||||
|
mutex_lock(pthread_mutex_t *m, const struct timespec *ts)
|
||||||
|
{
|
||||||
|
struct timespec ts_wait;
|
||||||
|
ATF_REQUIRE(clock_gettime(CLOCK_REALTIME, &ts_wait) != -1);
|
||||||
|
timespecadd(&ts_wait, ts, &ts_wait);
|
||||||
|
|
||||||
|
return pthread_mutex_timedlock(m, &ts_wait);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define mutex_lock(a, b) pthread_mutex_lock(a)
|
||||||
|
#endif
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
mutex1_threadfunc(void *arg)
|
mutex1_threadfunc(void *arg)
|
||||||
{
|
{
|
||||||
@ -56,7 +86,7 @@ mutex1_threadfunc(void *arg)
|
|||||||
|
|
||||||
param = arg;
|
param = arg;
|
||||||
printf("2: Locking mutex\n");
|
printf("2: Locking mutex\n");
|
||||||
pthread_mutex_lock(&mutex);
|
mutex_lock(&mutex, &ts_lengthy);
|
||||||
printf("2: Got mutex. *param = %d\n", *param);
|
printf("2: Got mutex. *param = %d\n", *param);
|
||||||
ATF_REQUIRE_EQ(*param, 20);
|
ATF_REQUIRE_EQ(*param, 20);
|
||||||
(*param)++;
|
(*param)++;
|
||||||
@ -81,7 +111,7 @@ ATF_TC_BODY(mutex1, tc)
|
|||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
|
PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
|
||||||
x = 1;
|
x = 1;
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex1_threadfunc, &x));
|
PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex1_threadfunc, &x));
|
||||||
printf("1: Before changing the value.\n");
|
printf("1: Before changing the value.\n");
|
||||||
sleep(2);
|
sleep(2);
|
||||||
@ -92,7 +122,7 @@ ATF_TC_BODY(mutex1, tc)
|
|||||||
printf("1: After releasing the mutex.\n");
|
printf("1: After releasing the mutex.\n");
|
||||||
PTHREAD_REQUIRE(pthread_join(new, &joinval));
|
PTHREAD_REQUIRE(pthread_join(new, &joinval));
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
printf("1: Thread joined. X was %d. Return value (int) was %d\n",
|
printf("1: Thread joined. X was %d. Return value (int) was %d\n",
|
||||||
x, *(int *)joinval);
|
x, *(int *)joinval);
|
||||||
ATF_REQUIRE_EQ(x, 21);
|
ATF_REQUIRE_EQ(x, 21);
|
||||||
@ -108,7 +138,7 @@ mutex2_threadfunc(void *arg)
|
|||||||
printf("2: Second thread (%p). Count is %ld\n", pthread_self(), count);
|
printf("2: Second thread (%p). Count is %ld\n", pthread_self(), count);
|
||||||
|
|
||||||
while (count--) {
|
while (count--) {
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
global_x++;
|
global_x++;
|
||||||
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
||||||
}
|
}
|
||||||
@ -145,7 +175,7 @@ ATF_TC_BODY(mutex2, tc)
|
|||||||
global_x = 0;
|
global_x = 0;
|
||||||
count = count2 = 10000000;
|
count = count2 = 10000000;
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex2_threadfunc, &count2));
|
PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex2_threadfunc, &count2));
|
||||||
|
|
||||||
printf("1: Thread %p\n", pthread_self());
|
printf("1: Thread %p\n", pthread_self());
|
||||||
@ -153,14 +183,14 @@ ATF_TC_BODY(mutex2, tc)
|
|||||||
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
||||||
|
|
||||||
while (count--) {
|
while (count--) {
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
global_x++;
|
global_x++;
|
||||||
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
||||||
}
|
}
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_join(new, &joinval));
|
PTHREAD_REQUIRE(pthread_join(new, &joinval));
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
printf("1: Thread joined. X was %d. Return value (long) was %ld\n",
|
printf("1: Thread joined. X was %d. Return value (long) was %ld\n",
|
||||||
global_x, (long)joinval);
|
global_x, (long)joinval);
|
||||||
ATF_REQUIRE_EQ(global_x, 20000000);
|
ATF_REQUIRE_EQ(global_x, 20000000);
|
||||||
@ -184,7 +214,7 @@ mutex3_threadfunc(void *arg)
|
|||||||
printf("2: Second thread (%p). Count is %ld\n", pthread_self(), count);
|
printf("2: Second thread (%p). Count is %ld\n", pthread_self(), count);
|
||||||
|
|
||||||
while (count--) {
|
while (count--) {
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
|
PTHREAD_REQUIRE(mutex_lock(&static_mutex, &ts_lengthy));
|
||||||
global_x++;
|
global_x++;
|
||||||
PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
|
||||||
}
|
}
|
||||||
@ -220,7 +250,7 @@ ATF_TC_BODY(mutex3, tc)
|
|||||||
global_x = 0;
|
global_x = 0;
|
||||||
count = count2 = 10000000;
|
count = count2 = 10000000;
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
|
PTHREAD_REQUIRE(mutex_lock(&static_mutex, &ts_lengthy));
|
||||||
PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex3_threadfunc, &count2));
|
PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex3_threadfunc, &count2));
|
||||||
|
|
||||||
printf("1: Thread %p\n", pthread_self());
|
printf("1: Thread %p\n", pthread_self());
|
||||||
@ -228,14 +258,14 @@ ATF_TC_BODY(mutex3, tc)
|
|||||||
PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
|
||||||
|
|
||||||
while (count--) {
|
while (count--) {
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
|
PTHREAD_REQUIRE(mutex_lock(&static_mutex, &ts_lengthy));
|
||||||
global_x++;
|
global_x++;
|
||||||
PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
|
||||||
}
|
}
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_join(new, &joinval));
|
PTHREAD_REQUIRE(pthread_join(new, &joinval));
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
|
PTHREAD_REQUIRE(mutex_lock(&static_mutex, &ts_lengthy));
|
||||||
printf("1: Thread joined. X was %d. Return value (long) was %ld\n",
|
printf("1: Thread joined. X was %d. Return value (long) was %ld\n",
|
||||||
global_x, (long)joinval);
|
global_x, (long)joinval);
|
||||||
ATF_REQUIRE_EQ(global_x, 20000000);
|
ATF_REQUIRE_EQ(global_x, 20000000);
|
||||||
@ -260,7 +290,7 @@ mutex4_threadfunc(void *arg)
|
|||||||
|
|
||||||
param = arg;
|
param = arg;
|
||||||
printf("2: Locking mutex\n");
|
printf("2: Locking mutex\n");
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
printf("2: Got mutex. *param = %d\n", *param);
|
printf("2: Got mutex. *param = %d\n", *param);
|
||||||
(*param)++;
|
(*param)++;
|
||||||
|
|
||||||
@ -291,11 +321,11 @@ ATF_TC_BODY(mutex4, tc)
|
|||||||
PTHREAD_REQUIRE(pthread_mutexattr_destroy(&mattr));
|
PTHREAD_REQUIRE(pthread_mutexattr_destroy(&mattr));
|
||||||
|
|
||||||
x = 1;
|
x = 1;
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex4_threadfunc, &x));
|
PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex4_threadfunc, &x));
|
||||||
|
|
||||||
printf("1: Before recursively acquiring the mutex.\n");
|
printf("1: Before recursively acquiring the mutex.\n");
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
|
|
||||||
printf("1: Before releasing the mutex once.\n");
|
printf("1: Before releasing the mutex once.\n");
|
||||||
sleep(2);
|
sleep(2);
|
||||||
@ -311,7 +341,7 @@ ATF_TC_BODY(mutex4, tc)
|
|||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_join(new, &joinval));
|
PTHREAD_REQUIRE(pthread_join(new, &joinval));
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
printf("1: Thread joined. X was %d. Return value (int) was %d\n",
|
printf("1: Thread joined. X was %d. Return value (int) was %d\n",
|
||||||
x, *(int *)joinval);
|
x, *(int *)joinval);
|
||||||
ATF_REQUIRE_EQ(x, 21);
|
ATF_REQUIRE_EQ(x, 21);
|
||||||
@ -333,7 +363,7 @@ child_func(void* arg)
|
|||||||
res = _sched_protect(-2);
|
res = _sched_protect(-2);
|
||||||
ATF_REQUIRE_EQ_MSG(res, -1, "sched_protect returned %d", res);
|
ATF_REQUIRE_EQ_MSG(res, -1, "sched_protect returned %d", res);
|
||||||
ATF_REQUIRE_EQ(errno, ENOENT);
|
ATF_REQUIRE_EQ(errno, ENOENT);
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex5));
|
PTHREAD_REQUIRE(mutex_lock(&mutex5, &ts_lengthy));
|
||||||
printf("child is owning resource\n");
|
printf("child is owning resource\n");
|
||||||
res = _sched_protect(-2);
|
res = _sched_protect(-2);
|
||||||
ATF_REQUIRE_EQ(res, max_fifo_prio);
|
ATF_REQUIRE_EQ(res, max_fifo_prio);
|
||||||
@ -376,7 +406,7 @@ ATF_TC_BODY(mutex5, tc)
|
|||||||
max_fifo_prio));
|
max_fifo_prio));
|
||||||
|
|
||||||
PTHREAD_REQUIRE(pthread_mutex_init(&mutex5, &attr5));
|
PTHREAD_REQUIRE(pthread_mutex_init(&mutex5, &attr5));
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex5));
|
PTHREAD_REQUIRE(mutex_lock(&mutex5, &ts_lengthy));
|
||||||
printf("enter critical section for main\n");
|
printf("enter critical section for main\n");
|
||||||
PTHREAD_REQUIRE(pthread_create(&child, NULL, child_func, NULL));
|
PTHREAD_REQUIRE(pthread_create(&child, NULL, child_func, NULL));
|
||||||
printf("main starts to sleep\n");
|
printf("main starts to sleep\n");
|
||||||
@ -414,7 +444,7 @@ high_prio(void* arg)
|
|||||||
high_cnt = 0;
|
high_cnt = 0;
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex6));
|
PTHREAD_REQUIRE(mutex_lock(&mutex6, &ts_lengthy));
|
||||||
if (start == 0) start = 2;
|
if (start == 0) start = 2;
|
||||||
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex6));
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex6));
|
||||||
|
|
||||||
@ -446,7 +476,7 @@ low_prio(void* arg)
|
|||||||
low_cnt = 0;
|
low_cnt = 0;
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex6));
|
PTHREAD_REQUIRE(mutex_lock(&mutex6, &ts_lengthy));
|
||||||
if (start == 0)
|
if (start == 0)
|
||||||
start = 1;
|
start = 1;
|
||||||
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex6));
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex6));
|
||||||
@ -582,6 +612,123 @@ ATF_TC_BODY(mutexattr2, tc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TIMEDMUTEX
|
||||||
|
ATF_TC(timedmutex1);
|
||||||
|
ATF_TC_HEAD(timedmutex1, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr", "Checks timeout on selflock");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(timedmutex1, tc)
|
||||||
|
{
|
||||||
|
|
||||||
|
printf("Timed mutex-test 1\n");
|
||||||
|
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
|
||||||
|
|
||||||
|
printf("Before acquiring mutex\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
||||||
|
|
||||||
|
printf("Before endeavor to reacquire timed-mutex (timeout expected)\n");
|
||||||
|
PTHREAD_REQUIRE_STATUS(mutex_lock(&mutex, &ts_shortlived),
|
||||||
|
ETIMEDOUT);
|
||||||
|
|
||||||
|
printf("Unlocking mutex\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(timedmutex2);
|
||||||
|
ATF_TC_HEAD(timedmutex2, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Checks timeout on selflock with timedlock");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(timedmutex2, tc)
|
||||||
|
{
|
||||||
|
|
||||||
|
printf("Timed mutex-test 2\n");
|
||||||
|
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
|
||||||
|
|
||||||
|
printf("Before acquiring mutex with timedlock\n");
|
||||||
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
|
|
||||||
|
printf("Before endeavor to reacquire timed-mutex (timeout expected)\n");
|
||||||
|
PTHREAD_REQUIRE_STATUS(mutex_lock(&mutex, &ts_shortlived),
|
||||||
|
ETIMEDOUT);
|
||||||
|
|
||||||
|
printf("Unlocking mutex\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(timedmutex3);
|
||||||
|
ATF_TC_HEAD(timedmutex3, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Checks timeout on selflock in a new thread");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
timedmtx_thrdfunc(void *arg)
|
||||||
|
{
|
||||||
|
printf("Before endeavor to reacquire timed-mutex (timeout expected)\n");
|
||||||
|
PTHREAD_REQUIRE_STATUS(mutex_lock(&mutex, &ts_shortlived),
|
||||||
|
ETIMEDOUT);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(timedmutex3, tc)
|
||||||
|
{
|
||||||
|
pthread_t new;
|
||||||
|
|
||||||
|
printf("Timed mutex-test 3\n");
|
||||||
|
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
|
||||||
|
|
||||||
|
printf("Before acquiring mutex with timedlock\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
|
||||||
|
|
||||||
|
printf("Before creating new thread\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_create(&new, NULL, timedmtx_thrdfunc, NULL));
|
||||||
|
|
||||||
|
printf("Before joining the mutex\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_join(new, NULL));
|
||||||
|
|
||||||
|
printf("Unlocking mutex\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC(timedmutex4);
|
||||||
|
ATF_TC_HEAD(timedmutex4, tc)
|
||||||
|
{
|
||||||
|
atf_tc_set_md_var(tc, "descr",
|
||||||
|
"Checks timeout on selflock with timedlock in a new thread");
|
||||||
|
}
|
||||||
|
|
||||||
|
ATF_TC_BODY(timedmutex4, tc)
|
||||||
|
{
|
||||||
|
pthread_t new;
|
||||||
|
|
||||||
|
printf("Timed mutex-test 4\n");
|
||||||
|
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
|
||||||
|
|
||||||
|
printf("Before acquiring mutex with timedlock\n");
|
||||||
|
PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
|
||||||
|
|
||||||
|
printf("Before creating new thread\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_create(&new, NULL, timedmtx_thrdfunc, NULL));
|
||||||
|
|
||||||
|
printf("Before joining the mutex\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_join(new, NULL));
|
||||||
|
|
||||||
|
printf("Unlocking mutex\n");
|
||||||
|
PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ATF_TP_ADD_TCS(tp)
|
ATF_TP_ADD_TCS(tp)
|
||||||
{
|
{
|
||||||
ATF_TP_ADD_TC(tp, mutex1);
|
ATF_TP_ADD_TC(tp, mutex1);
|
||||||
@ -595,5 +742,12 @@ ATF_TP_ADD_TCS(tp)
|
|||||||
ATF_TP_ADD_TC(tp, mutexattr1);
|
ATF_TP_ADD_TC(tp, mutexattr1);
|
||||||
ATF_TP_ADD_TC(tp, mutexattr2);
|
ATF_TP_ADD_TC(tp, mutexattr2);
|
||||||
|
|
||||||
|
#ifdef TIMEDMUTEX
|
||||||
|
ATF_TP_ADD_TC(tp, timedmutex1);
|
||||||
|
ATF_TP_ADD_TC(tp, timedmutex2);
|
||||||
|
ATF_TP_ADD_TC(tp, timedmutex3);
|
||||||
|
ATF_TP_ADD_TC(tp, timedmutex4);
|
||||||
|
#endif
|
||||||
|
|
||||||
return atf_no_error();
|
return atf_no_error();
|
||||||
}
|
}
|
||||||
|
30
contrib/netbsd-tests/lib/libpthread/t_timedmutex.c
Normal file
30
contrib/netbsd-tests/lib/libpthread/t_timedmutex.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* $NetBSD: t_timedmutex.c,v 1.2 2016/10/31 16:21:23 christos Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TIMEDMUTEX
|
||||||
|
#include "t_mutex.c"
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: h_execthr.c,v 1.3 2014/08/13 00:03:00 pooka Exp $ */
|
/* $NetBSD: h_execthr.c,v 1.7 2016/11/24 00:37:29 dholland Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||||
@ -42,6 +42,14 @@
|
|||||||
#include <rump/rumpclient.h>
|
#include <rump/rumpclient.h>
|
||||||
#include <rump/rump_syscalls.h>
|
#include <rump/rump_syscalls.h>
|
||||||
|
|
||||||
|
//#define VERBOSE
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
#define SAY(...) printf(__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define SAY(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
static int canreturn = 0;
|
static int canreturn = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -103,6 +111,7 @@ main(int argc, char *argv[], char *envp[])
|
|||||||
else
|
else
|
||||||
execd = 0;
|
execd = 0;
|
||||||
sprintf(nexec, "%d", execd+1);
|
sprintf(nexec, "%d", execd+1);
|
||||||
|
SAY("execd: %d\n", execd);
|
||||||
|
|
||||||
if (rumpclient_init() == -1) {
|
if (rumpclient_init() == -1) {
|
||||||
if (execd)
|
if (execd)
|
||||||
@ -111,33 +120,43 @@ main(int argc, char *argv[], char *envp[])
|
|||||||
err(1, "init");
|
err(1, "init");
|
||||||
}
|
}
|
||||||
mypid = rump_sys_getpid();
|
mypid = rump_sys_getpid();
|
||||||
|
SAY("rumpclient_init finished.\n");
|
||||||
|
|
||||||
if (execd) {
|
if (execd) {
|
||||||
canreturn = 1;
|
canreturn = 1;
|
||||||
if (pthread_create(&pt, NULL,
|
errno = pthread_create(&pt, NULL,
|
||||||
wrk, (void *)(uintptr_t)P2_0) != 0)
|
wrk, (void *)(uintptr_t)P2_0);
|
||||||
errx(1, "exec pthread_create");
|
if (errno != 0)
|
||||||
|
err(1, "exec pthread_create");
|
||||||
|
SAY("startup pthread_create finished.\n");
|
||||||
|
|
||||||
i = 37;
|
i = 37;
|
||||||
rump_sys_write(P2_1, &i, sizeof(i));
|
rump_sys_write(P2_1, &i, sizeof(i));
|
||||||
pthread_join(pt, NULL);
|
pthread_join(pt, NULL);
|
||||||
|
SAY("startup pthread_join finished.\n");
|
||||||
|
|
||||||
n = rump_sys_read(P1_0, &i, sizeof(i));
|
n = rump_sys_read(P1_0, &i, sizeof(i));
|
||||||
if (n != -1 || errno != EBADF)
|
if (n != -1 || errno != EBADF)
|
||||||
errx(1, "post-exec cloexec works");
|
errx(1, "post-exec cloexec works");
|
||||||
|
SAY("startup rump_sys_read finished.\n");
|
||||||
|
|
||||||
getproc(mypid, &p);
|
getproc(mypid, &p);
|
||||||
|
SAY("startup getproc finished.\n");
|
||||||
if (p.p_nlwps != 2)
|
if (p.p_nlwps != 2)
|
||||||
errx(1, "invalid nlwps: %lld", (long long)p.p_nlwps);
|
errx(1, "invalid nlwps: %lld", (long long)p.p_nlwps);
|
||||||
|
|
||||||
/* we passed? */
|
/* we passed? */
|
||||||
if (execd > 10)
|
if (execd > 10) {
|
||||||
|
SAY("done.\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
rump_sys_close(P2_0);
|
rump_sys_close(P2_0);
|
||||||
rump_sys_close(P2_1);
|
rump_sys_close(P2_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SAY("making pipes...\n");
|
||||||
|
|
||||||
if (rump_sys_pipe(p1) == -1)
|
if (rump_sys_pipe(p1) == -1)
|
||||||
err(1, "pipe1");
|
err(1, "pipe1");
|
||||||
if (p1[0] != P1_0 || p1[1] != P1_1)
|
if (p1[0] != P1_0 || p1[1] != P1_1)
|
||||||
@ -151,32 +170,47 @@ main(int argc, char *argv[], char *envp[])
|
|||||||
if (rump_sys_fcntl(p1[1], F_SETFD, FD_CLOEXEC) == -1)
|
if (rump_sys_fcntl(p1[1], F_SETFD, FD_CLOEXEC) == -1)
|
||||||
err(1, "cloexec");
|
err(1, "cloexec");
|
||||||
|
|
||||||
for (i = 0; i < NTHR; i++)
|
SAY("making threads...\n");
|
||||||
if (pthread_create(&pt, NULL,
|
|
||||||
wrk, (void *)(uintptr_t)p1[0]) != 0)
|
|
||||||
errx(1, "pthread_create 1 %d", i);
|
|
||||||
|
|
||||||
for (i = 0; i < NTHR; i++)
|
for (i = 0; i < NTHR; i++) {
|
||||||
if (pthread_create(&pt, NULL,
|
errno = pthread_create(&pt, NULL,
|
||||||
wrk, (void *)(uintptr_t)p2[0]) != 0)
|
wrk, (void *)(uintptr_t)p1[0]);
|
||||||
errx(1, "pthread_create 2 %d", i);
|
if (errno != 0)
|
||||||
|
err(1, "pthread_create 1 %d", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < NTHR; i++) {
|
||||||
|
errno = pthread_create(&pt, NULL,
|
||||||
|
wrk, (void *)(uintptr_t)p2[0]);
|
||||||
|
if (errno != 0)
|
||||||
|
err(1, "pthread_create 2 %d", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
SAY("waiting for threads to start...\n");
|
||||||
|
|
||||||
/* wait for all the threads to be enjoying themselves */
|
/* wait for all the threads to be enjoying themselves */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
getproc(mypid, &p);
|
getproc(mypid, &p);
|
||||||
|
SAY("getproc finished.\n");
|
||||||
if (p.p_nlwps == 2*NTHR + 2)
|
if (p.p_nlwps == 2*NTHR + 2)
|
||||||
break;
|
break;
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SAY("making some more threads start...\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* load up one more (big) set. these won't start executing, though,
|
* load up one more (big) set. these won't start executing, though,
|
||||||
* but we're interested in if they create blockage
|
* but we're interested in if they create blockage
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < 3*NTHR; i++)
|
for (i = 0; i < 3*NTHR; i++) {
|
||||||
if (pthread_create(&pt, NULL,
|
errno = pthread_create(&pt, NULL,
|
||||||
wrk, (void *)(uintptr_t)p1[0]) != 0)
|
wrk, (void *)(uintptr_t)p1[0]);
|
||||||
errx(1, "pthread_create 1 %d", i);
|
if (errno != 0)
|
||||||
|
err(1, "pthread_create 3 %d", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
SAY("calling exec...\n");
|
||||||
|
|
||||||
/* then, we exec! */
|
/* then, we exec! */
|
||||||
execarg[0] = argv[0];
|
execarg[0] = argv[0];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_tcpip.sh,v 1.17 2016/08/11 21:29:44 kre Exp $
|
# $NetBSD: t_tcpip.sh,v 1.18 2016/08/13 11:22:11 christos Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 The NetBSD Foundation, Inc.
|
# Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,7 +25,8 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
rumpnetsrv='rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpdev'
|
rumpnetlibs="-lrumpnet -lrumpnet_net -lrumpnet_netinet6 -lrumpnet_netinet"
|
||||||
|
rumpnetsrv="rump_server $rumpnetlibs -lrumpdev"
|
||||||
export RUMP_SERVER=unix://csock
|
export RUMP_SERVER=unix://csock
|
||||||
|
|
||||||
atf_test_case http cleanup
|
atf_test_case http cleanup
|
||||||
@ -37,7 +38,7 @@ http_head()
|
|||||||
http_body()
|
http_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 ${rumpnetsrv} -lrumpnet_netinet6 ${RUMP_SERVER}
|
atf_check -s exit:0 ${rumpnetsrv} ${RUMP_SERVER}
|
||||||
|
|
||||||
# start bozo in daemon mode
|
# start bozo in daemon mode
|
||||||
atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
|
atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_usbhid.c,v 1.11 2016/01/07 16:10:49 jakllsch Exp $ */
|
/* $NetBSD: t_usbhid.c,v 1.12 2016/08/17 12:10:42 jakllsch Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2016 Jonathan A. Kollasch
|
* Copyright (c) 2016 Jonathan A. Kollasch
|
||||||
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: t_usbhid.c,v 1.11 2016/01/07 16:10:49 jakllsch Exp $");
|
__RCSID("$NetBSD: t_usbhid.c,v 1.12 2016/08/17 12:10:42 jakllsch Exp $");
|
||||||
|
|
||||||
#include <atf-c.h>
|
#include <atf-c.h>
|
||||||
|
|
||||||
@ -244,6 +244,9 @@ ATF_TC_BODY(check_hid_get_data, tc)
|
|||||||
int32_t data;
|
int32_t data;
|
||||||
uint32_t udat;
|
uint32_t udat;
|
||||||
|
|
||||||
|
atf_tc_expect_fail("only the 32-bit opcode works, "
|
||||||
|
"8 and 16-bit is broken");
|
||||||
|
|
||||||
ATF_REQUIRE((hrd = hid_use_report_desc(
|
ATF_REQUIRE((hrd = hid_use_report_desc(
|
||||||
range_test_report_descriptor,
|
range_test_report_descriptor,
|
||||||
__arraycount(range_test_report_descriptor))) != NULL);
|
__arraycount(range_test_report_descriptor))) != NULL);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_arp.sh,v 1.16 2016/06/21 05:04:16 ozaki-r Exp $
|
# $NetBSD: t_arp.sh,v 1.22 2016/11/25 08:51:16 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,10 +25,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
inetserver="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif"
|
|
||||||
inetserver="$inetserver -lrumpdev -lrumpnet_tap"
|
|
||||||
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=sysctl=yes"
|
|
||||||
|
|
||||||
SOCKSRC=unix://commsock1
|
SOCKSRC=unix://commsock1
|
||||||
SOCKDST=unix://commsock2
|
SOCKDST=unix://commsock2
|
||||||
IP4SRC=10.0.1.1
|
IP4SRC=10.0.1.1
|
||||||
@ -36,7 +32,7 @@ IP4DST=10.0.1.2
|
|||||||
IP4DST_PROXYARP1=10.0.1.3
|
IP4DST_PROXYARP1=10.0.1.3
|
||||||
IP4DST_PROXYARP2=10.0.1.4
|
IP4DST_PROXYARP2=10.0.1.4
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
TIMEOUT=1
|
TIMEOUT=1
|
||||||
|
|
||||||
atf_test_case arp_cache_expiration_5s cleanup
|
atf_test_case arp_cache_expiration_5s cleanup
|
||||||
@ -106,9 +102,9 @@ arp_static_head()
|
|||||||
|
|
||||||
setup_dst_server()
|
setup_dst_server()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCKDST shmif0 bus1
|
||||||
export RUMP_SERVER=$SOCKDST
|
export RUMP_SERVER=$SOCKDST
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet $IP4DST/24
|
atf_check -s exit:0 rump.ifconfig shmif0 inet $IP4DST/24
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
@ -127,8 +123,7 @@ setup_src_server()
|
|||||||
atf_check -s exit:0 -o ignore rump.sysctl -w net.inet.arp.keep=$keep
|
atf_check -s exit:0 -o ignore rump.sysctl -w net.inet.arp.keep=$keep
|
||||||
|
|
||||||
# Setup an interface
|
# Setup an interface
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $SOCKSRC shmif0 bus1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet $IP4SRC/24
|
atf_check -s exit:0 rump.ifconfig shmif0 inet $IP4SRC/24
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
@ -145,8 +140,8 @@ test_cache_expiration()
|
|||||||
local arp_keep=$1
|
local arp_keep=$1
|
||||||
local bonus=2
|
local bonus=2
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server $arp_keep
|
setup_src_server $arp_keep
|
||||||
@ -172,12 +167,16 @@ test_cache_expiration()
|
|||||||
|
|
||||||
arp_cache_expiration_5s_body()
|
arp_cache_expiration_5s_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
test_cache_expiration 5
|
test_cache_expiration 5
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
arp_cache_expiration_10s_body()
|
arp_cache_expiration_10s_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
test_cache_expiration 10
|
test_cache_expiration 10
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
arp_command_body()
|
arp_command_body()
|
||||||
@ -185,8 +184,8 @@ arp_command_body()
|
|||||||
local arp_keep=5
|
local arp_keep=5
|
||||||
local bonus=2
|
local bonus=2
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server $arp_keep
|
setup_src_server $arp_keep
|
||||||
@ -257,7 +256,7 @@ arp_command_body()
|
|||||||
$DEBUG && rump.arp -n -a
|
$DEBUG && rump.arp -n -a
|
||||||
#atf_check -s not-exit:0 -e ignore rump.arp -n 10.0.1.10
|
#atf_check -s not-exit:0 -e ignore rump.arp -n 10.0.1.10
|
||||||
|
|
||||||
return 0
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
make_pkt_str_arpreq()
|
make_pkt_str_arpreq()
|
||||||
@ -273,12 +272,12 @@ arp_garp_body()
|
|||||||
{
|
{
|
||||||
local pkt=
|
local pkt=
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKSRC
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
|
||||||
# Setup an interface
|
# Setup an interface
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $SOCKSRC shmif0 bus1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet 10.0.0.1/24
|
atf_check -s exit:0 rump.ifconfig shmif0 inet 10.0.0.1/24
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet 10.0.0.2/24 alias
|
atf_check -s exit:0 rump.ifconfig shmif0 inet 10.0.0.2/24 alias
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
@ -304,6 +303,8 @@ arp_garp_body()
|
|||||||
atf_check -s not-exit:0 -x "cat ./out |grep -q '$pkt'"
|
atf_check -s not-exit:0 -x "cat ./out |grep -q '$pkt'"
|
||||||
pkt=$(make_pkt_str_arpreq 10.0.0.4 10.0.0.4)
|
pkt=$(make_pkt_str_arpreq 10.0.0.4 10.0.0.4)
|
||||||
atf_check -s not-exit:0 -x "cat ./out |grep -q '$pkt'"
|
atf_check -s not-exit:0 -x "cat ./out |grep -q '$pkt'"
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
arp_cache_overwriting_body()
|
arp_cache_overwriting_body()
|
||||||
@ -311,8 +312,8 @@ arp_cache_overwriting_body()
|
|||||||
local arp_keep=5
|
local arp_keep=5
|
||||||
local bonus=2
|
local bonus=2
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server $arp_keep
|
setup_src_server $arp_keep
|
||||||
@ -341,7 +342,7 @@ arp_cache_overwriting_body()
|
|||||||
atf_check -s exit:0 -o match:'b2:a0:20:00:00:ff' rump.arp -n 10.0.1.10
|
atf_check -s exit:0 -o match:'b2:a0:20:00:00:ff' rump.arp -n 10.0.1.10
|
||||||
$DEBUG && rump.arp -n -a
|
$DEBUG && rump.arp -n -a
|
||||||
|
|
||||||
return 0
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
make_pkt_str_arprep()
|
make_pkt_str_arprep()
|
||||||
@ -363,36 +364,21 @@ make_pkt_str_garp()
|
|||||||
echo $pkt
|
echo $pkt
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_new_packets()
|
|
||||||
{
|
|
||||||
local old=./old
|
|
||||||
|
|
||||||
if [ ! -f $old ]; then
|
|
||||||
old=/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| \
|
|
||||||
tcpdump -n -e -r - 2>/dev/null > ./new
|
|
||||||
diff -u $old ./new |grep '^+' |cut -d '+' -f 2 > ./diff
|
|
||||||
mv -f ./new ./old
|
|
||||||
cat ./diff
|
|
||||||
}
|
|
||||||
|
|
||||||
test_proxy_arp()
|
test_proxy_arp()
|
||||||
{
|
{
|
||||||
local arp_keep=5
|
local arp_keep=5
|
||||||
local opts= title= flags=
|
local opts= title= flags=
|
||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST tap
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server $arp_keep
|
setup_src_server $arp_keep
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKDST
|
export RUMP_SERVER=$SOCKDST
|
||||||
atf_check -s exit:0 -o ignore rump.sysctl -w net.inet.ip.forwarding=1
|
atf_check -s exit:0 -o ignore rump.sysctl -w net.inet.ip.forwarding=1
|
||||||
macaddr_dst=$(rump.ifconfig shmif0 |awk '/address/ {print $2;}')
|
macaddr_dst=$(get_macaddr $SOCKDST shmif0)
|
||||||
|
|
||||||
if [ "$type" = "pub" ]; then
|
if [ "$type" = "pub" ]; then
|
||||||
opts="pub"
|
opts="pub"
|
||||||
@ -416,7 +402,7 @@ test_proxy_arp()
|
|||||||
rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP1
|
rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP1
|
||||||
|
|
||||||
# Flushing
|
# Flushing
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
|
|
||||||
# Set up proxy ARP entry
|
# Set up proxy ARP entry
|
||||||
export RUMP_SERVER=$SOCKDST
|
export RUMP_SERVER=$SOCKDST
|
||||||
@ -435,7 +421,7 @@ test_proxy_arp()
|
|||||||
rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP1
|
rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
pkt1=$(make_pkt_str_arprep $IP4DST_PROXYARP1 $macaddr_dst)
|
pkt1=$(make_pkt_str_arprep $IP4DST_PROXYARP1 $macaddr_dst)
|
||||||
@ -461,7 +447,7 @@ test_proxy_arp()
|
|||||||
atf_check -s not-exit:0 -o ignore -e ignore \
|
atf_check -s not-exit:0 -o ignore -e ignore \
|
||||||
rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP2
|
rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP2
|
||||||
|
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
# ARP reply should be sent
|
# ARP reply should be sent
|
||||||
@ -482,12 +468,14 @@ arp_proxy_arp_pub_body()
|
|||||||
{
|
{
|
||||||
|
|
||||||
test_proxy_arp pub
|
test_proxy_arp pub
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
arp_proxy_arp_pubproxy_body()
|
arp_proxy_arp_pubproxy_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
test_proxy_arp pubproxy
|
test_proxy_arp pubproxy
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
arp_link_activation_body()
|
arp_link_activation_body()
|
||||||
@ -495,14 +483,14 @@ arp_link_activation_body()
|
|||||||
local arp_keep=5
|
local arp_keep=5
|
||||||
local bonus=2
|
local bonus=2
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server $arp_keep
|
setup_src_server $arp_keep
|
||||||
|
|
||||||
# flush old packets
|
# flush old packets
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKSRC
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
|
||||||
@ -510,7 +498,7 @@ arp_link_activation_body()
|
|||||||
b2:a1:00:00:00:01
|
b2:a1:00:00:00:01
|
||||||
|
|
||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
pkt=$(make_pkt_str_arpreq $IP4SRC $IP4SRC)
|
pkt=$(make_pkt_str_arpreq $IP4SRC $IP4SRC)
|
||||||
@ -520,12 +508,14 @@ arp_link_activation_body()
|
|||||||
b2:a1:00:00:00:02 active
|
b2:a1:00:00:00:02 active
|
||||||
|
|
||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
pkt=$(make_pkt_str_arpreq $IP4SRC $IP4SRC)
|
pkt=$(make_pkt_str_arpreq $IP4SRC $IP4SRC)
|
||||||
atf_check -s exit:0 -x \
|
atf_check -s exit:0 -x \
|
||||||
"cat ./out |grep '$pkt' |grep -q 'b2:a1:00:00:00:02'"
|
"cat ./out |grep '$pkt' |grep -q 'b2:a1:00:00:00:02'"
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
arp_static_body()
|
arp_static_body()
|
||||||
@ -533,14 +523,13 @@ arp_static_body()
|
|||||||
local arp_keep=5
|
local arp_keep=5
|
||||||
local macaddr_src=
|
local macaddr_src=
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server $arp_keep
|
setup_src_server $arp_keep
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKSRC
|
macaddr_src=$(get_macaddr $SOCKSRC shmif0)
|
||||||
macaddr_src=$(rump.ifconfig shmif0 |awk '/address/ {print $2;}')
|
|
||||||
|
|
||||||
# Set a (valid) static ARP entry for the src server
|
# Set a (valid) static ARP entry for the src server
|
||||||
export RUMP_SERVER=$SOCKDST
|
export RUMP_SERVER=$SOCKDST
|
||||||
@ -551,37 +540,8 @@ arp_static_body()
|
|||||||
# Test receiving an ARP request with the static ARP entry (as spa/sha)
|
# Test receiving an ARP request with the static ARP entry (as spa/sha)
|
||||||
export RUMP_SERVER=$SOCKSRC
|
export RUMP_SERVER=$SOCKSRC
|
||||||
atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 $IP4DST
|
atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 $IP4DST
|
||||||
}
|
|
||||||
|
|
||||||
cleanup()
|
rump_server_destroy_ifaces
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCKSRC rump.halt
|
|
||||||
env RUMP_SERVER=$SOCKDST rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_src()
|
|
||||||
{
|
|
||||||
export RUMP_SERVER=$SOCKSRC
|
|
||||||
rump.netstat -nr
|
|
||||||
rump.arp -n -a
|
|
||||||
rump.ifconfig
|
|
||||||
$HIJACKING dmesg
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_dst()
|
|
||||||
{
|
|
||||||
export RUMP_SERVER=$SOCKDST
|
|
||||||
rump.netstat -nr
|
|
||||||
rump.arp -n -a
|
|
||||||
rump.ifconfig
|
|
||||||
$HIJACKING dmesg
|
|
||||||
}
|
|
||||||
|
|
||||||
dump()
|
|
||||||
{
|
|
||||||
dump_src
|
|
||||||
dump_dst
|
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r -
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arp_cache_expiration_5s_cleanup()
|
arp_cache_expiration_5s_cleanup()
|
||||||
@ -604,9 +564,8 @@ arp_command_cleanup()
|
|||||||
|
|
||||||
arp_garp_cleanup()
|
arp_garp_cleanup()
|
||||||
{
|
{
|
||||||
$DEBUG && dump_src
|
$DEBUG && dump
|
||||||
$DEBUG && shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r -
|
cleanup
|
||||||
env RUMP_SERVER=$SOCKSRC rump.halt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arp_cache_overwriting_cleanup()
|
arp_cache_overwriting_cleanup()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_dad.sh,v 1.7 2016/08/10 22:05:07 kre Exp $
|
# $NetBSD: t_dad.sh,v 1.13 2016/11/25 08:51:16 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,14 +25,10 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
inetserver="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif"
|
|
||||||
inetserver="${inetserver} -lrumpdev"
|
|
||||||
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=sysctl=yes"
|
|
||||||
|
|
||||||
SOCKLOCAL=unix://commsock1
|
SOCKLOCAL=unix://commsock1
|
||||||
SOCKPEER=unix://commsock2
|
SOCKPEER=unix://commsock2
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
atf_test_case dad_basic cleanup
|
atf_test_case dad_basic cleanup
|
||||||
atf_test_case dad_duplicated cleanup
|
atf_test_case dad_duplicated cleanup
|
||||||
@ -54,10 +50,9 @@ setup_server()
|
|||||||
local sock=$1
|
local sock=$1
|
||||||
local ip=$2
|
local ip=$2
|
||||||
|
|
||||||
export RUMP_SERVER=$sock
|
rump_server_add_iface $sock shmif0 bus1
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
export RUMP_SERVER=$sock
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet $ip/24
|
atf_check -s exit:0 rump.ifconfig shmif0 inet $ip/24
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
@ -74,30 +69,15 @@ make_pkt_str()
|
|||||||
echo $pkt
|
echo $pkt
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_new_packets()
|
|
||||||
{
|
|
||||||
local old=./old
|
|
||||||
|
|
||||||
if [ ! -f $old ]; then
|
|
||||||
old=/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| \
|
|
||||||
tcpdump -n -e -r - 2>/dev/null > ./new
|
|
||||||
diff -u $old ./new |grep '^+' |cut -d '+' -f 2 > ./diff
|
|
||||||
mv -f ./new ./old
|
|
||||||
cat ./diff
|
|
||||||
}
|
|
||||||
|
|
||||||
dad_basic_body()
|
dad_basic_body()
|
||||||
{
|
{
|
||||||
local pkt=
|
local pkt=
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKLOCAL
|
rump_server_start $SOCKLOCAL
|
||||||
|
rump_server_add_iface $SOCKLOCAL shmif0 bus1
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKLOCAL
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet 10.0.0.1/24
|
atf_check -s exit:0 rump.ifconfig shmif0 inet 10.0.0.1/24
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet 10.0.0.2/24 alias
|
atf_check -s exit:0 rump.ifconfig shmif0 inet 10.0.0.2/24 alias
|
||||||
$DEBUG && rump.ifconfig shmif0
|
$DEBUG && rump.ifconfig shmif0
|
||||||
@ -107,13 +87,13 @@ dad_basic_body()
|
|||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
# The primary address doesn't start with tentative state
|
# The primary address doesn't start with tentative state
|
||||||
atf_check -s not-exit:0 -x "cat ./out |grep 10.0.0.1 |grep -q tentative"
|
atf_check -s not-exit:0 -x "cat ./out |grep 10.0.0.1 |grep -iq tentative"
|
||||||
# The alias address starts with tentative state
|
# The alias address starts with tentative state
|
||||||
# XXX we have no stable way to check this, so skip for now
|
# XXX we have no stable way to check this, so skip for now
|
||||||
#atf_check -s exit:0 -x "cat ./out |grep 10.0.0.2 |grep -q tentative"
|
#atf_check -s exit:0 -x "cat ./out |grep 10.0.0.2 |grep -iq tentative"
|
||||||
|
|
||||||
atf_check -s exit:0 sleep 2
|
atf_check -s exit:0 sleep 2
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
# Check DAD probe packets
|
# Check DAD probe packets
|
||||||
@ -127,14 +107,14 @@ dad_basic_body()
|
|||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
# Give a chance to send a DAD announce packet
|
# Give a chance to send a DAD announce packet
|
||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
# Check the DAD announce packet
|
# Check the DAD announce packet
|
||||||
pkt=$(make_pkt_str 10.0.0.2 10.0.0.2)
|
pkt=$(make_pkt_str 10.0.0.2 10.0.0.2)
|
||||||
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
||||||
# The alias address left tentative
|
# The alias address left tentative
|
||||||
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep 10.0.0.2 |grep -q tentative"
|
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep 10.0.0.2 |grep -iq tentative"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add a new address on the fly
|
# Add a new address on the fly
|
||||||
@ -143,11 +123,11 @@ dad_basic_body()
|
|||||||
|
|
||||||
# The new address starts with tentative state
|
# The new address starts with tentative state
|
||||||
# XXX we have no stable way to check this, so skip for now
|
# XXX we have no stable way to check this, so skip for now
|
||||||
#atf_check -s exit:0 -x "rump.ifconfig shmif0 |grep 10.0.0.3 |grep -q tentative"
|
#atf_check -s exit:0 -x "rump.ifconfig shmif0 |grep 10.0.0.3 |grep -iq tentative"
|
||||||
|
|
||||||
# Check DAD probe packets
|
# Check DAD probe packets
|
||||||
atf_check -s exit:0 sleep 2
|
atf_check -s exit:0 sleep 2
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
pkt=$(make_pkt_str 10.0.0.3 0.0.0.0)
|
pkt=$(make_pkt_str 10.0.0.3 0.0.0.0)
|
||||||
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
||||||
@ -156,14 +136,16 @@ dad_basic_body()
|
|||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
# Give a chance to send a DAD announce packet
|
# Give a chance to send a DAD announce packet
|
||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
# Check the DAD announce packet
|
# Check the DAD announce packet
|
||||||
pkt=$(make_pkt_str 10.0.0.3 10.0.0.3)
|
pkt=$(make_pkt_str 10.0.0.3 10.0.0.3)
|
||||||
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
||||||
# The new address left tentative
|
# The new address left tentative
|
||||||
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep 10.0.0.3 |grep -q tentative"
|
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep 10.0.0.3 |grep -iq tentative"
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
dad_duplicated_body()
|
dad_duplicated_body()
|
||||||
@ -172,8 +154,8 @@ dad_duplicated_body()
|
|||||||
local localip2=10.0.1.11
|
local localip2=10.0.1.11
|
||||||
local peerip=10.0.1.2
|
local peerip=10.0.1.2
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKLOCAL
|
rump_server_start $SOCKLOCAL
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKPEER
|
rump_server_start $SOCKPEER
|
||||||
|
|
||||||
setup_server $SOCKLOCAL $localip1
|
setup_server $SOCKLOCAL $localip1
|
||||||
setup_server $SOCKPEER $peerip
|
setup_server $SOCKPEER $peerip
|
||||||
@ -181,7 +163,7 @@ dad_duplicated_body()
|
|||||||
export RUMP_SERVER=$SOCKLOCAL
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
|
|
||||||
# The primary address isn't marked as duplicated
|
# The primary address isn't marked as duplicated
|
||||||
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep $localip1 |grep -q duplicated"
|
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep $localip1 |grep -iq duplicated"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add a new address duplicated with the peer server
|
# Add a new address duplicated with the peer server
|
||||||
@ -190,50 +172,20 @@ dad_duplicated_body()
|
|||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
|
|
||||||
# The new address is marked as duplicated
|
# The new address is marked as duplicated
|
||||||
atf_check -s exit:0 -x "rump.ifconfig shmif0 |grep $peerip |grep -q duplicated"
|
atf_check -s exit:0 -x "rump.ifconfig shmif0 |grep $peerip |grep -iq duplicated"
|
||||||
|
|
||||||
# A unique address isn't marked as duplicated
|
# A unique address isn't marked as duplicated
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet $localip2 alias
|
atf_check -s exit:0 rump.ifconfig shmif0 inet $localip2 alias
|
||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep $localip2 |grep -q duplicated"
|
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep $localip2 |grep -iq duplicated"
|
||||||
}
|
|
||||||
|
|
||||||
cleanup()
|
rump_server_destroy_ifaces
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCKLOCAL rump.halt
|
|
||||||
env RUMP_SERVER=$SOCKPEER rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_local()
|
|
||||||
{
|
|
||||||
export RUMP_SERVER=$SOCKLOCAL
|
|
||||||
rump.netstat -nr
|
|
||||||
rump.arp -n -a
|
|
||||||
rump.ifconfig
|
|
||||||
$HIJACKING dmesg
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_peer()
|
|
||||||
{
|
|
||||||
export RUMP_SERVER=$SOCKPEER
|
|
||||||
rump.netstat -nr
|
|
||||||
rump.arp -n -a
|
|
||||||
rump.ifconfig
|
|
||||||
$HIJACKING dmesg
|
|
||||||
}
|
|
||||||
|
|
||||||
dump()
|
|
||||||
{
|
|
||||||
dump_local
|
|
||||||
dump_peer
|
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r -
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dad_basic_cleanup()
|
dad_basic_cleanup()
|
||||||
{
|
{
|
||||||
$DEBUG && dump_local
|
$DEBUG && dump
|
||||||
$DEBUG && shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r -
|
cleanup
|
||||||
env RUMP_SERVER=$SOCKLOCAL rump.halt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dad_duplicated_cleanup()
|
dad_duplicated_cleanup()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_icmp6_redirect.sh,v 1.2 2016/08/10 22:17:44 kre Exp $
|
# $NetBSD: t_icmp6_redirect.sh,v 1.7 2016/11/25 08:51:16 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -24,8 +24,6 @@
|
|||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
netserver="rump_server -lrumpnet -lrumpnet_net -lrumpnet_shmif"
|
|
||||||
netserver="${netserver} -lrumpnet_netinet -lrumpnet_netinet6 -lrumpdev"
|
|
||||||
|
|
||||||
SOCK_LOCAL=unix://commsock1
|
SOCK_LOCAL=unix://commsock1
|
||||||
SOCK_PEER=unix://commsock2
|
SOCK_PEER=unix://commsock2
|
||||||
@ -44,50 +42,38 @@ IP6IF0_GW2=fc00:1::3
|
|||||||
|
|
||||||
REDIRECT_TIMEOUT=5
|
REDIRECT_TIMEOUT=5
|
||||||
|
|
||||||
DEBUG=true
|
DEBUG=${DEBUG:-true}
|
||||||
|
|
||||||
get_lladdr()
|
atf_test_case icmp6_redirect_basic cleanup
|
||||||
{
|
|
||||||
|
|
||||||
export RUMP_SERVER=${1}
|
icmp6_redirect_basic_head()
|
||||||
rump.ifconfig ${2} inet6 | awk "/fe80/ {sub(/%$2/, \"\"); print \$2;}"
|
|
||||||
unset RUMP_SERVER
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
atf_test_case basic cleanup
|
|
||||||
|
|
||||||
basic_head()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_set "descr" "Test for the basically function of the ICMP6 redirect"
|
atf_set "descr" "Test for the basically function of the ICMP6 redirect"
|
||||||
atf_set "require.progs" "rump_server rump.route rump.ping rump.ifconfig"
|
atf_set "require.progs" "rump_server rump.route rump.ping rump.ifconfig"
|
||||||
}
|
}
|
||||||
|
|
||||||
basic_body()
|
icmp6_redirect_basic_body()
|
||||||
{
|
{
|
||||||
local gw1_lladdr0=
|
local gw1_lladdr0=
|
||||||
local gw1_lladdr1=
|
local gw1_lladdr1=
|
||||||
local gw2_lladdr0=
|
local gw2_lladdr0=
|
||||||
|
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_LOCAL}
|
rump_server_start $SOCK_LOCAL netinet6
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_PEER}
|
rump_server_start $SOCK_PEER netinet6
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_GW1}
|
rump_server_start $SOCK_GW1 netinet6
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_GW2}
|
rump_server_start $SOCK_GW2 netinet6
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup
|
# Setup
|
||||||
#
|
#
|
||||||
# Setup gateway #1 (real gateway)
|
# Setup gateway #1 (real gateway)
|
||||||
export RUMP_SERVER=${SOCK_GW1}
|
export RUMP_SERVER=${SOCK_GW1}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $SOCK_GW1 shmif0 $BUS1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${BUS1}
|
rump_server_add_iface $SOCK_GW1 shmif1 $BUS2
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6IF0_GW1}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6IF0_GW1}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 linkstr ${BUS2}
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6IF1_GW1}
|
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6IF1_GW1}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 up
|
atf_check -s exit:0 rump.ifconfig shmif1 up
|
||||||
|
|
||||||
@ -95,13 +81,12 @@ basic_body()
|
|||||||
net.inet6.ip6.forwarding=1
|
net.inet6.ip6.forwarding=1
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
gw1_lladdr0=`get_lladdr ${SOCK_GW1} shmif0`
|
gw1_lladdr0=`get_linklocal_addr ${SOCK_GW1} shmif0`
|
||||||
gw1_lladdr1=`get_lladdr ${SOCK_GW1} shmif1`
|
gw1_lladdr1=`get_linklocal_addr ${SOCK_GW1} shmif1`
|
||||||
|
|
||||||
# Setup a peer behind gateway #1
|
# Setup a peer behind gateway #1
|
||||||
export RUMP_SERVER=${SOCK_PEER}
|
export RUMP_SERVER=${SOCK_PEER}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $SOCK_PEER shmif0 $BUS2
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${BUS2}
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6IF0_PEER}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6IF0_PEER}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 -o ignore rump.route add \
|
atf_check -s exit:0 -o ignore rump.route add \
|
||||||
@ -110,8 +95,7 @@ basic_body()
|
|||||||
|
|
||||||
# Setup gateway #2 (fake gateway)
|
# Setup gateway #2 (fake gateway)
|
||||||
export RUMP_SERVER=${SOCK_GW2}
|
export RUMP_SERVER=${SOCK_GW2}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $SOCK_GW2 shmif0 $BUS1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${BUS1}
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6IF0_GW2}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6IF0_GW2}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
|
||||||
@ -121,11 +105,10 @@ basic_body()
|
|||||||
net.inet6.ip6.forwarding=1
|
net.inet6.ip6.forwarding=1
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
gw2_lladdr0=`get_lladdr ${SOCK_GW2} shmif0`
|
gw2_lladdr0=`get_linklocal_addr ${SOCK_GW2} shmif0`
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCK_LOCAL}
|
export RUMP_SERVER=${SOCK_LOCAL}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${BUS1}
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6IF0_LOCAL}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6IF0_LOCAL}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
|
||||||
@ -152,20 +135,18 @@ basic_body()
|
|||||||
atf_check -s exit:0 -o not-match:"gateway: ${gw1_lladdr0}" rump.route get \
|
atf_check -s exit:0 -o not-match:"gateway: ${gw1_lladdr0}" rump.route get \
|
||||||
-inet6 ${IP6IF0_PEER}
|
-inet6 ${IP6IF0_PEER}
|
||||||
|
|
||||||
unset RUMP_SERVER
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
basic_cleanup()
|
icmp6_redirect_basic_cleanup()
|
||||||
{
|
{
|
||||||
|
|
||||||
env RUMP_SERVER=$SOCK_LOCAL rump.halt
|
$DEBUG && dump
|
||||||
env RUMP_SERVER=$SOCK_PEER rump.halt
|
cleanup
|
||||||
env RUMP_SERVER=$SOCK_GW1 rump.halt
|
|
||||||
env RUMP_SERVER=$SOCK_GW2 rump.halt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_init_test_cases()
|
atf_init_test_cases()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_add_test_case basic
|
atf_add_test_case icmp6_redirect_basic
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_icmp_redirect.sh,v 1.3 2016/08/10 22:17:44 kre Exp $
|
# $NetBSD: t_icmp_redirect.sh,v 1.6 2016/11/25 08:51:16 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
# Most codes are derived from tests/net/route/t_flags.sh
|
# Most codes are derived from tests/net/route/t_flags.sh
|
||||||
|
|
||||||
netserver=\
|
|
||||||
"rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpdev"
|
|
||||||
SOCK_LOCAL=unix://commsock1
|
SOCK_LOCAL=unix://commsock1
|
||||||
SOCK_PEER=unix://commsock2
|
SOCK_PEER=unix://commsock2
|
||||||
SOCK_GW=unix://commsock3
|
SOCK_GW=unix://commsock3
|
||||||
@ -36,7 +34,7 @@ BUS=bus1
|
|||||||
BUS2=bus2
|
BUS2=bus2
|
||||||
REDIRECT_TIMEOUT=5
|
REDIRECT_TIMEOUT=5
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
atf_test_case icmp_redirect_timeout cleanup
|
atf_test_case icmp_redirect_timeout cleanup
|
||||||
|
|
||||||
@ -50,11 +48,10 @@ icmp_redirect_timeout_head()
|
|||||||
setup_local()
|
setup_local()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_LOCAL}
|
rump_server_start $SOCK_LOCAL
|
||||||
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.2/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.2/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
|
||||||
@ -68,11 +65,10 @@ setup_local()
|
|||||||
setup_peer()
|
setup_peer()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_PEER}
|
rump_server_start $SOCK_PEER
|
||||||
|
rump_server_add_iface $SOCK_PEER shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.1/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.1/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
|
||||||
@ -83,16 +79,14 @@ setup_peer()
|
|||||||
setup_gw()
|
setup_gw()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_GW}
|
rump_server_start $SOCK_GW
|
||||||
|
rump_server_add_iface $SOCK_GW shmif0 $BUS
|
||||||
|
rump_server_add_iface $SOCK_GW shmif1 $BUS2
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_GW
|
export RUMP_SERVER=$SOCK_GW
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.254/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.254/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 linkstr ${BUS2}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 10.0.2.1/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 10.0.2.1/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 alias 10.0.2.2/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 alias 10.0.2.2/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 up
|
||||||
@ -105,39 +99,6 @@ setup_gw()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown_gw()
|
|
||||||
{
|
|
||||||
|
|
||||||
env RUMP_SERVER=$SOCK_GW rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_flags()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local flags=$2
|
|
||||||
|
|
||||||
atf_check -s exit:0 -o match:" $flags " -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_gw()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local gw=$2
|
|
||||||
|
|
||||||
atf_check -s exit:0 -o match:" $gw " -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_fail()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local flags=$2 # Not used currently
|
|
||||||
|
|
||||||
atf_check -s not-exit:0 -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
icmp_redirect_timeout_body()
|
icmp_redirect_timeout_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -159,7 +120,7 @@ icmp_redirect_timeout_body()
|
|||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
atf_check -s exit:0 -o ignore rump.route add -net 10.0.2.0/24 10.0.0.254
|
atf_check -s exit:0 -o ignore rump.route add -net 10.0.2.0/24 10.0.0.254
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags 10.0.2/24 UGS
|
check_route_flags 10.0.2/24 UGS
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup the default gateway to the peer, 10.0.0.1
|
# Setup the default gateway to the peer, 10.0.0.1
|
||||||
@ -167,39 +128,25 @@ icmp_redirect_timeout_body()
|
|||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.route add default 10.0.0.1
|
atf_check -s exit:0 -o ignore rump.route add default 10.0.0.1
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags default UGS
|
check_route_flags default UGS
|
||||||
|
|
||||||
# Try ping 10.0.2.1
|
# Try ping 10.0.2.1
|
||||||
atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 10.0.2.1
|
atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 10.0.2.1
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Host, Dynamic
|
# Up, Gateway, Host, Dynamic
|
||||||
check_entry_flags 10.0.2.1 UGHD
|
check_route_flags 10.0.2.1 UGHD
|
||||||
check_entry_gw 10.0.2.1 10.0.0.254
|
check_route_gw 10.0.2.1 10.0.0.254
|
||||||
|
|
||||||
atf_check -s exit:0 sleep $((REDIRECT_TIMEOUT + 2))
|
atf_check -s exit:0 sleep $((REDIRECT_TIMEOUT + 2))
|
||||||
|
|
||||||
# The dynamic entry should be expired and removed
|
# The dynamic entry should be expired and removed
|
||||||
check_entry_fail 10.0.2.1
|
check_route_no_entry 10.0.2.1
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
teardown_gw
|
rump_server_destroy_ifaces
|
||||||
}
|
|
||||||
|
|
||||||
dump()
|
|
||||||
{
|
|
||||||
|
|
||||||
shmif_dumpbus -p - $BUS 2>/dev/null | tcpdump -n -e -r -
|
|
||||||
gdb -ex bt /usr/bin/rump_server rump_server.core
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup()
|
|
||||||
{
|
|
||||||
|
|
||||||
env RUMP_SERVER=$SOCK_LOCAL rump.halt
|
|
||||||
env RUMP_SERVER=$SOCK_PEER rump.halt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
icmp_redirect_timeout_cleanup()
|
icmp_redirect_timeout_cleanup()
|
||||||
@ -249,7 +196,7 @@ icmp_redirect_body()
|
|||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
atf_check -s exit:0 -o ignore rump.route add -net 10.0.2.0/24 10.0.0.254
|
atf_check -s exit:0 -o ignore rump.route add -net 10.0.2.0/24 10.0.0.254
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags 10.0.2/24 UGS
|
check_route_flags 10.0.2/24 UGS
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup the default gateway to the peer, 10.0.0.1
|
# Setup the default gateway to the peer, 10.0.0.1
|
||||||
@ -257,7 +204,7 @@ icmp_redirect_body()
|
|||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.route add default 10.0.0.1
|
atf_check -s exit:0 -o ignore rump.route add default 10.0.0.1
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags default UGS
|
check_route_flags default UGS
|
||||||
|
|
||||||
|
|
||||||
### ICMP redirects are NOT sent by the peer ###
|
### ICMP redirects are NOT sent by the peer ###
|
||||||
@ -274,7 +221,7 @@ icmp_redirect_body()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# A direct route shouldn't be created
|
# A direct route shouldn't be created
|
||||||
check_entry_fail 10.0.2.1
|
check_route_no_entry 10.0.2.1
|
||||||
|
|
||||||
|
|
||||||
### ICMP redirects are sent by the peer ###
|
### ICMP redirects are sent by the peer ###
|
||||||
@ -291,8 +238,8 @@ icmp_redirect_body()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Host, Dynamic
|
# Up, Gateway, Host, Dynamic
|
||||||
check_entry_flags 10.0.2.1 UGHD
|
check_route_flags 10.0.2.1 UGHD
|
||||||
check_entry_gw 10.0.2.1 10.0.0.254
|
check_route_gw 10.0.2.1 10.0.0.254
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
@ -301,7 +248,7 @@ icmp_redirect_body()
|
|||||||
# cleanup
|
# cleanup
|
||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.route delete 10.0.2.1
|
atf_check -s exit:0 -o ignore rump.route delete 10.0.2.1
|
||||||
check_entry_fail 10.0.2.1
|
check_route_no_entry 10.0.2.1
|
||||||
|
|
||||||
|
|
||||||
### ICMP redirects are NOT sent by the peer (again) ###
|
### ICMP redirects are NOT sent by the peer (again) ###
|
||||||
@ -318,10 +265,9 @@ icmp_redirect_body()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# A direct route shouldn't be created
|
# A direct route shouldn't be created
|
||||||
check_entry_fail 10.0.2.1
|
check_route_no_entry 10.0.2.1
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
teardown_gw
|
|
||||||
}
|
}
|
||||||
|
|
||||||
icmp_redirect_cleanup()
|
icmp_redirect_cleanup()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_compat.c,v 1.1 2010/11/07 19:53:42 pooka Exp $ */
|
/* $NetBSD: t_compat.c,v 1.4 2016/11/12 15:12:59 kre Exp $ */
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
@ -65,6 +65,8 @@ ATF_TC_BODY(OOSIOCGIFBRDADDR, tc)
|
|||||||
sprintf(ifreq.ifr_name, "shmif%d", ifnum);
|
sprintf(ifreq.ifr_name, "shmif%d", ifnum);
|
||||||
netcfg_rump_if(ifreq.ifr_name, "1.7.64.10", "255.255.0.0");
|
netcfg_rump_if(ifreq.ifr_name, "1.7.64.10", "255.255.0.0");
|
||||||
|
|
||||||
|
atf_tc_expect_fail("PR kern/51610: rump does not include COMPAT_43");
|
||||||
|
|
||||||
/* query kernel for iface bcast */
|
/* query kernel for iface bcast */
|
||||||
RL(fd = rump_sys_socket(AF_INET, SOCK_DGRAM, 0));
|
RL(fd = rump_sys_socket(AF_INET, SOCK_DGRAM, 0));
|
||||||
RL(rump_sys_ioctl(fd, OOSIOCGIFBRDADDR, &ifreq));
|
RL(rump_sys_ioctl(fd, OOSIOCGIFBRDADDR, &ifreq));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_ifconfig.sh,v 1.11 2016/08/10 22:30:02 kre Exp $
|
# $NetBSD: t_ifconfig.sh,v 1.14 2016/10/01 22:15:04 kre Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -34,6 +34,9 @@ RUMP_FLAGS="${RUMP_FLAGS} -lrumpdev"
|
|||||||
|
|
||||||
TIMEOUT=3
|
TIMEOUT=3
|
||||||
|
|
||||||
|
anycast="[Aa][Nn][Yy][Cc][Aa][Ss][Tt]"
|
||||||
|
deprecated="[Dd][Ee][Pp][Rr][Ee][Cc][Aa][Tt][Ee][Dd]"
|
||||||
|
|
||||||
atf_test_case ifconfig_create_destroy cleanup
|
atf_test_case ifconfig_create_destroy cleanup
|
||||||
ifconfig_create_destroy_head()
|
ifconfig_create_destroy_head()
|
||||||
{
|
{
|
||||||
@ -227,16 +230,17 @@ ifconfig_parameters_body()
|
|||||||
rump.ifconfig shmif0
|
rump.ifconfig shmif0
|
||||||
# down, up
|
# down, up
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 down
|
atf_check -s exit:0 rump.ifconfig shmif0 down
|
||||||
atf_check -s ignore -o ignore -e match:'down' rump.ping -c 1 \
|
atf_check -s not-exit:0 -o ignore -e ignore rump.ping -c 1 \
|
||||||
-w $TIMEOUT -n 192.168.0.2
|
-w $TIMEOUT -n 192.168.0.2
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT -n 192.168.0.2
|
atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT -n 192.168.0.2
|
||||||
|
|
||||||
# alias
|
# alias
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 alias
|
atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 alias
|
||||||
atf_check -s exit:0 -o match:'alias 192.168.1.1' rump.ifconfig shmif0
|
atf_check -s exit:0 -o match:'192.168.1.1/24' rump.ifconfig shmif0
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 -alias
|
atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 -alias
|
||||||
atf_check -s exit:0 -o not-match:'192.168.1.1' rump.ifconfig shmif0
|
atf_check -s exit:0 -o not-match:'192.168.1.1/24' rump.ifconfig shmif0
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2
|
||||||
atf_check -s exit:0 -o match:'fc00::1' rump.ifconfig shmif0 inet6
|
atf_check -s exit:0 -o match:'fc00::1' rump.ifconfig shmif0 inet6
|
||||||
@ -290,22 +294,22 @@ ifconfig_parameters_body()
|
|||||||
|
|
||||||
# anycast
|
# anycast
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 anycast
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 anycast
|
||||||
atf_check -s exit:0 -o match:'fc00::2.+anycast' rump.ifconfig shmif0 inet6
|
atf_check -s exit:0 -o match:"fc00::2.+$anycast" rump.ifconfig shmif0 inet6
|
||||||
|
|
||||||
# deprecated
|
# deprecated
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 deprecated
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 deprecated
|
||||||
# Not deprecated immediately. Need to wait nd6_timer that does it is scheduled.
|
# Not deprecated immediately. Need to wait nd6_timer that does it is scheduled.
|
||||||
interval=$(sysctl -n net.inet6.icmp6.nd6_prune)
|
interval=$(sysctl -n net.inet6.icmp6.nd6_prune)
|
||||||
atf_check -s exit:0 sleep $((interval + 1))
|
atf_check -s exit:0 sleep $((interval + 1))
|
||||||
atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
|
atf_check -s exit:0 -o match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 -deprecated
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 -deprecated
|
||||||
atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
|
atf_check -s exit:0 -o not-match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
|
||||||
|
|
||||||
# pltime
|
# pltime
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 pltime 3
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 pltime 3
|
||||||
atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
|
atf_check -s exit:0 -o not-match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
|
||||||
atf_check -s exit:0 sleep 5
|
atf_check -s exit:0 sleep 5
|
||||||
atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
|
atf_check -s exit:0 -o match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
|
||||||
|
|
||||||
# eui64
|
# eui64
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00:1::0 eui64
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00:1::0 eui64
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_bridge.sh,v 1.13 2016/08/10 22:37:07 kre Exp $
|
# $NetBSD: t_bridge.sh,v 1.16 2016/11/25 08:51:16 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2014 The NetBSD Foundation, Inc.
|
# Copyright (c) 2014 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,13 +25,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
libs1="-lrumpnet -lrumpnet_net -lrumpnet_netinet"
|
|
||||||
libs2="-lrumpnet_bridge -lrumpnet_shmif -lrumpdev"
|
|
||||||
libs6="-lrumpnet_netinet6"
|
|
||||||
|
|
||||||
inetserver="rump_server ${libs1} ${libs2}"
|
|
||||||
inet6server="rump_server ${libs1} ${libs6} ${libs2}"
|
|
||||||
|
|
||||||
SOCK1=unix://commsock1
|
SOCK1=unix://commsock1
|
||||||
SOCK2=unix://commsock2
|
SOCK2=unix://commsock2
|
||||||
SOCK3=unix://commsock3
|
SOCK3=unix://commsock3
|
||||||
@ -44,6 +37,7 @@ IPBR2=10.0.0.12
|
|||||||
IP6BR1=fc00::11
|
IP6BR1=fc00::11
|
||||||
IP6BR2=fc00::12
|
IP6BR2=fc00::12
|
||||||
|
|
||||||
|
DEBUG=${DEBUG:-false}
|
||||||
TIMEOUT=5
|
TIMEOUT=5
|
||||||
|
|
||||||
atf_test_case bridge_ipv4 cleanup
|
atf_test_case bridge_ipv4 cleanup
|
||||||
@ -89,9 +83,8 @@ setup_endpoint()
|
|||||||
bus=${3}
|
bus=${3}
|
||||||
mode=${4}
|
mode=${4}
|
||||||
|
|
||||||
|
rump_server_add_iface $sock shmif0 $bus
|
||||||
export RUMP_SERVER=${sock}
|
export RUMP_SERVER=${sock}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${bus}
|
|
||||||
if [ $mode = "ipv6" ]; then
|
if [ $mode = "ipv6" ]; then
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${addr}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${addr}
|
||||||
else
|
else
|
||||||
@ -99,7 +92,7 @@ setup_endpoint()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
rump.ifconfig shmif0
|
$DEBUG && rump.ifconfig shmif0
|
||||||
}
|
}
|
||||||
|
|
||||||
test_endpoint()
|
test_endpoint()
|
||||||
@ -118,14 +111,6 @@ test_endpoint()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
show_endpoint()
|
|
||||||
{
|
|
||||||
sock=${1}
|
|
||||||
|
|
||||||
export RUMP_SERVER=${sock}
|
|
||||||
rump.ifconfig -v shmif0
|
|
||||||
}
|
|
||||||
|
|
||||||
test_setup()
|
test_setup()
|
||||||
{
|
{
|
||||||
test_endpoint $SOCK1 $IP1 bus1 ipv4
|
test_endpoint $SOCK1 $IP1 bus1 ipv4
|
||||||
@ -148,21 +133,20 @@ test_setup6()
|
|||||||
|
|
||||||
setup_bridge_server()
|
setup_bridge_server()
|
||||||
{
|
{
|
||||||
export RUMP_SERVER=$SOCK2
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 create
|
rump_server_add_iface $SOCK2 shmif0 bus1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 linkstr bus2
|
rump_server_add_iface $SOCK2 shmif1 bus2
|
||||||
|
export RUMP_SERVER=$SOCK2
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 up
|
atf_check -s exit:0 rump.ifconfig shmif1 up
|
||||||
}
|
}
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 ${inetserver} $SOCK1
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCK2
|
rump_server_start $SOCK1 bridge
|
||||||
atf_check -s exit:0 ${inetserver} $SOCK3
|
rump_server_start $SOCK2 bridge
|
||||||
|
rump_server_start $SOCK3 bridge
|
||||||
|
|
||||||
setup_endpoint $SOCK1 $IP1 bus1 ipv4
|
setup_endpoint $SOCK1 $IP1 bus1 ipv4
|
||||||
setup_endpoint $SOCK3 $IP2 bus2 ipv4
|
setup_endpoint $SOCK3 $IP2 bus2 ipv4
|
||||||
@ -171,9 +155,10 @@ setup()
|
|||||||
|
|
||||||
setup6()
|
setup6()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 ${inet6server} $SOCK1
|
|
||||||
atf_check -s exit:0 ${inet6server} $SOCK2
|
rump_server_start $SOCK1 netinet6 bridge
|
||||||
atf_check -s exit:0 ${inet6server} $SOCK3
|
rump_server_start $SOCK2 netinet6 bridge
|
||||||
|
rump_server_start $SOCK3 netinet6 bridge
|
||||||
|
|
||||||
setup_endpoint $SOCK1 $IP61 bus1 ipv6
|
setup_endpoint $SOCK1 $IP61 bus1 ipv6
|
||||||
setup_endpoint $SOCK3 $IP62 bus2 ipv6
|
setup_endpoint $SOCK3 $IP62 bus2 ipv6
|
||||||
@ -244,19 +229,6 @@ test_setup_bridge()
|
|||||||
unset LD_PRELOAD
|
unset LD_PRELOAD
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCK1 rump.halt
|
|
||||||
env RUMP_SERVER=$SOCK2 rump.halt
|
|
||||||
env RUMP_SERVER=$SOCK3 rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_bus()
|
|
||||||
{
|
|
||||||
/usr/bin/shmif_dumpbus -p - bus1 2>/dev/null| /usr/sbin/tcpdump -n -e -r -
|
|
||||||
/usr/bin/shmif_dumpbus -p - bus2 2>/dev/null| /usr/sbin/tcpdump -n -e -r -
|
|
||||||
}
|
|
||||||
|
|
||||||
down_up_interfaces()
|
down_up_interfaces()
|
||||||
{
|
{
|
||||||
export RUMP_SERVER=$SOCK1
|
export RUMP_SERVER=$SOCK1
|
||||||
@ -360,11 +332,8 @@ test_brconfig_maxaddr()
|
|||||||
addr1= addr3= n=
|
addr1= addr3= n=
|
||||||
|
|
||||||
# Get MAC addresses of the endpoints.
|
# Get MAC addresses of the endpoints.
|
||||||
export RUMP_SERVER=$SOCK1
|
addr1=$(get_macaddr $SOCK1 shmif0)
|
||||||
addr1=$(rump.ifconfig shmif0 |awk '/address:/ { print $2;}')
|
addr3=$(get_macaddr $SOCK3 shmif0)
|
||||||
export RUMP_SERVER=$SOCK3
|
|
||||||
addr3=$(rump.ifconfig shmif0 |awk '/address:/ { print $2;}')
|
|
||||||
unset RUMP_SERVER
|
|
||||||
|
|
||||||
# Refill the MAC addresses of the endpoints.
|
# Refill the MAC addresses of the endpoints.
|
||||||
export RUMP_SERVER=$SOCK1
|
export RUMP_SERVER=$SOCK1
|
||||||
@ -422,6 +391,8 @@ bridge_ipv4_body()
|
|||||||
|
|
||||||
teardown_bridge
|
teardown_bridge
|
||||||
test_ping_failure
|
test_ping_failure
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_ipv6_body()
|
bridge_ipv6_body()
|
||||||
@ -438,6 +409,8 @@ bridge_ipv6_body()
|
|||||||
|
|
||||||
teardown_bridge
|
teardown_bridge
|
||||||
test_ping6_failure
|
test_ping6_failure
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_rtable_body()
|
bridge_rtable_body()
|
||||||
@ -448,16 +421,13 @@ bridge_rtable_body()
|
|||||||
setup_bridge
|
setup_bridge
|
||||||
|
|
||||||
# Get MAC addresses of the endpoints.
|
# Get MAC addresses of the endpoints.
|
||||||
export RUMP_SERVER=$SOCK1
|
addr1=$(get_macaddr $SOCK1 shmif0)
|
||||||
addr1=$(rump.ifconfig shmif0 |awk '/address:/ { print $2;}')
|
addr3=$(get_macaddr $SOCK3 shmif0)
|
||||||
export RUMP_SERVER=$SOCK3
|
|
||||||
addr3=$(rump.ifconfig shmif0 |awk '/address:/ { print $2;}')
|
|
||||||
unset RUMP_SERVER
|
|
||||||
|
|
||||||
# Confirm there is no MAC address caches.
|
# Confirm there is no MAC address caches.
|
||||||
export RUMP_SERVER=$SOCK2
|
export RUMP_SERVER=$SOCK2
|
||||||
export LD_PRELOAD=/usr/lib/librumphijack.so
|
export LD_PRELOAD=/usr/lib/librumphijack.so
|
||||||
/sbin/brconfig bridge0
|
$DEBUG && /sbin/brconfig bridge0
|
||||||
atf_check -s exit:0 -o not-match:"$addr1" /sbin/brconfig bridge0
|
atf_check -s exit:0 -o not-match:"$addr1" /sbin/brconfig bridge0
|
||||||
atf_check -s exit:0 -o not-match:"$addr3" /sbin/brconfig bridge0
|
atf_check -s exit:0 -o not-match:"$addr3" /sbin/brconfig bridge0
|
||||||
unset LD_PRELOAD
|
unset LD_PRELOAD
|
||||||
@ -470,7 +440,7 @@ bridge_rtable_body()
|
|||||||
# Tests the addresses are in the cache.
|
# Tests the addresses are in the cache.
|
||||||
export RUMP_SERVER=$SOCK2
|
export RUMP_SERVER=$SOCK2
|
||||||
export LD_PRELOAD=/usr/lib/librumphijack.so
|
export LD_PRELOAD=/usr/lib/librumphijack.so
|
||||||
/sbin/brconfig bridge0
|
$DEBUG && /sbin/brconfig bridge0
|
||||||
atf_check -s exit:0 -o match:"$addr1 shmif0" /sbin/brconfig bridge0
|
atf_check -s exit:0 -o match:"$addr1 shmif0" /sbin/brconfig bridge0
|
||||||
atf_check -s exit:0 -o match:"$addr3 shmif1" /sbin/brconfig bridge0
|
atf_check -s exit:0 -o match:"$addr3 shmif1" /sbin/brconfig bridge0
|
||||||
|
|
||||||
@ -487,7 +457,7 @@ bridge_rtable_body()
|
|||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
export RUMP_SERVER=$SOCK2
|
export RUMP_SERVER=$SOCK2
|
||||||
export LD_PRELOAD=/usr/lib/librumphijack.so
|
export LD_PRELOAD=/usr/lib/librumphijack.so
|
||||||
/sbin/brconfig bridge0
|
$DEBUG && /sbin/brconfig bridge0
|
||||||
atf_check -s exit:0 -o match:"$addr1 shmif0" /sbin/brconfig bridge0
|
atf_check -s exit:0 -o match:"$addr1 shmif0" /sbin/brconfig bridge0
|
||||||
atf_check -s exit:0 -o match:"$addr3 shmif1" /sbin/brconfig bridge0
|
atf_check -s exit:0 -o match:"$addr3 shmif1" /sbin/brconfig bridge0
|
||||||
|
|
||||||
@ -511,6 +481,8 @@ bridge_rtable_body()
|
|||||||
# TODO: brconfig static/flushall/discover/learn
|
# TODO: brconfig static/flushall/discover/learn
|
||||||
# TODO: cache expiration; it takes 5 minutes at least and we want to
|
# TODO: cache expiration; it takes 5 minutes at least and we want to
|
||||||
# wait here so long. Should we have a sysctl to change the period?
|
# wait here so long. Should we have a sysctl to change the period?
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_member_ipv4_body()
|
bridge_member_ipv4_body()
|
||||||
@ -531,6 +503,8 @@ bridge_member_ipv4_body()
|
|||||||
|
|
||||||
teardown_bridge
|
teardown_bridge
|
||||||
test_ping_failure
|
test_ping_failure
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_member_ipv6_body()
|
bridge_member_ipv6_body()
|
||||||
@ -550,35 +524,42 @@ bridge_member_ipv6_body()
|
|||||||
|
|
||||||
teardown_bridge
|
teardown_bridge
|
||||||
test_ping6_failure
|
test_ping6_failure
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_ipv4_cleanup()
|
bridge_ipv4_cleanup()
|
||||||
{
|
{
|
||||||
dump_bus
|
|
||||||
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_ipv6_cleanup()
|
bridge_ipv6_cleanup()
|
||||||
{
|
{
|
||||||
dump_bus
|
|
||||||
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_rtable_cleanup()
|
bridge_rtable_cleanup()
|
||||||
{
|
{
|
||||||
dump_bus
|
|
||||||
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_member_ipv4_cleanup()
|
bridge_member_ipv4_cleanup()
|
||||||
{
|
{
|
||||||
dump_bus
|
|
||||||
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_member_ipv6_cleanup()
|
bridge_member_ipv6_cleanup()
|
||||||
{
|
{
|
||||||
dump_bus
|
|
||||||
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_gif.sh,v 1.5 2016/08/10 08:29:20 ozaki-r Exp $
|
# $NetBSD: t_gif.sh,v 1.9 2016/12/21 09:46:39 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,10 +25,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
server="rump_server -v -lrumpdev -lrumpnet -lrumpnet_net -lrumpnet_netinet \
|
|
||||||
-lrumpnet_netinet6 -lrumpnet_shmif -lrumpnet_gif"
|
|
||||||
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=sysctl=yes"
|
|
||||||
|
|
||||||
SOCK1=unix://commsock1 # for ROUTER1
|
SOCK1=unix://commsock1 # for ROUTER1
|
||||||
SOCK2=unix://commsock2 # for ROUTER2
|
SOCK2=unix://commsock2 # for ROUTER2
|
||||||
ROUTER1_LANIP=192.168.1.1
|
ROUTER1_LANIP=192.168.1.1
|
||||||
@ -65,6 +61,7 @@ ROUTER2_GIFIP6_DUMMY=fc00:14::1
|
|||||||
ROUTER2_GIFIP6_RECURSIVE1=fc00:104::1
|
ROUTER2_GIFIP6_RECURSIVE1=fc00:104::1
|
||||||
ROUTER2_GIFIP6_RECURSIVE2=fc00:204::1
|
ROUTER2_GIFIP6_RECURSIVE2=fc00:204::1
|
||||||
|
|
||||||
|
DEBUG=${DEBUG:-true}
|
||||||
TIMEOUT=5
|
TIMEOUT=5
|
||||||
|
|
||||||
setup_router()
|
setup_router()
|
||||||
@ -75,9 +72,10 @@ setup_router()
|
|||||||
wan=${4}
|
wan=${4}
|
||||||
wan_mode=${5}
|
wan_mode=${5}
|
||||||
|
|
||||||
|
rump_server_add_iface $sock shmif0 bus0
|
||||||
|
rump_server_add_iface $sock shmif1 bus1
|
||||||
|
|
||||||
export RUMP_SERVER=${sock}
|
export RUMP_SERVER=${sock}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus0
|
|
||||||
if [ ${lan_mode} = "ipv6" ]; then
|
if [ ${lan_mode} = "ipv6" ]; then
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${lan}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${lan}
|
||||||
else
|
else
|
||||||
@ -86,8 +84,6 @@ setup_router()
|
|||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
rump.ifconfig shmif0
|
rump.ifconfig shmif0
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 linkstr bus1
|
|
||||||
if [ ${wan_mode} = "ipv6" ]; then
|
if [ ${wan_mode} = "ipv6" ]; then
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${wan}
|
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${wan}
|
||||||
else
|
else
|
||||||
@ -126,8 +122,8 @@ setup()
|
|||||||
inner=${1}
|
inner=${1}
|
||||||
outer=${2}
|
outer=${2}
|
||||||
|
|
||||||
atf_check -s exit:0 ${server} $SOCK1
|
rump_server_start $SOCK1 netinet6 gif
|
||||||
atf_check -s exit:0 ${server} $SOCK2
|
rump_server_start $SOCK2 netinet6 gif
|
||||||
|
|
||||||
router1_lan=""
|
router1_lan=""
|
||||||
router1_lan_mode=""
|
router1_lan_mode=""
|
||||||
@ -482,18 +478,6 @@ teardown_recursive_tunnels()
|
|||||||
atf_check -s exit:0 rump.ifconfig gif2 destroy
|
atf_check -s exit:0 rump.ifconfig gif2 destroy
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCK1 rump.halt
|
|
||||||
env RUMP_SERVER=$SOCK2 rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_bus()
|
|
||||||
{
|
|
||||||
/usr/bin/shmif_dumpbus -p - bus0 2>/dev/null| /usr/sbin/tcpdump -n -e -r -
|
|
||||||
/usr/bin/shmif_dumpbus -p - bus1 2>/dev/null| /usr/sbin/tcpdump -n -e -r -
|
|
||||||
}
|
|
||||||
|
|
||||||
test_ping_failure()
|
test_ping_failure()
|
||||||
{
|
{
|
||||||
mode=$1
|
mode=$1
|
||||||
@ -739,7 +723,7 @@ add_test()
|
|||||||
inner=$3
|
inner=$3
|
||||||
outer=$4
|
outer=$4
|
||||||
|
|
||||||
name="${category}${inner}over${outer}"
|
name="gif_${category}_${inner}over${outer}"
|
||||||
fulldesc="Does ${inner} over ${outer} if_gif ${desc}"
|
fulldesc="Does ${inner} over ${outer} if_gif ${desc}"
|
||||||
|
|
||||||
atf_test_case ${name} cleanup
|
atf_test_case ${name} cleanup
|
||||||
@ -751,9 +735,10 @@ add_test()
|
|||||||
${category}_setup ${inner} ${outer}; \
|
${category}_setup ${inner} ${outer}; \
|
||||||
${category}_test ${inner} ${outer}; \
|
${category}_test ${inner} ${outer}; \
|
||||||
${category}_teardown ${inner} ${outer}; \
|
${category}_teardown ${inner} ${outer}; \
|
||||||
|
rump_server_destroy_ifaces; \
|
||||||
}; \
|
}; \
|
||||||
${name}_cleanup() { \
|
${name}_cleanup() { \
|
||||||
dump_bus; \
|
$DEBUG && dump; \
|
||||||
cleanup; \
|
cleanup; \
|
||||||
}"
|
}"
|
||||||
atf_add_test_case ${name}
|
atf_add_test_case ${name}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_pppoe.sh,v 1.2 2016/08/07 23:34:31 pgoyette Exp $
|
# $NetBSD: t_pppoe.sh,v 1.16 2016/12/14 03:30:30 knakahara Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -28,6 +28,7 @@
|
|||||||
server="rump_server -lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet \
|
server="rump_server -lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet \
|
||||||
-lrumpnet_netinet6 -lrumpnet_shmif -lrumpdev \
|
-lrumpnet_netinet6 -lrumpnet_shmif -lrumpdev \
|
||||||
-lrumpnet_pppoe"
|
-lrumpnet_pppoe"
|
||||||
|
# pppoectl doesn't work with RUMPHIJACK=sysctl=yes
|
||||||
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so"
|
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so"
|
||||||
|
|
||||||
SERVER=unix://commsock1
|
SERVER=unix://commsock1
|
||||||
@ -35,17 +36,23 @@ CLIENT=unix://commsock2
|
|||||||
|
|
||||||
SERVER_IP=10.3.3.1
|
SERVER_IP=10.3.3.1
|
||||||
CLIENT_IP=10.3.3.3
|
CLIENT_IP=10.3.3.3
|
||||||
|
SERVER_IP6=fc00::1
|
||||||
|
CLIENT_IP6=fc00::3
|
||||||
AUTHNAME=foobar@baz.com
|
AUTHNAME=foobar@baz.com
|
||||||
SECRET=oink
|
SECRET=oink
|
||||||
BUS=bus0
|
BUS=bus0
|
||||||
TIMEOUT=3
|
TIMEOUT=3
|
||||||
WAITTIME=5
|
WAITTIME=10
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
atf_test_case pap cleanup
|
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
|
inet=true
|
||||||
|
|
||||||
|
if [ $# -ne 0 ]; then
|
||||||
|
eval $@
|
||||||
|
fi
|
||||||
|
|
||||||
atf_check -s exit:0 ${server} $SERVER
|
atf_check -s exit:0 ${server} $SERVER
|
||||||
atf_check -s exit:0 ${server} $CLIENT
|
atf_check -s exit:0 ${server} $CLIENT
|
||||||
|
|
||||||
@ -55,7 +62,8 @@ setup()
|
|||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig pppoe0 create
|
atf_check -s exit:0 rump.ifconfig pppoe0 create
|
||||||
atf_check -s exit:0 rump.ifconfig pppoe0 inet $SERVER_IP $CLIENT_IP down
|
$inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
|
||||||
|
inet $SERVER_IP $CLIENT_IP down
|
||||||
atf_check -s exit:0 rump.ifconfig pppoe0 link0
|
atf_check -s exit:0 rump.ifconfig pppoe0 link0
|
||||||
|
|
||||||
$DEBUG && rump.ifconfig
|
$DEBUG && rump.ifconfig
|
||||||
@ -70,22 +78,19 @@ setup()
|
|||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig pppoe0 create
|
atf_check -s exit:0 rump.ifconfig pppoe0 create
|
||||||
atf_check -s exit:0 rump.ifconfig pppoe0 inet 0.0.0.0 0.0.0.1 down
|
$inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
|
||||||
|
inet 0.0.0.0 0.0.0.1 down
|
||||||
|
|
||||||
atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0"
|
atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0"
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
cleanup()
|
||||||
{
|
{
|
||||||
env RUMP_SERVER=$SERVER rump.halt
|
env RUMP_SERVER=$SERVER rump.halt
|
||||||
env RUMP_SERVER=$CLIENT rump.halt
|
env RUMP_SERVER=$CLIENT rump.halt
|
||||||
}
|
}
|
||||||
|
|
||||||
pap_head()
|
|
||||||
{
|
|
||||||
atf_set "descr" "Does simple pap tests"
|
|
||||||
atf_set "require.progs" "rump_server pppoectl"
|
|
||||||
}
|
|
||||||
|
|
||||||
wait_for_session_established()
|
wait_for_session_established()
|
||||||
{
|
{
|
||||||
@ -98,21 +103,50 @@ wait_for_session_established()
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $dontfail != "dontfail" ]; then
|
if [ "$dontfail" != "dontfail" ]; then
|
||||||
atf_fail "Couldn't connect to the server for $n seconds."
|
atf_fail "Couldn't connect to the server for $n seconds."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
pap_body()
|
wait_for_disconnected()
|
||||||
{
|
{
|
||||||
local auth=pap
|
local dontfail=$1
|
||||||
|
local n=$WAITTIME
|
||||||
|
|
||||||
|
for i in $(seq $n); do
|
||||||
|
$HIJACKING pppoectl -d pppoe0 | grep -q "state = initial"
|
||||||
|
[ $? = 0 ] && return
|
||||||
|
# If PPPoE client is disconnected by PPPoE server and then
|
||||||
|
# the client kicks callout of pppoe_timeout(), the client
|
||||||
|
# state is changed to PPPOE_STATE_PADI_SENT while padi retrying.
|
||||||
|
$HIJACKING pppoectl -d pppoe0 | grep -q "state = PADI sent"
|
||||||
|
[ $? = 0 ] && return
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$dontfail" != "dontfail" ]; then
|
||||||
|
atf_fail "Couldn't disconnect for $n seconds."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
run_test()
|
||||||
|
{
|
||||||
|
local auth=$1
|
||||||
setup
|
setup
|
||||||
|
|
||||||
|
# As pppoe client doesn't support rechallenge yet.
|
||||||
|
local server_optparam=""
|
||||||
|
if [ $auth = "chap" ]; then
|
||||||
|
server_optparam="norechallenge"
|
||||||
|
fi
|
||||||
|
|
||||||
export RUMP_SERVER=$SERVER
|
export RUMP_SERVER=$SERVER
|
||||||
local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \
|
local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \
|
||||||
'hisauthname=$AUTHNAME' \
|
'hisauthname=$AUTHNAME' \
|
||||||
'hisauthsecret=$SECRET' \
|
'hisauthsecret=$SECRET' \
|
||||||
'myauthproto=none'"
|
'myauthproto=none' \
|
||||||
|
$server_optparam"
|
||||||
atf_check -s exit:0 -x "$HIJACKING $setup_serverparam"
|
atf_check -s exit:0 -x "$HIJACKING $setup_serverparam"
|
||||||
atf_check -s exit:0 rump.ifconfig pppoe0 up
|
atf_check -s exit:0 rump.ifconfig pppoe0 up
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
@ -130,8 +164,11 @@ pap_body()
|
|||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
# test for disconnection from server
|
# test for disconnection from server
|
||||||
atf_check -s exit:0 -x "env RUMP_SERVER=$SERVER rump.ifconfig pppoe0 down"
|
export RUMP_SERVER=$SERVER
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 down
|
||||||
|
wait_for_disconnected
|
||||||
export RUMP_SERVER=$CLIENT
|
export RUMP_SERVER=$CLIENT
|
||||||
|
wait_for_disconnected
|
||||||
atf_check -s not-exit:0 -o ignore -e ignore \
|
atf_check -s not-exit:0 -o ignore -e ignore \
|
||||||
rump.ping -c 1 -w $TIMEOUT $SERVER_IP
|
rump.ping -c 1 -w $TIMEOUT $SERVER_IP
|
||||||
atf_check -s exit:0 -o match:'PADI sent' -x "$HIJACKING pppoectl -d pppoe0"
|
atf_check -s exit:0 -o match:'PADI sent' -x "$HIJACKING pppoectl -d pppoe0"
|
||||||
@ -145,15 +182,18 @@ pap_body()
|
|||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
# test for disconnection from client
|
# test for disconnection from client
|
||||||
atf_check -s exit:0 -x "env RUMP_SERVER=$CLIENT rump.ifconfig pppoe0 down"
|
export RUMP_SERVER=$CLIENT
|
||||||
|
atf_check -s exit:0 -x rump.ifconfig pppoe0 down
|
||||||
|
wait_for_disconnected
|
||||||
export RUMP_SERVER=$SERVER
|
export RUMP_SERVER=$SERVER
|
||||||
|
wait_for_disconnected
|
||||||
$DEBUG && $HIJACKING pppoectl -d pppoe0
|
$DEBUG && $HIJACKING pppoectl -d pppoe0
|
||||||
atf_check -s not-exit:0 -o ignore -e ignore \
|
atf_check -s not-exit:0 -o ignore -e ignore \
|
||||||
rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
|
rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
|
||||||
atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
|
atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
# test for recconecting
|
# test for reconnecting
|
||||||
export RUMP_SERVER=$CLIENT
|
export RUMP_SERVER=$CLIENT
|
||||||
atf_check -s exit:0 -x rump.ifconfig pppoe0 up
|
atf_check -s exit:0 -x rump.ifconfig pppoe0 up
|
||||||
wait_for_session_established
|
wait_for_session_established
|
||||||
@ -162,6 +202,7 @@ pap_body()
|
|||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
export RUMP_SERVER=$SERVER
|
export RUMP_SERVER=$SERVER
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
|
atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
|
||||||
atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0"
|
atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0"
|
||||||
$DEBUG && HIJACKING pppoectl -d pppoe0
|
$DEBUG && HIJACKING pppoectl -d pppoe0
|
||||||
@ -170,6 +211,7 @@ pap_body()
|
|||||||
# test for invalid password
|
# test for invalid password
|
||||||
export RUMP_SERVER=$CLIENT
|
export RUMP_SERVER=$CLIENT
|
||||||
atf_check -s exit:0 rump.ifconfig pppoe0 down
|
atf_check -s exit:0 rump.ifconfig pppoe0 down
|
||||||
|
wait_for_disconnected
|
||||||
local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
|
local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
|
||||||
'myauthname=$AUTHNAME' \
|
'myauthname=$AUTHNAME' \
|
||||||
'myauthsecret=invalidsecret' \
|
'myauthsecret=invalidsecret' \
|
||||||
@ -179,15 +221,196 @@ pap_body()
|
|||||||
wait_for_session_established dontfail
|
wait_for_session_established dontfail
|
||||||
atf_check -s not-exit:0 -o ignore -e ignore \
|
atf_check -s not-exit:0 -o ignore -e ignore \
|
||||||
rump.ping -c 1 -w $TIMEOUT $SERVER_IP
|
rump.ping -c 1 -w $TIMEOUT $SERVER_IP
|
||||||
atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
|
atf_check -s exit:0 -o match:'DETACHED' rump.ifconfig pppoe0
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
}
|
}
|
||||||
|
|
||||||
pap_cleanup()
|
atf_test_case pppoe_pap cleanup
|
||||||
|
|
||||||
|
pppoe_pap_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" "Does simple pap tests"
|
||||||
|
atf_set "require.progs" "rump_server pppoectl"
|
||||||
|
}
|
||||||
|
|
||||||
|
pppoe_pap_body()
|
||||||
|
{
|
||||||
|
run_test pap
|
||||||
|
}
|
||||||
|
|
||||||
|
pppoe_pap_cleanup()
|
||||||
{
|
{
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atf_test_case pppoe_chap cleanup
|
||||||
|
|
||||||
|
pppoe_chap_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" "Does simple chap tests"
|
||||||
|
atf_set "require.progs" "rump_server pppoectl"
|
||||||
|
}
|
||||||
|
|
||||||
|
pppoe_chap_body()
|
||||||
|
{
|
||||||
|
run_test chap
|
||||||
|
}
|
||||||
|
|
||||||
|
pppoe_chap_cleanup()
|
||||||
|
{
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
run_test6()
|
||||||
|
{
|
||||||
|
local auth=$1
|
||||||
|
setup "inet=false"
|
||||||
|
|
||||||
|
# As pppoe client doesn't support rechallenge yet.
|
||||||
|
local server_optparam=""
|
||||||
|
if [ $auth = "chap" ]; then
|
||||||
|
server_optparam="norechallenge"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SERVER
|
||||||
|
local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \
|
||||||
|
'hisauthname=$AUTHNAME' \
|
||||||
|
'hisauthsecret=$SECRET' \
|
||||||
|
'myauthproto=none' \
|
||||||
|
$server_optparam"
|
||||||
|
atf_check -s exit:0 -x "$HIJACKING $setup_serverparam"
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $SERVER_IP6/64 down
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 up
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
export RUMP_SERVER=$CLIENT
|
||||||
|
local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
|
||||||
|
'myauthname=$AUTHNAME' \
|
||||||
|
'myauthsecret=$SECRET' \
|
||||||
|
'hisauthproto=none'"
|
||||||
|
atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $CLIENT_IP6/64 down
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 up
|
||||||
|
$DEBUG && rump.ifconfig
|
||||||
|
wait_for_session_established
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
export RUMP_SERVER=$SERVER
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
export RUMP_SERVER=$CLIENT
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
# test for disconnection from server
|
||||||
|
export RUMP_SERVER=$SERVER
|
||||||
|
session_id=`$HIJACKING pppoectl -d pppoe0 | grep state`
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 down
|
||||||
|
wait_for_disconnected
|
||||||
|
export RUMP_SERVER=$CLIENT
|
||||||
|
wait_for_disconnected
|
||||||
|
atf_check -s not-exit:0 -o ignore -e ignore \
|
||||||
|
rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
|
||||||
|
atf_check -s exit:0 -o not-match:"$session_id" -x "$HIJACKING pppoectl -d pppoe0"
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
# test for recoonecting
|
||||||
|
export RUMP_SERVER=$SERVER
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 up
|
||||||
|
wait_for_session_established
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
$DEBUG && $HIJACKING pppoectl -d pppoe0
|
||||||
|
$DEBUG && rump.ifconfig pppoe0
|
||||||
|
export RUMP_SERVER=$CLIENT
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
# test for disconnection from client
|
||||||
|
export RUMP_SERVER=$CLIENT
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 down
|
||||||
|
wait_for_disconnected
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SERVER
|
||||||
|
wait_for_disconnected
|
||||||
|
$DEBUG && $HIJACKING pppoectl -d pppoe0
|
||||||
|
atf_check -s not-exit:0 -o ignore -e ignore \
|
||||||
|
rump.ping6 -c 1 -X $TIMEOUT $CLIENT_IP6
|
||||||
|
atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
# test for reconnecting
|
||||||
|
export RUMP_SERVER=$CLIENT
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 up
|
||||||
|
wait_for_session_established
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
|
$DEBUG && rump.ifconfig pppoe0
|
||||||
|
$DEBUG && $HIJACKING pppoectl -d pppoe0
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SERVER
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $CLIENT_IP6
|
||||||
|
atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0"
|
||||||
|
$DEBUG && HIJACKING pppoectl -d pppoe0
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
# test for invalid password
|
||||||
|
export RUMP_SERVER=$CLIENT
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 down
|
||||||
|
wait_for_disconnected
|
||||||
|
local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
|
||||||
|
'myauthname=$AUTHNAME' \
|
||||||
|
'myauthsecret=invalidsecret' \
|
||||||
|
'hisauthproto=none'"
|
||||||
|
atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
|
||||||
|
atf_check -s exit:0 rump.ifconfig pppoe0 up
|
||||||
|
wait_for_session_established dontfail
|
||||||
|
atf_check -s not-exit:0 -o ignore -e ignore \
|
||||||
|
rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
|
||||||
|
atf_check -s exit:0 -o match:'DETACHED' rump.ifconfig pppoe0
|
||||||
|
unset RUMP_SERVER
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case pppoe6_pap cleanup
|
||||||
|
|
||||||
|
pppoe6_pap_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" "Does simple pap using IPv6 tests"
|
||||||
|
atf_set "require.progs" "rump_server pppoectl"
|
||||||
|
}
|
||||||
|
|
||||||
|
pppoe6_pap_body()
|
||||||
|
{
|
||||||
|
run_test6 pap
|
||||||
|
}
|
||||||
|
|
||||||
|
pppoe6_pap_cleanup()
|
||||||
|
{
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case pppoe6_chap cleanup
|
||||||
|
|
||||||
|
pppoe6_chap_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" "Does simple chap using IPv6 tests"
|
||||||
|
atf_set "require.progs" "rump_server pppoectl"
|
||||||
|
}
|
||||||
|
|
||||||
|
pppoe6_chap_body()
|
||||||
|
{
|
||||||
|
run_test6 chap
|
||||||
|
}
|
||||||
|
|
||||||
|
pppoe6_chap_cleanup()
|
||||||
|
{
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
atf_init_test_cases()
|
atf_init_test_cases()
|
||||||
{
|
{
|
||||||
atf_add_test_case pap
|
atf_add_test_case pppoe_pap
|
||||||
|
atf_add_test_case pppoe_chap
|
||||||
|
atf_add_test_case pppoe6_pap
|
||||||
|
atf_add_test_case pppoe6_chap
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_tap.sh,v 1.3 2016/08/10 22:42:21 kre Exp $
|
# $NetBSD: t_tap.sh,v 1.6 2016/11/25 08:51:16 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,10 +25,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
RUMP_FLAGS="-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6"
|
|
||||||
RUMP_FLAGS="$RUMP_FLAGS -lrumpnet_shmif -lrumpnet_tap -lrumpnet_bridge -lrumpdev"
|
|
||||||
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=sysctl=yes"
|
|
||||||
|
|
||||||
SOCK_LOCAL=unix://commsock1
|
SOCK_LOCAL=unix://commsock1
|
||||||
SOCK_REMOTE=unix://commsock2
|
SOCK_REMOTE=unix://commsock2
|
||||||
BUS=bus1
|
BUS=bus1
|
||||||
@ -39,7 +35,7 @@ IP6_LOCAL=fc00::1
|
|||||||
IP6_TAP=fc00::2
|
IP6_TAP=fc00::2
|
||||||
IP6_REMOTE=fc00::3
|
IP6_REMOTE=fc00::3
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
TIMEOUT=1
|
TIMEOUT=1
|
||||||
|
|
||||||
atf_test_case tap_create_destroy cleanup
|
atf_test_case tap_create_destroy cleanup
|
||||||
@ -53,7 +49,7 @@ tap_create_destroy_head()
|
|||||||
tap_create_destroy_body()
|
tap_create_destroy_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${SOCK_LOCAL}
|
rump_server_start $SOCK_LOCAL netinet6 tap
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCK_LOCAL}
|
export RUMP_SERVER=${SOCK_LOCAL}
|
||||||
|
|
||||||
@ -77,7 +73,8 @@ tap_create_destroy_body()
|
|||||||
tap_create_destroy_cleanup()
|
tap_create_destroy_cleanup()
|
||||||
{
|
{
|
||||||
|
|
||||||
RUMP_SERVER=${SOCK_LOCAL} rump.halt
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_test_case tap_stand_alone cleanup
|
atf_test_case tap_stand_alone cleanup
|
||||||
@ -90,13 +87,14 @@ tap_create_destroy_head()
|
|||||||
|
|
||||||
tap_stand_alone_body()
|
tap_stand_alone_body()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${SOCK_LOCAL}
|
|
||||||
atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${SOCK_REMOTE}
|
rump_server_start $SOCK_LOCAL netinet6 tap
|
||||||
|
rump_server_start $SOCK_REMOTE netinet6 tap
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
|
||||||
|
rump_server_add_iface $SOCK_REMOTE shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCK_LOCAL}
|
export RUMP_SERVER=${SOCK_LOCAL}
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 $IP4_LOCAL
|
atf_check -s exit:0 rump.ifconfig shmif0 $IP4_LOCAL
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_LOCAL
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_LOCAL
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
@ -108,8 +106,6 @@ tap_stand_alone_body()
|
|||||||
|
|
||||||
export RUMP_SERVER=${SOCK_REMOTE}
|
export RUMP_SERVER=${SOCK_REMOTE}
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 $IP4_REMOTE
|
atf_check -s exit:0 rump.ifconfig shmif0 $IP4_REMOTE
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_REMOTE
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_REMOTE
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
@ -124,13 +120,15 @@ tap_stand_alone_body()
|
|||||||
# Cannot reach to an alone tap
|
# Cannot reach to an alone tap
|
||||||
atf_check -s not-exit:0 -o ignore -e ignore \
|
atf_check -s not-exit:0 -o ignore -e ignore \
|
||||||
rump.ping6 -n -X $TIMEOUT -c 1 $IP6_TAP
|
rump.ping6 -n -X $TIMEOUT -c 1 $IP6_TAP
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
tap_stand_alone_cleanup()
|
tap_stand_alone_cleanup()
|
||||||
{
|
{
|
||||||
|
|
||||||
RUMP_SERVER=${SOCK_LOCAL} rump.halt
|
$DEBUG && dump
|
||||||
RUMP_SERVER=${SOCK_REMOTE} rump.halt
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_test_case tap_bridged cleanup
|
atf_test_case tap_bridged cleanup
|
||||||
@ -143,13 +141,15 @@ tap_bridged_head()
|
|||||||
|
|
||||||
tap_bridged_body()
|
tap_bridged_body()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${SOCK_LOCAL}
|
|
||||||
atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${SOCK_REMOTE}
|
rump_server_start $SOCK_LOCAL netinet6 tap bridge
|
||||||
|
rump_server_start $SOCK_REMOTE netinet6 tap
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
|
||||||
|
rump_server_add_iface $SOCK_REMOTE shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCK_LOCAL}
|
export RUMP_SERVER=${SOCK_LOCAL}
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 $IP4_LOCAL
|
atf_check -s exit:0 rump.ifconfig shmif0 $IP4_LOCAL
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_LOCAL
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_LOCAL
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
@ -168,8 +168,6 @@ tap_bridged_body()
|
|||||||
|
|
||||||
export RUMP_SERVER=${SOCK_REMOTE}
|
export RUMP_SERVER=${SOCK_REMOTE}
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 $IP4_REMOTE
|
atf_check -s exit:0 rump.ifconfig shmif0 $IP4_REMOTE
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_REMOTE
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_REMOTE
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
@ -180,13 +178,15 @@ tap_bridged_body()
|
|||||||
|
|
||||||
atf_check -s exit:0 -o ignore rump.ping6 -n -X $TIMEOUT -c 1 $IP6_LOCAL
|
atf_check -s exit:0 -o ignore rump.ping6 -n -X $TIMEOUT -c 1 $IP6_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.ping6 -n -X $TIMEOUT -c 1 $IP6_TAP
|
atf_check -s exit:0 -o ignore rump.ping6 -n -X $TIMEOUT -c 1 $IP6_TAP
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
tap_bridged_cleanup()
|
tap_bridged_cleanup()
|
||||||
{
|
{
|
||||||
|
|
||||||
RUMP_SERVER=${SOCK_LOCAL} rump.halt
|
$DEBUG && dump
|
||||||
RUMP_SERVER=${SOCK_REMOTE} rump.halt
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_init_test_cases()
|
atf_init_test_cases()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_mcast.sh,v 1.2 2016/08/10 22:45:39 kre Exp $
|
# $NetBSD: t_mcast.sh,v 1.4 2016/11/25 08:51:16 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,12 +25,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
netserver="rump_server -lrumpnet -lrumpnet_net"
|
|
||||||
netserver="$netserver -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_shmif"
|
|
||||||
netserver="$netserver -lrumpdev"
|
|
||||||
export RUMP_SERVER=unix://commsock
|
export RUMP_SERVER=unix://commsock
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
run_test()
|
run_test()
|
||||||
{
|
{
|
||||||
@ -38,9 +35,8 @@ run_test()
|
|||||||
local opts="$2"
|
local opts="$2"
|
||||||
local mcast="$(atf_get_srcdir)/mcast"
|
local mcast="$(atf_get_srcdir)/mcast"
|
||||||
|
|
||||||
atf_check -s exit:0 ${netserver} ${RUMP_SERVER}
|
rump_server_start $RUMP_SERVER netinet6
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $RUMP_SERVER shmif0 bus1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 10.0.0.2/24
|
atf_check -s exit:0 rump.ifconfig shmif0 10.0.0.2/24
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2/64
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2/64
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
@ -79,11 +75,11 @@ add_test()
|
|||||||
}; \
|
}; \
|
||||||
mcast_${name}_body() { \
|
mcast_${name}_body() { \
|
||||||
run_test \"${name}\" \"${opts}\"; \
|
run_test \"${name}\" \"${opts}\"; \
|
||||||
|
rump_server_destroy_ifaces; \
|
||||||
}; \
|
}; \
|
||||||
mcast_${name}_cleanup() { \
|
mcast_${name}_cleanup() { \
|
||||||
${DEBUG} && /usr/bin/shmif_dumpbus -p - bus1 2>/dev/null | \
|
${DEBUG} && dump; \
|
||||||
/usr/sbin/tcpdump -n -e -r -; \
|
cleanup; \
|
||||||
env RUMP_SERVER=unix://commsock rump.halt; \
|
|
||||||
}"
|
}"
|
||||||
atf_add_test_case "mcast_${name}"
|
atf_add_test_case "mcast_${name}"
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_dad.sh,v 1.5 2016/08/10 23:07:57 kre Exp $
|
# $NetBSD: t_dad.sh,v 1.12 2016/11/25 08:51:17 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,18 +25,16 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
inetserver="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet"
|
|
||||||
inetserver="$inetserver -lrumpnet_netinet6 -lrumpnet_shmif"
|
|
||||||
inetserver="$inetserver -lrumpdev"
|
|
||||||
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=sysctl=yes"
|
|
||||||
|
|
||||||
SOCKLOCAL=unix://commsock1
|
SOCKLOCAL=unix://commsock1
|
||||||
SOCKPEER=unix://commsock2
|
SOCKPEER=unix://commsock2
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
|
duplicated="[Dd][Uu][Pp][Ll][Ii][Cc][Aa][Tt][Ee][Dd]"
|
||||||
|
|
||||||
atf_test_case dad_basic cleanup
|
atf_test_case dad_basic cleanup
|
||||||
atf_test_case dad_duplicated cleanup
|
atf_test_case dad_duplicated cleanup
|
||||||
|
atf_test_case dad_count cleanup
|
||||||
|
|
||||||
dad_basic_head()
|
dad_basic_head()
|
||||||
{
|
{
|
||||||
@ -50,15 +48,20 @@ dad_duplicated_head()
|
|||||||
atf_set "require.progs" "rump_server"
|
atf_set "require.progs" "rump_server"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dad_count_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" "Tests for IPv6 DAD count behavior"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
setup_server()
|
setup_server()
|
||||||
{
|
{
|
||||||
local sock=$1
|
local sock=$1
|
||||||
local ip=$2
|
local ip=$2
|
||||||
|
|
||||||
export RUMP_SERVER=$sock
|
rump_server_add_iface $sock shmif0 bus1
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
export RUMP_SERVER=$sock
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
@ -76,21 +79,6 @@ make_ns_pkt_str()
|
|||||||
echo $pkt
|
echo $pkt
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_new_packets()
|
|
||||||
{
|
|
||||||
local old=./old
|
|
||||||
|
|
||||||
if [ ! -f $old ]; then
|
|
||||||
old=/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| \
|
|
||||||
tcpdump -n -e -r - 2>/dev/null > ./new
|
|
||||||
diff -u $old ./new |grep '^+' |cut -d '+' -f 2 > ./diff
|
|
||||||
mv -f ./new ./old
|
|
||||||
cat ./diff
|
|
||||||
}
|
|
||||||
|
|
||||||
dad_basic_body()
|
dad_basic_body()
|
||||||
{
|
{
|
||||||
local pkt=
|
local pkt=
|
||||||
@ -98,11 +86,10 @@ dad_basic_body()
|
|||||||
local localip2=fc00::2
|
local localip2=fc00::2
|
||||||
local localip3=fc00::3
|
local localip3=fc00::3
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKLOCAL
|
rump_server_start $SOCKLOCAL netinet6
|
||||||
export RUMP_SERVER=$SOCKLOCAL
|
rump_server_add_iface $SOCKLOCAL shmif0 bus1
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $localip1
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $localip1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $localip2
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $localip2
|
||||||
$DEBUG && rump.ifconfig shmif0
|
$DEBUG && rump.ifconfig shmif0
|
||||||
@ -118,7 +105,7 @@ dad_basic_body()
|
|||||||
#atf_check -s exit:0 -x "cat ./out |grep $localip2 |grep -q tentative"
|
#atf_check -s exit:0 -x "cat ./out |grep $localip2 |grep -q tentative"
|
||||||
|
|
||||||
atf_check -s exit:0 sleep 2
|
atf_check -s exit:0 sleep 2
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
# Check DAD probe packets (Neighbor Solicitation Message)
|
# Check DAD probe packets (Neighbor Solicitation Message)
|
||||||
@ -130,7 +117,7 @@ dad_basic_body()
|
|||||||
|
|
||||||
# Waiting for DAD complete
|
# Waiting for DAD complete
|
||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
# IPv6 DAD doesn't announce (Neighbor Advertisement Message)
|
# IPv6 DAD doesn't announce (Neighbor Advertisement Message)
|
||||||
@ -149,20 +136,22 @@ dad_basic_body()
|
|||||||
|
|
||||||
# Check DAD probe packets (Neighbor Solicitation Message)
|
# Check DAD probe packets (Neighbor Solicitation Message)
|
||||||
atf_check -s exit:0 sleep 2
|
atf_check -s exit:0 sleep 2
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
pkt=$(make_ns_pkt_str 3 $localip3)
|
pkt=$(make_ns_pkt_str 3 $localip3)
|
||||||
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
||||||
|
|
||||||
# Waiting for DAD complete
|
# Waiting for DAD complete
|
||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
# IPv6 DAD doesn't announce (Neighbor Advertisement Message)
|
# IPv6 DAD doesn't announce (Neighbor Advertisement Message)
|
||||||
|
|
||||||
# The new address left tentative
|
# The new address left tentative
|
||||||
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep $localip3 |grep -q tentative"
|
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep $localip3 |grep -q tentative"
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
dad_duplicated_body()
|
dad_duplicated_body()
|
||||||
@ -171,8 +160,8 @@ dad_duplicated_body()
|
|||||||
local localip2=fc00::11
|
local localip2=fc00::11
|
||||||
local peerip=fc00::2
|
local peerip=fc00::2
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKLOCAL
|
rump_server_start $SOCKLOCAL netinet6
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKPEER
|
rump_server_start $SOCKPEER netinet6
|
||||||
|
|
||||||
setup_server $SOCKLOCAL $localip1
|
setup_server $SOCKLOCAL $localip1
|
||||||
setup_server $SOCKPEER $peerip
|
setup_server $SOCKPEER $peerip
|
||||||
@ -180,7 +169,8 @@ dad_duplicated_body()
|
|||||||
export RUMP_SERVER=$SOCKLOCAL
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
|
|
||||||
# The primary address isn't marked as duplicated
|
# The primary address isn't marked as duplicated
|
||||||
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep $localip1 |grep -q duplicated"
|
atf_check -s exit:0 -o not-match:"$localip1.+$duplicated" \
|
||||||
|
rump.ifconfig shmif0
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add a new address duplicated with the peer server
|
# Add a new address duplicated with the peer server
|
||||||
@ -189,52 +179,81 @@ dad_duplicated_body()
|
|||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
|
|
||||||
# The new address is marked as duplicated
|
# The new address is marked as duplicated
|
||||||
atf_check -s exit:0 -x "rump.ifconfig shmif0 |grep $peerip |grep -q duplicated"
|
atf_check -s exit:0 -o match:"$peerip.+$duplicated" \
|
||||||
|
rump.ifconfig shmif0
|
||||||
|
|
||||||
# A unique address isn't marked as duplicated
|
# A unique address isn't marked as duplicated
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $localip2
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $localip2
|
||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
atf_check -s not-exit:0 -x "rump.ifconfig shmif0 |grep $localip2 |grep -q duplicated"
|
atf_check -s exit:0 -o not-match:"$localip2.+$duplicated" \
|
||||||
|
rump.ifconfig shmif0
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
dad_count_test()
|
||||||
{
|
{
|
||||||
gdb -ex bt /usr/bin/rump_server rump_server.core
|
local pkt=
|
||||||
gdb -ex bt /usr/sbin/arp arp.core
|
local count=$1
|
||||||
env RUMP_SERVER=$SOCKLOCAL rump.halt
|
local id=$2
|
||||||
env RUMP_SERVER=$SOCKPEER rump.halt
|
local target=$3
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set DAD count to $count
|
||||||
|
#
|
||||||
|
atf_check -s exit:0 rump.sysctl -w -q net.inet6.ip6.dad_count=$count
|
||||||
|
|
||||||
|
# Add a new address
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $target
|
||||||
|
|
||||||
|
# Waiting for DAD complete
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 20
|
||||||
|
|
||||||
|
# Check the number of DAD probe packets (Neighbor Solicitation Message)
|
||||||
|
atf_check -s exit:0 sleep 2
|
||||||
|
extract_new_packets bus1 > ./out
|
||||||
|
$DEBUG && cat ./out
|
||||||
|
pkt=$(make_ns_pkt_str $id $target)
|
||||||
|
atf_check -s exit:0 -o match:"$count" \
|
||||||
|
-x "cat ./out |grep '$pkt' | wc -l | tr -d ' '"
|
||||||
}
|
}
|
||||||
|
|
||||||
dump_local()
|
dad_count_body()
|
||||||
{
|
{
|
||||||
|
local localip1=fc00::1
|
||||||
|
local localip2=fc00::2
|
||||||
|
|
||||||
|
rump_server_start $SOCKLOCAL netinet6
|
||||||
|
rump_server_add_iface $SOCKLOCAL shmif0 bus1
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKLOCAL
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
rump.netstat -nr
|
|
||||||
rump.arp -n -a
|
|
||||||
rump.ifconfig
|
|
||||||
$HIJACKING dmesg
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_peer()
|
# Check default value
|
||||||
{
|
atf_check -s exit:0 -o match:"1" rump.sysctl -n net.inet6.ip6.dad_count
|
||||||
export RUMP_SERVER=$SOCKPEER
|
|
||||||
rump.netstat -nr
|
|
||||||
rump.arp -n -a
|
|
||||||
rump.ifconfig
|
|
||||||
$HIJACKING dmesg
|
|
||||||
}
|
|
||||||
|
|
||||||
dump()
|
# Setup interface
|
||||||
{
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
dump_local
|
atf_check -s exit:0 sleep 2
|
||||||
dump_peer
|
rump.ifconfig shmif0 > ./out
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r -
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set and test DAD count (count=1)
|
||||||
|
#
|
||||||
|
dad_count_test 1 1 $localip1
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set and test DAD count (count=8)
|
||||||
|
#
|
||||||
|
dad_count_test 8 2 $localip2
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
dad_basic_cleanup()
|
dad_basic_cleanup()
|
||||||
{
|
{
|
||||||
$DEBUG && dump_local
|
$DEBUG && dump
|
||||||
$DEBUG && shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r -
|
cleanup
|
||||||
env RUMP_SERVER=$SOCKLOCAL rump.halt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dad_duplicated_cleanup()
|
dad_duplicated_cleanup()
|
||||||
@ -243,8 +262,15 @@ dad_duplicated_cleanup()
|
|||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dad_count_cleanup()
|
||||||
|
{
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
atf_init_test_cases()
|
atf_init_test_cases()
|
||||||
{
|
{
|
||||||
atf_add_test_case dad_basic
|
atf_add_test_case dad_basic
|
||||||
atf_add_test_case dad_duplicated
|
atf_add_test_case dad_duplicated
|
||||||
|
atf_add_test_case dad_count
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_ndp.sh,v 1.13 2016/08/10 23:07:57 kre Exp $
|
# $NetBSD: t_ndp.sh,v 1.17 2016/11/25 08:51:17 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,17 +25,12 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
inetserver="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet"
|
|
||||||
inetserver="$inetserver -lrumpnet_netinet6 -lrumpnet_shmif"
|
|
||||||
inetserver="$inetserver -lrumpdev"
|
|
||||||
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=sysctl=yes"
|
|
||||||
|
|
||||||
SOCKSRC=unix://commsock1
|
SOCKSRC=unix://commsock1
|
||||||
SOCKDST=unix://commsock2
|
SOCKDST=unix://commsock2
|
||||||
IP6SRC=fc00::1
|
IP6SRC=fc00::1
|
||||||
IP6DST=fc00::2
|
IP6DST=fc00::2
|
||||||
|
|
||||||
DEBUG=true
|
DEBUG=${DEBUG:-true}
|
||||||
TIMEOUT=1
|
TIMEOUT=1
|
||||||
|
|
||||||
atf_test_case ndp_cache_expiration cleanup
|
atf_test_case ndp_cache_expiration cleanup
|
||||||
@ -78,9 +73,8 @@ setup_dst_server()
|
|||||||
{
|
{
|
||||||
local assign_ip=$1
|
local assign_ip=$1
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCKDST shmif0 bus1
|
||||||
export RUMP_SERVER=$SOCKDST
|
export RUMP_SERVER=$SOCKDST
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
if [ "$assign_ip" != no ]; then
|
if [ "$assign_ip" != no ]; then
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6DST
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6DST
|
||||||
fi
|
fi
|
||||||
@ -97,8 +91,7 @@ setup_src_server()
|
|||||||
export RUMP_SERVER=$SOCKSRC
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
|
||||||
# Setup an interface
|
# Setup an interface
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $SOCKSRC shmif0 bus1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6SRC
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6SRC
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 rump.ifconfig -w 10
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
@ -119,8 +112,9 @@ get_timeout()
|
|||||||
|
|
||||||
ndp_cache_expiration_body()
|
ndp_cache_expiration_body()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKSRC netinet6
|
||||||
|
rump_server_start $SOCKDST netinet6
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server
|
setup_src_server
|
||||||
@ -144,6 +138,8 @@ ndp_cache_expiration_body()
|
|||||||
atf_check -s exit:0 -o match:'permanent' rump.ndp -n $IP6SRC
|
atf_check -s exit:0 -o match:'permanent' rump.ndp -n $IP6SRC
|
||||||
# Expired but remains until GC sweaps it (1 day)
|
# Expired but remains until GC sweaps it (1 day)
|
||||||
atf_check -s exit:0 -o match:'(1d0h0m|23h59m)' rump.ndp -n $IP6DST
|
atf_check -s exit:0 -o match:'(1d0h0m|23h59m)' rump.ndp -n $IP6DST
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
ifdown_dst_server()
|
ifdown_dst_server()
|
||||||
@ -155,8 +151,9 @@ ifdown_dst_server()
|
|||||||
|
|
||||||
ndp_commands_body()
|
ndp_commands_body()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKSRC netinet6
|
||||||
|
rump_server_start $SOCKDST netinet6
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server
|
setup_src_server
|
||||||
@ -217,13 +214,14 @@ ndp_commands_body()
|
|||||||
$DEBUG && rump.ndp -n -a
|
$DEBUG && rump.ndp -n -a
|
||||||
atf_check -s exit:0 -o not-match:'permanent' rump.ndp -n fc00::10
|
atf_check -s exit:0 -o not-match:'permanent' rump.ndp -n fc00::10
|
||||||
|
|
||||||
return 0
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
ndp_cache_overwriting_body()
|
ndp_cache_overwriting_body()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKSRC netinet6
|
||||||
|
rump_server_start $SOCKDST netinet6
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server
|
setup_src_server
|
||||||
@ -249,7 +247,7 @@ ndp_cache_overwriting_body()
|
|||||||
#atf_check -s not-exit:0 -e ignore rump.ndp -s fc00::10 b2:a0:20:00:00:ff
|
#atf_check -s not-exit:0 -e ignore rump.ndp -s fc00::10 b2:a0:20:00:00:ff
|
||||||
#$DEBUG && rump.ndp -n -a
|
#$DEBUG && rump.ndp -n -a
|
||||||
|
|
||||||
return 0
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
get_n_caches()
|
get_n_caches()
|
||||||
@ -261,8 +259,8 @@ get_n_caches()
|
|||||||
ndp_neighborgcthresh_body()
|
ndp_neighborgcthresh_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC netinet6
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST netinet6
|
||||||
|
|
||||||
setup_dst_server no
|
setup_dst_server no
|
||||||
setup_src_server
|
setup_src_server
|
||||||
@ -311,7 +309,7 @@ ndp_neighborgcthresh_body()
|
|||||||
atf_fail "Neighbor caches are not GC-ed"
|
atf_fail "Neighbor caches are not GC-ed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
make_pkt_str_na()
|
make_pkt_str_na()
|
||||||
@ -324,33 +322,18 @@ make_pkt_str_na()
|
|||||||
echo $pkt
|
echo $pkt
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_new_packets()
|
|
||||||
{
|
|
||||||
local old=./old
|
|
||||||
|
|
||||||
if [ ! -f $old ]; then
|
|
||||||
old=/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| \
|
|
||||||
tcpdump -n -e -r - 2>/dev/null > ./new
|
|
||||||
diff -u $old ./new |grep '^+' |cut -d '+' -f 2 > ./diff
|
|
||||||
mv -f ./new ./old
|
|
||||||
cat ./diff
|
|
||||||
}
|
|
||||||
|
|
||||||
ndp_link_activation_body()
|
ndp_link_activation_body()
|
||||||
{
|
{
|
||||||
local linklocal=
|
local linklocal=
|
||||||
|
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC netinet6
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST netinet6
|
||||||
|
|
||||||
setup_dst_server
|
setup_dst_server
|
||||||
setup_src_server
|
setup_src_server
|
||||||
|
|
||||||
# flush old packets
|
# flush old packets
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKSRC
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
|
||||||
@ -358,7 +341,7 @@ ndp_link_activation_body()
|
|||||||
b2:a1:00:00:00:01
|
b2:a1:00:00:00:01
|
||||||
|
|
||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
linklocal=$(rump.ifconfig shmif0 |awk '/fe80/ {print $2;}' |awk -F % '{print $1;}')
|
linklocal=$(rump.ifconfig shmif0 |awk '/fe80/ {print $2;}' |awk -F % '{print $1;}')
|
||||||
@ -371,7 +354,7 @@ ndp_link_activation_body()
|
|||||||
b2:a1:00:00:00:02 active
|
b2:a1:00:00:00:02 active
|
||||||
|
|
||||||
atf_check -s exit:0 sleep 1
|
atf_check -s exit:0 sleep 1
|
||||||
extract_new_packets > ./out
|
extract_new_packets bus1 > ./out
|
||||||
$DEBUG && cat ./out
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
linklocal=$(rump.ifconfig shmif0 |awk '/fe80/ {print $2;}' |awk -F % '{print $1;}')
|
linklocal=$(rump.ifconfig shmif0 |awk '/fe80/ {print $2;}' |awk -F % '{print $1;}')
|
||||||
@ -379,39 +362,8 @@ ndp_link_activation_body()
|
|||||||
|
|
||||||
pkt=$(make_pkt_str_na $linklocal b2:a1:00:00:00:02)
|
pkt=$(make_pkt_str_na $linklocal b2:a1:00:00:00:02)
|
||||||
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
|
||||||
}
|
|
||||||
|
|
||||||
cleanup()
|
rump_server_destroy_ifaces
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCKSRC rump.halt
|
|
||||||
env RUMP_SERVER=$SOCKDST rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_src()
|
|
||||||
{
|
|
||||||
export RUMP_SERVER=$SOCKSRC
|
|
||||||
rump.netstat -nr
|
|
||||||
rump.ndp -n -a
|
|
||||||
rump.ifconfig
|
|
||||||
$HIJACKING dmesg
|
|
||||||
}
|
|
||||||
|
|
||||||
dump_dst()
|
|
||||||
{
|
|
||||||
export RUMP_SERVER=$SOCKDST
|
|
||||||
rump.netstat -nr
|
|
||||||
rump.ndp -n -a
|
|
||||||
rump.ifconfig
|
|
||||||
$HIJACKING dmesg
|
|
||||||
}
|
|
||||||
|
|
||||||
dump()
|
|
||||||
{
|
|
||||||
dump_src
|
|
||||||
dump_dst
|
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r -
|
|
||||||
$DEBUG && gdb -ex bt /usr/bin/rump_server rump_server.core
|
|
||||||
$DEBUG && gdb -ex bt /usr/sbin/rump.ndp rump.ndp.core
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ndp_cache_expiration_cleanup()
|
ndp_cache_expiration_cleanup()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_ra.sh,v 1.3 2016/08/10 23:07:57 kre Exp $
|
# $NetBSD: t_ra.sh,v 1.20 2017/01/11 03:15:44 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,27 +25,49 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
RUMPFLAGS="-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6"
|
|
||||||
RUMPFLAGS="${RUMPFLAGS} -lrumpnet_shmif -lrumpdev"
|
|
||||||
RUMPFLAGS="${RUMPFLAGS} -lrumpvfs -lrumpfs_ffs"
|
|
||||||
|
|
||||||
RUMPSRV=unix://r1
|
RUMPSRV=unix://r1
|
||||||
|
RUMPSRV1_2=unix://r12
|
||||||
RUMPCLI=unix://r2
|
RUMPCLI=unix://r2
|
||||||
|
RUMPSRV3=unix://r3
|
||||||
|
RUMPSRV4=unix://r4
|
||||||
IP6SRV=fc00:1::1
|
IP6SRV=fc00:1::1
|
||||||
|
IP6SRV1_2=fc00:1::2
|
||||||
|
IP6SRV_PREFIX=fc00:1:
|
||||||
IP6CLI=fc00:2::2
|
IP6CLI=fc00:2::2
|
||||||
PIDFILE=/var/run/rump.rtadvd.pid
|
IP6SRV3=fc00:3::1
|
||||||
|
IP6SRV3_PREFIX=fc00:3:
|
||||||
|
IP6SRV4=fc00:4::1
|
||||||
|
IP6SRV4_PREFIX=fc00:4:
|
||||||
|
PIDFILE=./rump.rtadvd.pid
|
||||||
|
PIDFILE1_2=./rump.rtadvd.pid12
|
||||||
|
PIDFILE3=./rump.rtadvd.pid3
|
||||||
|
PIDFILE4=./rump.rtadvd.pid4
|
||||||
CONFIG=./rtadvd.conf
|
CONFIG=./rtadvd.conf
|
||||||
DEBUG=true
|
WAITTIME=2
|
||||||
|
DEBUG=${DEBUG:-true}
|
||||||
|
|
||||||
|
init_server()
|
||||||
|
{
|
||||||
|
|
||||||
|
export RUMP_SERVER=$1
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.forwarding=1
|
||||||
|
export LD_PRELOAD=/usr/lib/librumphijack.so
|
||||||
|
atf_check -s exit:0 mkdir -p /rump/var/chroot/rtadvd
|
||||||
|
unset LD_PRELOAD
|
||||||
|
unset RUMP_SERVER
|
||||||
|
}
|
||||||
|
|
||||||
setup_shmif0()
|
setup_shmif0()
|
||||||
{
|
{
|
||||||
local IP6ADDR=${1}
|
local sock=$1
|
||||||
shift
|
local IP6ADDR=$2
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $sock shmif0 bus1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6ADDR}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6ADDR}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.ifconfig
|
$DEBUG && rump.ifconfig
|
||||||
}
|
}
|
||||||
@ -72,41 +94,81 @@ shmif0:\
|
|||||||
_EOF
|
_EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_test_case basic cleanup
|
start_rtadvd()
|
||||||
basic_head()
|
{
|
||||||
|
local sock=$1
|
||||||
|
local pidfile=$2
|
||||||
|
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
|
atf_check -s exit:0 rump.rtadvd -c ${CONFIG} -p $pidfile shmif0
|
||||||
|
while [ ! -f $pidfile ]; do
|
||||||
|
sleep 0.2
|
||||||
|
done
|
||||||
|
unset RUMP_SERVER
|
||||||
|
}
|
||||||
|
|
||||||
|
check_entries()
|
||||||
|
{
|
||||||
|
local cli=$1
|
||||||
|
local srv=$2
|
||||||
|
local addr_prefix=$3
|
||||||
|
local mac_srv= ll_srv=
|
||||||
|
|
||||||
|
ll_srv=$(get_linklocal_addr $srv shmif0)
|
||||||
|
mac_srv=$(get_macaddr $srv shmif0)
|
||||||
|
|
||||||
|
export RUMP_SERVER=$cli
|
||||||
|
$DEBUG && dump_entries
|
||||||
|
atf_check -s exit:0 -o match:'if=shmif0' rump.ndp -r
|
||||||
|
atf_check -s exit:0 -o match:'advertised' rump.ndp -p
|
||||||
|
atf_check -s exit:0 -o match:"${ll_srv}%shmif0 \(reachable\)" rump.ndp -p
|
||||||
|
atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:"$ll_srv%shmif0 +$mac_srv +shmif0 +(23h59m|1d0h0m)..s S R" \
|
||||||
|
rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o match:$addr_prefix rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o match:"$addr_prefix.+<AUTOCONF>" \
|
||||||
|
rump.ifconfig shmif0 inet6
|
||||||
|
unset RUMP_SERVER
|
||||||
|
}
|
||||||
|
|
||||||
|
dump_entries()
|
||||||
|
{
|
||||||
|
|
||||||
|
echo ndp -n -a
|
||||||
|
rump.ndp -n -a
|
||||||
|
echo ndp -p
|
||||||
|
rump.ndp -p
|
||||||
|
echo ndp -r
|
||||||
|
rump.ndp -r
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ra_basic cleanup
|
||||||
|
ra_basic_head()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_set "descr" "Tests for basic functions of router advaertisement(RA)"
|
atf_set "descr" "Tests for basic functions of router advaertisement(RA)"
|
||||||
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
||||||
}
|
}
|
||||||
|
|
||||||
basic_body()
|
ra_basic_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 rump_server ${RUMPFLAGS} ${RUMPSRV}
|
rump_server_fs_start $RUMPSRV netinet6
|
||||||
atf_check -s exit:0 rump_server ${RUMPFLAGS} ${RUMPCLI}
|
rump_server_start $RUMPCLI netinet6
|
||||||
|
|
||||||
export RUMP_SERVER=${RUMPSRV}
|
setup_shmif0 ${RUMPSRV} ${IP6SRV}
|
||||||
setup_shmif0 ${IP6SRV}
|
init_server $RUMPSRV
|
||||||
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.forwarding=1
|
|
||||||
export LD_PRELOAD=/usr/lib/librumphijack.so
|
|
||||||
atf_check -s exit:0 mkdir -p /rump/var/chroot/rtadvd
|
|
||||||
unset LD_PRELOAD
|
|
||||||
unset RUMP_SERVER
|
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPCLI} ${IP6CLI}
|
||||||
export RUMP_SERVER=${RUMPCLI}
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
setup_shmif0 ${IP6CLI}
|
|
||||||
$DEBUG && rump.ndp -n -a
|
$DEBUG && rump.ndp -n -a
|
||||||
atf_check -s exit:0 -o match:'= 0' rump.sysctl net.inet6.ip6.accept_rtadv
|
atf_check -s exit:0 -o match:'= 0' rump.sysctl net.inet6.ip6.accept_rtadv
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
create_rtadvdconfig
|
create_rtadvdconfig
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
export RUMP_SERVER=${RUMPSRV}
|
sleep $WAITTIME
|
||||||
atf_check -s exit:0 rump.rtadvd -c ${CONFIG} shmif0
|
|
||||||
atf_check -s exit:0 sleep 3
|
|
||||||
atf_check -s exit:0 -o ignore -e empty cat ${PIDFILE}
|
|
||||||
unset RUMP_SERVER
|
|
||||||
|
|
||||||
export RUMP_SERVER=${RUMPCLI}
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
atf_check -s exit:0 -o empty rump.ndp -r
|
atf_check -s exit:0 -o empty rump.ndp -r
|
||||||
@ -124,30 +186,18 @@ basic_body()
|
|||||||
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
export RUMP_SERVER=${RUMPSRV}
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
atf_check -s exit:0 rump.rtadvd -c ${CONFIG} shmif0
|
sleep $WAITTIME
|
||||||
atf_check -s exit:0 sleep 3
|
|
||||||
atf_check -s exit:0 -o ignore -e empty cat ${PIDFILE}
|
|
||||||
unset RUMP_SERVER
|
|
||||||
|
|
||||||
export RUMP_SERVER=${RUMPCLI}
|
check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
|
||||||
$DEBUG && rump.ndp -n -a
|
|
||||||
$DEBUG && rump.ndp -r
|
|
||||||
atf_check -s exit:0 -o match:'if=shmif0' rump.ndp -r
|
|
||||||
atf_check -s exit:0 -o match:'advertised' rump.ndp -p
|
|
||||||
atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
|
|
||||||
atf_check -s exit:0 -o match:'23h59m..s S R' rump.ndp -n -a
|
|
||||||
atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
|
|
||||||
atf_check -s exit:0 -o match:'fc00:1:' rump.ifconfig shmif0 inet6
|
|
||||||
unset RUMP_SERVER
|
|
||||||
|
|
||||||
atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
|
||||||
wait_term ${PIDFILE}
|
wait_term ${PIDFILE}
|
||||||
|
|
||||||
return 0
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
basic_cleanup()
|
ra_basic_cleanup()
|
||||||
{
|
{
|
||||||
|
|
||||||
if [ -f ${PIDFILE} ]; then
|
if [ -f ${PIDFILE} ]; then
|
||||||
@ -155,12 +205,483 @@ basic_cleanup()
|
|||||||
wait_term ${PIDFILE}
|
wait_term ${PIDFILE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
env RUMP_SERVER=${RUMPSRV} rump.halt
|
$DEBUG && dump
|
||||||
env RUMP_SERVER=${RUMPCLI} rump.halt
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ra_flush_prefix_entries cleanup
|
||||||
|
ra_flush_prefix_entries_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "Tests for flushing prefixes (ndp -P)"
|
||||||
|
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_flush_prefix_entries_body()
|
||||||
|
{
|
||||||
|
|
||||||
|
rump_server_fs_start $RUMPSRV netinet6
|
||||||
|
rump_server_start $RUMPCLI netinet6
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPSRV} ${IP6SRV}
|
||||||
|
setup_shmif0 ${RUMPCLI} ${IP6CLI}
|
||||||
|
|
||||||
|
init_server $RUMPSRV
|
||||||
|
|
||||||
|
create_rtadvdconfig
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
|
||||||
|
# Terminate rtadvd to prevent new RA messages from coming
|
||||||
|
# Note that ifconfig down; kill -TERM doesn't work
|
||||||
|
kill -KILL `cat ${PIDFILE}`
|
||||||
|
|
||||||
|
# Flush all the entries in the prefix list
|
||||||
|
atf_check -s exit:0 rump.ndp -P
|
||||||
|
|
||||||
|
$DEBUG && dump_entries
|
||||||
|
atf_check -s exit:0 -o match:'if=shmif0' rump.ndp -r
|
||||||
|
atf_check -s exit:0 -o empty rump.ndp -p
|
||||||
|
atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
|
||||||
|
atf_check -s exit:0 -o match:'(23h59m|1d0h0m)..s S R' rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o not-match:'fc00:1:' rump.ifconfig shmif0 inet6
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_flush_prefix_entries_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ra_flush_defrouter_entries cleanup
|
||||||
|
ra_flush_defrouter_entries_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "Tests for flushing default routers (ndp -R)"
|
||||||
|
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_flush_defrouter_entries_body()
|
||||||
|
{
|
||||||
|
|
||||||
|
rump_server_fs_start $RUMPSRV netinet6
|
||||||
|
rump_server_start $RUMPCLI netinet6
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPSRV} ${IP6SRV}
|
||||||
|
setup_shmif0 ${RUMPCLI} ${IP6CLI}
|
||||||
|
|
||||||
|
init_server $RUMPSRV
|
||||||
|
|
||||||
|
create_rtadvdconfig
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
|
||||||
|
# Terminate rtadvd to prevent new RA messages from coming
|
||||||
|
# Note that ifconfig down; kill -TERM doesn't work
|
||||||
|
kill -KILL `cat ${PIDFILE}`
|
||||||
|
|
||||||
|
# Flush all the entries in the default router list
|
||||||
|
atf_check -s exit:0 rump.ndp -R
|
||||||
|
|
||||||
|
$DEBUG && dump_entries
|
||||||
|
atf_check -s exit:0 -o empty rump.ndp -r
|
||||||
|
atf_check -s exit:0 -o match:'No advertising router' rump.ndp -p
|
||||||
|
atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
|
||||||
|
atf_check -s exit:0 -o match:'(23h59m|1d0h0m)..s S R' rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o match:'fc00:1:' rump.ifconfig shmif0 inet6
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_flush_defrouter_entries_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ra_delete_address cleanup
|
||||||
|
ra_delete_address_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "Tests for deleting auto-configured address"
|
||||||
|
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_delete_address_body()
|
||||||
|
{
|
||||||
|
|
||||||
|
rump_server_fs_start $RUMPSRV netinet6
|
||||||
|
rump_server_start $RUMPCLI netinet6
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPSRV} ${IP6SRV}
|
||||||
|
setup_shmif0 ${RUMPCLI} ${IP6CLI}
|
||||||
|
|
||||||
|
init_server $RUMPSRV
|
||||||
|
|
||||||
|
create_rtadvdconfig
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
$DEBUG && rump.ifconfig shmif0
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 \
|
||||||
|
$(rump.ifconfig shmif0 |awk '/AUTOCONF/ {print $2}') delete
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_delete_address_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ -f ${PIDFILE} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
fi
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ra_multiple_routers cleanup
|
||||||
|
ra_multiple_routers_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "Tests for multiple routers"
|
||||||
|
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_multiple_routers_body()
|
||||||
|
{
|
||||||
|
local n=
|
||||||
|
|
||||||
|
rump_server_fs_start $RUMPSRV netinet6
|
||||||
|
rump_server_fs_start $RUMPSRV3 netinet6
|
||||||
|
rump_server_start $RUMPCLI netinet6
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPSRV} ${IP6SRV}
|
||||||
|
setup_shmif0 ${RUMPSRV3} ${IP6SRV3}
|
||||||
|
setup_shmif0 ${RUMPCLI} ${IP6CLI}
|
||||||
|
|
||||||
|
init_server $RUMPSRV
|
||||||
|
init_server $RUMPSRV3
|
||||||
|
|
||||||
|
create_rtadvdconfig
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
|
start_rtadvd $RUMPSRV3 $PIDFILE3
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
|
||||||
|
check_entries $RUMPCLI $RUMPSRV3 $IP6SRV3_PREFIX
|
||||||
|
|
||||||
|
export RUMP_SERVER=$RUMPCLI
|
||||||
|
# Two prefixes are advertised by differnt two routers
|
||||||
|
n=$(rump.ndp -p |grep 'advertised by' |wc -l)
|
||||||
|
atf_check_equal $n 2
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE3}`
|
||||||
|
wait_term ${PIDFILE3}
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_multiple_routers_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ -f ${PIDFILE} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
fi
|
||||||
|
if [ -f ${PIDFILE3} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE3}`
|
||||||
|
wait_term ${PIDFILE3}
|
||||||
|
fi
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ra_multiple_routers_single_prefix cleanup
|
||||||
|
ra_multiple_routers_single_prefix_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "Tests for multiple routers with a single prefix"
|
||||||
|
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_multiple_routers_single_prefix_body()
|
||||||
|
{
|
||||||
|
local n=
|
||||||
|
|
||||||
|
rump_server_fs_start $RUMPSRV netinet6
|
||||||
|
rump_server_fs_start $RUMPSRV1_2 netinet6
|
||||||
|
rump_server_start $RUMPCLI netinet6
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPSRV} ${IP6SRV}
|
||||||
|
setup_shmif0 ${RUMPSRV1_2} ${IP6SRV1_2}
|
||||||
|
setup_shmif0 ${RUMPCLI} ${IP6CLI}
|
||||||
|
|
||||||
|
init_server $RUMPSRV
|
||||||
|
init_server $RUMPSRV1_2
|
||||||
|
|
||||||
|
create_rtadvdconfig
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
|
start_rtadvd $RUMPSRV1_2 $PIDFILE1_2
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
|
||||||
|
check_entries $RUMPCLI $RUMPSRV1_2 $IP6SRV_PREFIX
|
||||||
|
|
||||||
|
export RUMP_SERVER=$RUMPCLI
|
||||||
|
# One prefix is advertised by differnt two routers
|
||||||
|
n=$(rump.ndp -p |grep 'advertised by' |wc -l)
|
||||||
|
atf_check_equal $n 1
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE1_2}`
|
||||||
|
wait_term ${PIDFILE1_2}
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_multiple_routers_single_prefix_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ -f ${PIDFILE} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
fi
|
||||||
|
if [ -f ${PIDFILE1_2} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE1_2}`
|
||||||
|
wait_term ${PIDFILE1_2}
|
||||||
|
fi
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ra_multiple_routers_maxifprefixes cleanup
|
||||||
|
ra_multiple_routers_maxifprefixes_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "Tests for exceeding the number of maximum prefixes"
|
||||||
|
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_multiple_routers_maxifprefixes_body()
|
||||||
|
{
|
||||||
|
local n=
|
||||||
|
|
||||||
|
rump_server_fs_start $RUMPSRV netinet6
|
||||||
|
rump_server_fs_start $RUMPSRV3 netinet6
|
||||||
|
rump_server_fs_start $RUMPSRV4 netinet6
|
||||||
|
rump_server_start $RUMPCLI netinet6
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPSRV} ${IP6SRV}
|
||||||
|
setup_shmif0 ${RUMPSRV3} ${IP6SRV3}
|
||||||
|
setup_shmif0 ${RUMPSRV4} ${IP6SRV4}
|
||||||
|
setup_shmif0 ${RUMPCLI} ${IP6CLI}
|
||||||
|
|
||||||
|
init_server $RUMPSRV
|
||||||
|
init_server $RUMPSRV3
|
||||||
|
init_server $RUMPSRV4
|
||||||
|
|
||||||
|
create_rtadvdconfig
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' \
|
||||||
|
rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
||||||
|
# Limit the maximum number of prefix entries to 2
|
||||||
|
atf_check -s exit:0 -o match:'16.->.2' \
|
||||||
|
rump.sysctl -w net.inet6.ip6.maxifprefixes=2
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
|
start_rtadvd $RUMPSRV3 $PIDFILE3
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
|
||||||
|
check_entries $RUMPCLI $RUMPSRV3 $IP6SRV3_PREFIX
|
||||||
|
|
||||||
|
start_rtadvd $RUMPSRV4 $PIDFILE4
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
$DEBUG && dump_entries
|
||||||
|
# There should remain two prefixes
|
||||||
|
n=$(rump.ndp -p |grep 'advertised by' |wc -l)
|
||||||
|
atf_check_equal $n 2
|
||||||
|
# TODO check other conditions
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE3}`
|
||||||
|
wait_term ${PIDFILE3}
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE4}`
|
||||||
|
wait_term ${PIDFILE4}
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_multiple_routers_maxifprefixes_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ -f ${PIDFILE} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
fi
|
||||||
|
if [ -f ${PIDFILE3} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE3}`
|
||||||
|
wait_term ${PIDFILE3}
|
||||||
|
fi
|
||||||
|
if [ -f ${PIDFILE4} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE4}`
|
||||||
|
wait_term ${PIDFILE4}
|
||||||
|
fi
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ra_temporary_address cleanup
|
||||||
|
ra_temporary_address_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "Tests for IPv6 temporary address"
|
||||||
|
atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_temporary_address_body()
|
||||||
|
{
|
||||||
|
|
||||||
|
rump_server_fs_start $RUMPSRV netinet6
|
||||||
|
rump_server_start $RUMPCLI netinet6
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPSRV} ${IP6SRV}
|
||||||
|
init_server $RUMPSRV
|
||||||
|
|
||||||
|
setup_shmif0 ${RUMPCLI} ${IP6CLI}
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
$DEBUG && rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o match:'= 0' \
|
||||||
|
rump.sysctl net.inet6.ip6.accept_rtadv
|
||||||
|
atf_check -s exit:0 -o match:'= 0' \
|
||||||
|
rump.sysctl net.inet6.ip6.use_tempaddr
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
create_rtadvdconfig
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o empty rump.ndp -r
|
||||||
|
atf_check -s exit:0 -o not-match:'advertised' rump.ndp -p
|
||||||
|
atf_check -s exit:0 -o match:'linkmtu=0' rump.ndp -n -i shmif0
|
||||||
|
atf_check -s exit:0 -o not-match:'S R' rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o not-match:'fc00:1:' rump.ndp -n -a
|
||||||
|
atf_check -s exit:0 -o not-match:'fc00:1:' rump.ifconfig shmif0 inet6
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' \
|
||||||
|
rump.sysctl -w net.inet6.ip6.accept_rtadv=1
|
||||||
|
atf_check -s exit:0 -o match:'0.->.1' \
|
||||||
|
rump.sysctl -w net.inet6.ip6.use_tempaddr=1
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
start_rtadvd $RUMPSRV $PIDFILE
|
||||||
|
sleep $WAITTIME
|
||||||
|
|
||||||
|
check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
|
||||||
|
|
||||||
|
# Check temporary address
|
||||||
|
export RUMP_SERVER=${RUMPCLI}
|
||||||
|
atf_check -s exit:0 -o match:"$IP6SRV_PREFIX.+<AUTOCONF,TEMPORARY>" \
|
||||||
|
rump.ifconfig shmif0 inet6
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ra_temporary_address_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ -f ${PIDFILE} ]; then
|
||||||
|
kill -TERM `cat ${PIDFILE}`
|
||||||
|
wait_term ${PIDFILE}
|
||||||
|
fi
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_init_test_cases()
|
atf_init_test_cases()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_add_test_case basic
|
atf_add_test_case ra_basic
|
||||||
|
atf_add_test_case ra_flush_prefix_entries
|
||||||
|
atf_add_test_case ra_flush_defrouter_entries
|
||||||
|
atf_add_test_case ra_delete_address
|
||||||
|
atf_add_test_case ra_multiple_routers
|
||||||
|
atf_add_test_case ra_multiple_routers_single_prefix
|
||||||
|
atf_add_test_case ra_multiple_routers_maxifprefixes
|
||||||
|
atf_add_test_case ra_temporary_address
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_forwarding.sh,v 1.15 2016/08/10 21:33:52 kre Exp $
|
# $NetBSD: t_forwarding.sh,v 1.19 2016/11/25 08:51:17 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,9 +25,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
inetserver="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpdev"
|
|
||||||
inet6server="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_shmif -lrumpdev"
|
|
||||||
|
|
||||||
SOCKSRC=unix://commsock1
|
SOCKSRC=unix://commsock1
|
||||||
SOCKFWD=unix://commsock2
|
SOCKFWD=unix://commsock2
|
||||||
SOCKDST=unix://commsock3
|
SOCKDST=unix://commsock3
|
||||||
@ -40,10 +37,9 @@ IP6SRC=fc00:0:0:1::2
|
|||||||
IP6SRCGW=fc00:0:0:1::1
|
IP6SRCGW=fc00:0:0:1::1
|
||||||
IP6DSTGW=fc00:0:0:2::1
|
IP6DSTGW=fc00:0:0:2::1
|
||||||
IP6DST=fc00:0:0:2::2
|
IP6DST=fc00:0:0:2::2
|
||||||
HTTPD_PID=httpd.pid
|
|
||||||
HTML_FILE=index.html
|
HTML_FILE=index.html
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
TIMEOUT=5
|
TIMEOUT=5
|
||||||
|
|
||||||
atf_test_case ipforwarding_v4 cleanup
|
atf_test_case ipforwarding_v4 cleanup
|
||||||
@ -64,6 +60,18 @@ ipforwarding_v6_head()
|
|||||||
atf_set "require.progs" "rump_server"
|
atf_set "require.progs" "rump_server"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ipforwarding_fastforward_v4_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" "Tests for IPv4 fastforward"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
|
ipforwarding_fastforward_v6_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" "Tests for IPv6 fastfoward"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
ipforwarding_misc_head()
|
ipforwarding_misc_head()
|
||||||
{
|
{
|
||||||
atf_set "descr" "Does IPv4 forwarding tests"
|
atf_set "descr" "Does IPv4 forwarding tests"
|
||||||
@ -78,9 +86,9 @@ setup_endpoint()
|
|||||||
mode=${4}
|
mode=${4}
|
||||||
gw=${5}
|
gw=${5}
|
||||||
|
|
||||||
|
rump_server_add_iface $sock shmif0 $bus
|
||||||
|
|
||||||
export RUMP_SERVER=${sock}
|
export RUMP_SERVER=${sock}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${bus}
|
|
||||||
if [ $mode = "ipv6" ]; then
|
if [ $mode = "ipv6" ]; then
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${addr}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${addr}
|
||||||
atf_check -s exit:0 -o ignore rump.route add -inet6 default ${gw}
|
atf_check -s exit:0 -o ignore rump.route add -inet6 default ${gw}
|
||||||
@ -116,12 +124,10 @@ setup_forwarder()
|
|||||||
{
|
{
|
||||||
mode=${1}
|
mode=${1}
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKFWD
|
rump_server_add_iface $SOCKFWD shmif0 bus1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $SOCKFWD shmif1 bus2
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
|
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 create
|
export RUMP_SERVER=$SOCKFWD
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 linkstr bus2
|
|
||||||
|
|
||||||
if [ $mode = "ipv6" ]; then
|
if [ $mode = "ipv6" ]; then
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6SRCGW}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6SRCGW}
|
||||||
@ -146,9 +152,9 @@ setup_forwarder()
|
|||||||
|
|
||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKFWD
|
rump_server_start $SOCKFWD
|
||||||
atf_check -s exit:0 ${inetserver} $SOCKDST
|
rump_server_start $SOCKDST
|
||||||
|
|
||||||
setup_endpoint $SOCKSRC $IP4SRC bus1 ipv4 $IP4SRCGW
|
setup_endpoint $SOCKSRC $IP4SRC bus1 ipv4 $IP4SRCGW
|
||||||
setup_endpoint $SOCKDST $IP4DST bus2 ipv4 $IP4DSTGW
|
setup_endpoint $SOCKDST $IP4DST bus2 ipv4 $IP4DSTGW
|
||||||
@ -157,29 +163,15 @@ setup()
|
|||||||
|
|
||||||
setup6()
|
setup6()
|
||||||
{
|
{
|
||||||
atf_check -s exit:0 ${inet6server} $SOCKSRC
|
rump_server_start $SOCKSRC netinet6
|
||||||
atf_check -s exit:0 ${inet6server} $SOCKFWD
|
rump_server_start $SOCKFWD netinet6
|
||||||
atf_check -s exit:0 ${inet6server} $SOCKDST
|
rump_server_start $SOCKDST netinet6
|
||||||
|
|
||||||
setup_endpoint $SOCKSRC $IP6SRC bus1 ipv6 $IP6SRCGW
|
setup_endpoint $SOCKSRC $IP6SRC bus1 ipv6 $IP6SRCGW
|
||||||
setup_endpoint $SOCKDST $IP6DST bus2 ipv6 $IP6DSTGW
|
setup_endpoint $SOCKDST $IP6DST bus2 ipv6 $IP6DSTGW
|
||||||
setup_forwarder ipv6
|
setup_forwarder ipv6
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_bozo()
|
|
||||||
{
|
|
||||||
local ip=$1
|
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKDST
|
|
||||||
|
|
||||||
touch $HTML_FILE
|
|
||||||
# start bozo in daemon mode
|
|
||||||
atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
|
|
||||||
/usr/libexec/httpd -P $HTTPD_PID -i $ip -b -s $(pwd)
|
|
||||||
|
|
||||||
$DEBUG && rump.netstat -a
|
|
||||||
}
|
|
||||||
|
|
||||||
test_http_get()
|
test_http_get()
|
||||||
{
|
{
|
||||||
local ip=$1
|
local ip=$1
|
||||||
@ -270,15 +262,8 @@ teardown_icmp_bmcastecho()
|
|||||||
|
|
||||||
teardown_interfaces()
|
teardown_interfaces()
|
||||||
{
|
{
|
||||||
export RUMP_SERVER=$SOCKSRC
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 destroy
|
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKFWD
|
rump_server_destroy_ifaces
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 destroy
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 destroy
|
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKDST
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 destroy
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test_setup_forwarding()
|
test_setup_forwarding()
|
||||||
@ -307,33 +292,6 @@ test_teardown_forwarding6()
|
|||||||
rump.sysctl net.inet6.ip6.forwarding
|
rump.sysctl net.inet6.ip6.forwarding
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCKSRC rump.halt
|
|
||||||
env RUMP_SERVER=$SOCKFWD rump.halt
|
|
||||||
env RUMP_SERVER=$SOCKDST rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup_bozo()
|
|
||||||
{
|
|
||||||
|
|
||||||
if [ -f $HTTPD_PID ]; then
|
|
||||||
kill -9 "$(cat $HTTPD_PID)"
|
|
||||||
rm -f $HTTPD_PID
|
|
||||||
fi
|
|
||||||
rm -f $HTML_FILE
|
|
||||||
}
|
|
||||||
|
|
||||||
dump()
|
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCKSRC rump.netstat -nr
|
|
||||||
env RUMP_SERVER=$SOCKFWD rump.netstat -nr
|
|
||||||
env RUMP_SERVER=$SOCKDST rump.netstat -nr
|
|
||||||
|
|
||||||
/usr/bin/shmif_dumpbus -p - bus1 2>/dev/null| /usr/sbin/tcpdump -n -e -r -
|
|
||||||
/usr/bin/shmif_dumpbus -p - bus2 2>/dev/null| /usr/sbin/tcpdump -n -e -r -
|
|
||||||
}
|
|
||||||
|
|
||||||
test_ping_failure()
|
test_ping_failure()
|
||||||
{
|
{
|
||||||
export RUMP_SERVER=$SOCKSRC
|
export RUMP_SERVER=$SOCKSRC
|
||||||
@ -481,7 +439,10 @@ ipforwarding_fastforward_v4_body()
|
|||||||
setup_forwarding
|
setup_forwarding
|
||||||
test_setup_forwarding
|
test_setup_forwarding
|
||||||
|
|
||||||
setup_bozo $IP4DST
|
touch $HTML_FILE
|
||||||
|
start_httpd $SOCKDST $IP4DST
|
||||||
|
$DEBUG && rump.netstat -a
|
||||||
|
|
||||||
test_http_get $IP4DST
|
test_http_get $IP4DST
|
||||||
|
|
||||||
teardown_interfaces
|
teardown_interfaces
|
||||||
@ -495,7 +456,10 @@ ipforwarding_fastforward_v6_body()
|
|||||||
setup_forwarding6
|
setup_forwarding6
|
||||||
test_setup_forwarding6
|
test_setup_forwarding6
|
||||||
|
|
||||||
setup_bozo $IP6DST
|
touch $HTML_FILE
|
||||||
|
start_httpd $SOCKDST $IP6DST
|
||||||
|
$DEBUG && rump.netstat -a
|
||||||
|
|
||||||
test_http_get "[$IP6DST]"
|
test_http_get "[$IP6DST]"
|
||||||
|
|
||||||
teardown_interfaces
|
teardown_interfaces
|
||||||
@ -513,7 +477,10 @@ ipforwarding_misc_body()
|
|||||||
|
|
||||||
test_directed_broadcast
|
test_directed_broadcast
|
||||||
|
|
||||||
setup_bozo $IP4DST
|
touch $HTML_FILE
|
||||||
|
start_httpd $SOCKDST $IP4DST
|
||||||
|
$DEBUG && rump.netstat -a
|
||||||
|
|
||||||
test_sysctl_ttl $IP4DST
|
test_sysctl_ttl $IP4DST
|
||||||
|
|
||||||
teardown_interfaces
|
teardown_interfaces
|
||||||
@ -522,34 +489,34 @@ ipforwarding_misc_body()
|
|||||||
|
|
||||||
ipforwarding_v4_cleanup()
|
ipforwarding_v4_cleanup()
|
||||||
{
|
{
|
||||||
dump
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
ipforwarding_v6_cleanup()
|
ipforwarding_v6_cleanup()
|
||||||
{
|
{
|
||||||
dump
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
ipforwarding_fastforward_v4_cleanup()
|
ipforwarding_fastforward_v4_cleanup()
|
||||||
{
|
{
|
||||||
dump
|
$DEBUG && dump
|
||||||
cleanup_bozo
|
stop_httpd
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
ipforwarding_fastforward_v6_cleanup()
|
ipforwarding_fastforward_v6_cleanup()
|
||||||
{
|
{
|
||||||
dump
|
$DEBUG && dump
|
||||||
cleanup_bozo
|
stop_httpd
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
ipforwarding_misc_cleanup()
|
ipforwarding_misc_cleanup()
|
||||||
{
|
{
|
||||||
dump
|
$DEBUG && dump
|
||||||
cleanup_bozo
|
stop_httpd
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_ipaddress.sh,v 1.3 2016/08/10 21:33:52 kre Exp $
|
# $NetBSD: t_ipaddress.sh,v 1.9 2016/12/15 02:43:56 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,61 +25,37 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
SERVER="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpdev"
|
|
||||||
SERVER6="$SERVER -lrumpnet_netinet6"
|
|
||||||
SOCK_LOCAL=unix://commsock1
|
SOCK_LOCAL=unix://commsock1
|
||||||
BUS=bus
|
BUS=bus
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
check_entry()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local word=$2
|
|
||||||
|
|
||||||
atf_check -s exit:0 -o match:"$word" -e ignore -x \
|
|
||||||
"rump.netstat -rn | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_fail()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local flags=$2 # Not used currently
|
|
||||||
|
|
||||||
atf_check -s not-exit:0 -e ignore -x \
|
|
||||||
"rump.netstat -rn | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
test_same_address()
|
test_same_address()
|
||||||
{
|
{
|
||||||
local ip=10.0.0.1
|
local ip=10.0.0.1
|
||||||
local net=10.0.0/24
|
local net=10.0.0/24
|
||||||
|
|
||||||
atf_check -s exit:0 ${SERVER} ${SOCK_LOCAL}
|
rump_server_start $SOCK_LOCAL
|
||||||
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet
|
$DEBUG && rump.netstat -nr -f inet
|
||||||
|
|
||||||
check_entry $ip UHl
|
check_route $ip 'link#2' UHl lo0
|
||||||
check_entry $ip lo0
|
check_route $net 'link#2' UC shmif0
|
||||||
check_entry $ip 'link#2'
|
|
||||||
check_entry $net U
|
|
||||||
check_entry $net shmif0
|
|
||||||
check_entry $net 'link#2'
|
|
||||||
|
|
||||||
# Delete the address
|
# Delete the address
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip delete
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip delete
|
||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet
|
$DEBUG && rump.netstat -nr -f inet
|
||||||
|
|
||||||
check_entry_fail $ip
|
check_route_no_entry $ip
|
||||||
check_entry_fail $net
|
check_route_no_entry $net
|
||||||
|
|
||||||
# Assign the same address again
|
# Assign the same address again
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip/24
|
||||||
@ -87,20 +63,18 @@ test_same_address()
|
|||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet
|
$DEBUG && rump.netstat -nr -f inet
|
||||||
|
|
||||||
check_entry $ip UHl
|
check_route $ip 'link#2' UHl lo0
|
||||||
check_entry $ip lo0
|
check_route $net 'link#2' UC shmif0
|
||||||
check_entry $ip 'link#2'
|
|
||||||
check_entry $net U
|
|
||||||
check_entry $net shmif0
|
|
||||||
check_entry $net 'link#2'
|
|
||||||
|
|
||||||
# Delete the address again
|
# Delete the address again
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip delete
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip delete
|
||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet
|
$DEBUG && rump.netstat -nr -f inet
|
||||||
|
|
||||||
check_entry_fail $ip
|
check_route_no_entry $ip
|
||||||
check_entry_fail $net
|
check_route_no_entry $net
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
test_same_address6()
|
test_same_address6()
|
||||||
@ -108,31 +82,27 @@ test_same_address6()
|
|||||||
local ip=fc00::1
|
local ip=fc00::1
|
||||||
local net=fc00::/64
|
local net=fc00::/64
|
||||||
|
|
||||||
atf_check -s exit:0 ${SERVER6} ${SOCK_LOCAL}
|
rump_server_start $SOCK_LOCAL netinet6
|
||||||
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $ip
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $ip
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet6
|
$DEBUG && rump.netstat -nr -f inet6
|
||||||
|
|
||||||
check_entry $ip UHl
|
check_route $ip 'link#2' UHl lo0
|
||||||
check_entry $ip lo0
|
check_route $net 'link#2' UC shmif0
|
||||||
check_entry $ip 'link#2'
|
|
||||||
check_entry $net U
|
|
||||||
check_entry $net shmif0
|
|
||||||
check_entry $net 'link#2'
|
|
||||||
|
|
||||||
# Delete the address
|
# Delete the address
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $ip delete
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $ip delete
|
||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet6
|
$DEBUG && rump.netstat -nr -f inet6
|
||||||
|
|
||||||
check_entry_fail $ip
|
check_route_no_entry $ip
|
||||||
check_entry_fail $net
|
check_route_no_entry $net
|
||||||
|
|
||||||
# Assign the same address again
|
# Assign the same address again
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $ip
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $ip
|
||||||
@ -140,27 +110,58 @@ test_same_address6()
|
|||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet6
|
$DEBUG && rump.netstat -nr -f inet6
|
||||||
|
|
||||||
check_entry $ip UHl
|
check_route $ip 'link#2' UHl lo0
|
||||||
check_entry $ip lo0
|
check_route $net 'link#2' UC shmif0
|
||||||
check_entry $ip 'link#2'
|
|
||||||
check_entry $net U
|
|
||||||
check_entry $net shmif0
|
|
||||||
check_entry $net 'link#2'
|
|
||||||
|
|
||||||
# Delete the address again
|
# Delete the address again
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $ip delete
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $ip delete
|
||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet6
|
$DEBUG && rump.netstat -nr -f inet6
|
||||||
|
|
||||||
check_entry_fail $ip
|
check_route_no_entry $ip
|
||||||
check_entry_fail $net
|
check_route_no_entry $net
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
test_auto_linklocal()
|
||||||
{
|
{
|
||||||
|
|
||||||
$DEBUG && shmif_dumpbus -p - $BUS 2>/dev/null | tcpdump -n -e -r -
|
rump_server_start $SOCK_LOCAL netinet6
|
||||||
env RUMP_SERVER=$SOCK_LOCAL rump.halt
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test enabled auto linklocal
|
||||||
|
#
|
||||||
|
|
||||||
|
# Check default value
|
||||||
|
atf_check -s exit:0 -o match:"1" rump.sysctl -n net.inet6.ip6.auto_linklocal
|
||||||
|
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
|
$DEBUG && rump.netstat -nr -f inet
|
||||||
|
|
||||||
|
# IPv6 link-local address is set
|
||||||
|
atf_check -s exit:0 -o match:"inet6 fe80::" rump.ifconfig shmif0
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test disabled auto linklocal
|
||||||
|
#
|
||||||
|
atf_check -s exit:0 -o ignore rump.sysctl -w -q net.inet6.ip6.auto_linklocal=0
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCK_LOCAL shmif1 $BUS
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 up
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
|
$DEBUG && rump.netstat -nr -f inet
|
||||||
|
|
||||||
|
# IPv6 link-local address is not set
|
||||||
|
atf_check -s exit:0 -o not-match:"inet6 fe80::" rump.ifconfig shmif1
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
add_test()
|
add_test()
|
||||||
@ -177,6 +178,7 @@ add_test()
|
|||||||
test_${name}; \
|
test_${name}; \
|
||||||
}; \
|
}; \
|
||||||
ipaddr_${name}_cleanup() { \
|
ipaddr_${name}_cleanup() { \
|
||||||
|
$DEBUG && dump; \
|
||||||
cleanup; \
|
cleanup; \
|
||||||
}"
|
}"
|
||||||
atf_add_test_case "ipaddr_${name}"
|
atf_add_test_case "ipaddr_${name}"
|
||||||
@ -187,4 +189,5 @@ atf_init_test_cases()
|
|||||||
|
|
||||||
add_test same_address "Assigning/deleting an IP address twice"
|
add_test same_address "Assigning/deleting an IP address twice"
|
||||||
add_test same_address6 "Assigning/deleting an IPv6 address twice"
|
add_test same_address6 "Assigning/deleting an IPv6 address twice"
|
||||||
|
add_test auto_linklocal "Assigning an IPv6 link-local address automatically"
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_ipv6_lifetime.sh,v 1.2 2016/08/10 21:33:52 kre Exp $
|
# $NetBSD: t_ipv6_lifetime.sh,v 1.6 2016/11/25 08:51:17 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,13 +25,12 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
INET6SERVER="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpdev"
|
|
||||||
INET6SERVER="$INET6SERVER -lrumpnet_netinet6 -lrumpnet_shmif"
|
|
||||||
|
|
||||||
SOCK=unix://sock
|
SOCK=unix://sock
|
||||||
BUS=./bus
|
BUS=./bus
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
|
deprecated="[Dd][Ee][Pp][Rr][Ee][Cc][Aa][Tt][Ee][Dd]"
|
||||||
|
|
||||||
atf_test_case basic cleanup
|
atf_test_case basic cleanup
|
||||||
|
|
||||||
@ -47,11 +46,11 @@ basic_body()
|
|||||||
local bonus=2
|
local bonus=2
|
||||||
local ip="fc00::1"
|
local ip="fc00::1"
|
||||||
|
|
||||||
atf_check -s exit:0 ${INET6SERVER} $SOCK
|
rump_server_start $SOCK netinet6
|
||||||
|
rump_server_add_iface $SOCK shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK
|
export RUMP_SERVER=$SOCK
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
|
||||||
# A normal IP address doesn't contain preferred/valid lifetime
|
# A normal IP address doesn't contain preferred/valid lifetime
|
||||||
@ -69,7 +68,7 @@ basic_body()
|
|||||||
atf_check -s exit:0 sleep $(($time + $bonus))
|
atf_check -s exit:0 sleep $(($time + $bonus))
|
||||||
$DEBUG && rump.ifconfig -L shmif0
|
$DEBUG && rump.ifconfig -L shmif0
|
||||||
# Should remain but marked as deprecated
|
# Should remain but marked as deprecated
|
||||||
atf_check -s exit:0 -o match:'deprecated' rump.ifconfig -L shmif0
|
atf_check -s exit:0 -o match:"$ip.+$deprecated" rump.ifconfig -L shmif0
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip delete
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip delete
|
||||||
|
|
||||||
# Setting only a valid lifetime (invalid)
|
# Setting only a valid lifetime (invalid)
|
||||||
@ -87,38 +86,33 @@ basic_body()
|
|||||||
# Shouldn't remain anymore
|
# Shouldn't remain anymore
|
||||||
atf_check -s exit:0 -o not-match:"$ip" rump.ifconfig -L shmif0
|
atf_check -s exit:0 -o not-match:"$ip" rump.ifconfig -L shmif0
|
||||||
|
|
||||||
|
# Setting both preferred and valid lifetimes (pltime > vltime)
|
||||||
|
atf_check -s not-exit:0 -e match:'Invalid argument' rump.ifconfig \
|
||||||
|
shmif0 inet6 $ip pltime $(($time * 2)) vltime $time
|
||||||
|
|
||||||
# Setting both preferred and valid lifetimes (pltime < vltime)
|
# Setting both preferred and valid lifetimes (pltime < vltime)
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip \
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip \
|
||||||
pltime $time vltime $((time * 2))
|
pltime $time vltime $((time * 2))
|
||||||
$DEBUG && rump.ifconfig -L shmif0
|
$DEBUG && rump.ifconfig -L shmif0
|
||||||
atf_check -s exit:0 -o match:'pltime' rump.ifconfig -L shmif0
|
atf_check -s exit:0 -o match:'pltime' rump.ifconfig -L shmif0
|
||||||
atf_check -s exit:0 -o match:'vltime' rump.ifconfig -L shmif0
|
atf_check -s exit:0 -o match:'vltime' rump.ifconfig -L shmif0
|
||||||
|
|
||||||
|
if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip delete
|
||||||
|
atf_skip "unreliable under qemu, skip until PR kern/43997 fixed"
|
||||||
|
fi
|
||||||
|
|
||||||
atf_check -s exit:0 sleep $(($time + $bonus))
|
atf_check -s exit:0 sleep $(($time + $bonus))
|
||||||
$DEBUG && rump.ifconfig -L shmif0
|
$DEBUG && rump.ifconfig -L shmif0
|
||||||
# Should remain but marked as deprecated
|
# Should remain but marked as deprecated
|
||||||
atf_check -s exit:0 -o match:'deprecated' rump.ifconfig -L shmif0
|
atf_check -s exit:0 -o match:"$ip.+$deprecated" rump.ifconfig -L shmif0
|
||||||
atf_check -s exit:0 sleep $(($time + $bonus))
|
atf_check -s exit:0 sleep $(($time + $bonus))
|
||||||
$DEBUG && rump.ifconfig -L shmif0
|
$DEBUG && rump.ifconfig -L shmif0
|
||||||
# Shouldn't remain anymore
|
# Shouldn't remain anymore
|
||||||
atf_check -s exit:0 -o not-match:"$ip" rump.ifconfig -L shmif0
|
atf_check -s exit:0 -o not-match:"$ip" rump.ifconfig -L shmif0
|
||||||
|
|
||||||
# Setting both preferred and valid lifetimes (pltime > vltime)
|
rump_server_destroy_ifaces
|
||||||
atf_check -s not-exit:0 -e match:'Invalid argument' rump.ifconfig \
|
|
||||||
shmif0 inet6 $ip pltime $(($time * 2)) vltime $time
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup()
|
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCK rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
dump()
|
|
||||||
{
|
|
||||||
env RUMP_SERVER=$SOCK rump.ifconfig
|
|
||||||
env RUMP_SERVER=$SOCK rump.netstat -nr
|
|
||||||
shmif_dumpbus -p - $BUS 2>/dev/null| tcpdump -n -e -r -
|
|
||||||
}
|
}
|
||||||
|
|
||||||
basic_cleanup()
|
basic_cleanup()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_ipv6address.sh,v 1.7 2016/08/10 21:33:52 kre Exp $
|
# $NetBSD: t_ipv6address.sh,v 1.12 2016/12/14 02:50:42 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
# Copyright (c) 2015 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -24,8 +24,9 @@
|
|||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
SERVER="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpdev"
|
SERVER="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet"
|
||||||
SERVER6="$SERVER -lrumpnet_netinet6"
|
SERVER="${SERVER} -lrumpnet_shmif -lrumpdev"
|
||||||
|
SERVER6="${SERVER} -lrumpnet_netinet6"
|
||||||
|
|
||||||
SOCKSRC=unix://commsock1
|
SOCKSRC=unix://commsock1
|
||||||
SOCKFWD=unix://commsock2
|
SOCKFWD=unix://commsock2
|
||||||
@ -40,7 +41,7 @@ BUS2=bus2
|
|||||||
BUSSRC=bus_src
|
BUSSRC=bus_src
|
||||||
BUSDST=bus_dst
|
BUSDST=bus_dst
|
||||||
|
|
||||||
DEBUG=true
|
DEBUG=${DEBUG:-true}
|
||||||
TIMEOUT=3
|
TIMEOUT=3
|
||||||
|
|
||||||
atf_test_case linklocal cleanup
|
atf_test_case linklocal cleanup
|
||||||
@ -118,41 +119,41 @@ setup_route()
|
|||||||
{
|
{
|
||||||
local tmp_rump_server=$RUMP_SERVER
|
local tmp_rump_server=$RUMP_SERVER
|
||||||
|
|
||||||
local src_if0_lladdr=`get_lladdr ${SOCKSRC} shmif0`
|
local src_if0_lladdr=`get_linklocal_addr ${SOCKSRC} shmif0`
|
||||||
local dst_if0_lladdr=`get_lladdr ${SOCKDST} shmif0`
|
local dst_if0_lladdr=`get_linklocal_addr ${SOCKDST} shmif0`
|
||||||
local fwd_if0_lladdr=`get_lladdr ${SOCKFWD} shmif0`
|
local fwd_if0_lladdr=`get_linklocal_addr ${SOCKFWD} shmif0`
|
||||||
local fwd_if1_lladdr=`get_lladdr ${SOCKFWD} shmif1`
|
local fwd_if1_lladdr=`get_linklocal_addr ${SOCKFWD} shmif1`
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCKSRC}
|
export RUMP_SERVER=${SOCKSRC}
|
||||||
atf_check -s ignore -o ignore -e ignore rump.route delete -inet6 default \
|
atf_check -s ignore -o ignore -e ignore \
|
||||||
${fwd_if0_lladdr}%shmif0
|
rump.route delete -inet6 default ${fwd_if0_lladdr}%shmif0
|
||||||
atf_check -s exit:0 -o match:"add net default:" rump.route add -inet6 default \
|
atf_check -s exit:0 -o match:"add net default:" \
|
||||||
${fwd_if0_lladdr}%shmif0
|
rump.route add -inet6 default ${fwd_if0_lladdr}%shmif0
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6SRC}
|
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6SRC}
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCKDST}
|
export RUMP_SERVER=${SOCKDST}
|
||||||
atf_check -s ignore -o ignore -e ignore rump.route delete -inet6 default \
|
atf_check -s ignore -o ignore -e ignore \
|
||||||
${fwd_if1_lladdr}%shmif0
|
rump.route delete -inet6 default ${fwd_if1_lladdr}%shmif0
|
||||||
atf_check -s exit:0 -o match:"add net default:" rump.route add -inet6 default \
|
atf_check -s exit:0 -o match:"add net default:" \
|
||||||
${fwd_if1_lladdr}%shmif0
|
rump.route add -inet6 default ${fwd_if1_lladdr}%shmif0
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6DST}
|
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6DST}
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCKFWD}
|
export RUMP_SERVER=${SOCKFWD}
|
||||||
atf_check -s ignore -o ignore -e ignore rump.route delete -inet6 ${IP6SRCNW} \
|
atf_check -s ignore -o ignore -e ignore \
|
||||||
${src_if0_lladdr}%shmif0
|
rump.route delete -inet6 ${IP6SRCNW} ${src_if0_lladdr}%shmif0
|
||||||
atf_check -s exit:0 -o match:"add net" rump.route add -inet6 ${IP6SRCNW} \
|
atf_check -s exit:0 -o match:"add net" \
|
||||||
${src_if0_lladdr}%shmif0
|
rump.route add -inet6 ${IP6SRCNW} ${src_if0_lladdr}%shmif0
|
||||||
|
|
||||||
atf_check -s ignore -o ignore -e ignore rump.route delete -inet6 ${IP6DSTNW} \
|
atf_check -s ignore -o ignore -e ignore \
|
||||||
${dst_if0_lladdr}%shmif1
|
rump.route delete -inet6 ${IP6DSTNW} ${dst_if0_lladdr}%shmif1
|
||||||
atf_check -s exit:0 -o match:"add net" rump.route add -inet6 ${IP6DSTNW} \
|
atf_check -s exit:0 -o match:"add net" \
|
||||||
${dst_if0_lladdr}%shmif1
|
rump.route add -inet6 ${IP6DSTNW} ${dst_if0_lladdr}%shmif1
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
@ -197,17 +198,6 @@ cleanup_bus()
|
|||||||
export RUMP_SERVER=$tmp_rump_server
|
export RUMP_SERVER=$tmp_rump_server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
get_lladdr()
|
|
||||||
{
|
|
||||||
export RUMP_SERVER=${1}
|
|
||||||
rump.ifconfig ${2} inet6 | grep "fe80" \
|
|
||||||
| awk '{print $2}' | sed -e "s/%$2//g"
|
|
||||||
unset RUMP_SERVER
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup_rump_servers()
|
cleanup_rump_servers()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -225,7 +215,7 @@ dump_bus()
|
|||||||
shmif_dumpbus -p - ${BUS2} 2>/dev/null| tcpdump -n -e -r -
|
shmif_dumpbus -p - ${BUS2} 2>/dev/null| tcpdump -n -e -r -
|
||||||
}
|
}
|
||||||
|
|
||||||
dump()
|
_dump()
|
||||||
{
|
{
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCKSRC}
|
export RUMP_SERVER=${SOCKSRC}
|
||||||
@ -242,19 +232,21 @@ dump()
|
|||||||
|
|
||||||
linklocal_head()
|
linklocal_head()
|
||||||
{
|
{
|
||||||
atf_set "descr" "Test for bassically function of the IPv6 linklocal address"
|
atf_set "descr" \
|
||||||
atf_set "require.progs" "rump_server rump.route rump.ifconfig rump.ping6"
|
"Test for bassically function of the IPv6 linklocal address"
|
||||||
|
atf_set "require.progs" \
|
||||||
|
"rump_server rump.route rump.ifconfig rump.ping6"
|
||||||
}
|
}
|
||||||
|
|
||||||
linklocal_body()
|
linklocal_body()
|
||||||
{
|
{
|
||||||
setup
|
setup
|
||||||
|
|
||||||
local src_if0_lladdr=`get_lladdr ${SOCKSRC} shmif0`
|
local src_if0_lladdr=`get_linklocal_addr ${SOCKSRC} shmif0`
|
||||||
local src_if1_lladdr=`get_lladdr ${SOCKSRC} shmif1`
|
local src_if1_lladdr=`get_linklocal_addr ${SOCKSRC} shmif1`
|
||||||
local dst_if0_lladdr=`get_lladdr ${SOCKDST} shmif0`
|
local dst_if0_lladdr=`get_linklocal_addr ${SOCKDST} shmif0`
|
||||||
local fwd_if0_lladdr=`get_lladdr ${SOCKFWD} shmif0`
|
local fwd_if0_lladdr=`get_linklocal_addr ${SOCKFWD} shmif0`
|
||||||
local fwd_if1_lladdr=`get_lladdr ${SOCKFWD} shmif1`
|
local fwd_if1_lladdr=`get_linklocal_addr ${SOCKFWD} shmif1`
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCKSRC}
|
export RUMP_SERVER=${SOCKSRC}
|
||||||
$DEBUG && rump.ifconfig
|
$DEBUG && rump.ifconfig
|
||||||
@ -290,12 +282,12 @@ linklocal_body()
|
|||||||
unset RUMP_SERVER
|
unset RUMP_SERVER
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCKSRC}
|
export RUMP_SERVER=${SOCKSRC}
|
||||||
atf_check -s exit:0 -o match:"add net default:" rump.route add -inet6 default \
|
atf_check -s exit:0 -o match:"add net default:" \
|
||||||
${fwd_if0_lladdr}%shmif0
|
rump.route add -inet6 default ${fwd_if0_lladdr}%shmif0
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.ifconfig shmif0
|
$DEBUG && rump.ifconfig shmif0
|
||||||
$DEBUG && dump
|
$DEBUG && _dump
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCKSRC}
|
export RUMP_SERVER=${SOCKSRC}
|
||||||
atf_check -s exit:0 -o match:"0.0% packet loss" \
|
atf_check -s exit:0 -o match:"0.0% packet loss" \
|
||||||
@ -340,7 +332,7 @@ linklocal_body()
|
|||||||
linklocal_cleanup()
|
linklocal_cleanup()
|
||||||
{
|
{
|
||||||
|
|
||||||
$DEBUG && dump
|
$DEBUG && _dump
|
||||||
$DEBUG && dump_bus
|
$DEBUG && dump_bus
|
||||||
cleanup_rump_servers
|
cleanup_rump_servers
|
||||||
}
|
}
|
||||||
@ -348,7 +340,8 @@ linklocal_cleanup()
|
|||||||
linklocal_ops_head()
|
linklocal_ops_head()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_set "descr" "Test for various operations to IPv6 linklocal addresses"
|
atf_set "descr" \
|
||||||
|
"Test for various operations to IPv6 linklocal addresses"
|
||||||
atf_set "require.progs" "rump_server rump.route rump.ndp"
|
atf_set "require.progs" "rump_server rump.route rump.ndp"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +351,7 @@ linklocal_ops_body()
|
|||||||
|
|
||||||
setup
|
setup
|
||||||
|
|
||||||
src_if0_lladdr=`get_lladdr ${SOCKSRC} shmif0`
|
src_if0_lladdr=`get_linklocal_addr ${SOCKSRC} shmif0`
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCKSRC}
|
export RUMP_SERVER=${SOCKSRC}
|
||||||
|
|
||||||
|
192
contrib/netbsd-tests/net/net/t_mtudisc.sh
Executable file
192
contrib/netbsd-tests/net/net/t_mtudisc.sh
Executable file
@ -0,0 +1,192 @@
|
|||||||
|
# $NetBSD: t_mtudisc.sh,v 1.8 2016/12/21 01:16:18 ozaki-r Exp $
|
||||||
|
#
|
||||||
|
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
SOCKLOCAL=unix://commsock1
|
||||||
|
SOCKGATEWAY=unix://commsock2
|
||||||
|
SOCKREMOTE=unix://commsock3
|
||||||
|
HTML_FILE=index.html
|
||||||
|
|
||||||
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
|
atf_test_case mtudisc_basic cleanup
|
||||||
|
|
||||||
|
mtudisc_basic_head()
|
||||||
|
{
|
||||||
|
atf_set "descr" "Tests for IPv4 Path MTU Dicorvery basic behavior"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_server()
|
||||||
|
{
|
||||||
|
local sock=$1
|
||||||
|
local if=$2
|
||||||
|
local bus=$3
|
||||||
|
local ip=$4
|
||||||
|
|
||||||
|
rump_server_add_iface $sock $if $bus
|
||||||
|
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
|
atf_check -s exit:0 rump.ifconfig $if $ip
|
||||||
|
atf_check -s exit:0 rump.ifconfig $if up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
|
$DEBUG && rump.ifconfig $if
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare_download_file()
|
||||||
|
{
|
||||||
|
local file=$1
|
||||||
|
local data="0123456789"
|
||||||
|
|
||||||
|
touch $file
|
||||||
|
for i in `seq 1 512`
|
||||||
|
do
|
||||||
|
echo $data >> $file
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
do_http_get()
|
||||||
|
{
|
||||||
|
local ip=$1
|
||||||
|
local ret=$2
|
||||||
|
local timeout=5
|
||||||
|
|
||||||
|
# get the webpage
|
||||||
|
atf_check -s exit:$ret env LD_PRELOAD=/usr/lib/librumphijack.so \
|
||||||
|
ftp -q $timeout -o ./out http://$ip/$HTML_FILE
|
||||||
|
}
|
||||||
|
|
||||||
|
mtudisc_basic_body()
|
||||||
|
{
|
||||||
|
local pkt=
|
||||||
|
local local_ip=10.0.0.2
|
||||||
|
local gateway_local_ip=10.0.0.1
|
||||||
|
local gateway_remote_ip=10.0.1.1
|
||||||
|
local remote_ip=10.0.1.2
|
||||||
|
local prefixlen=24
|
||||||
|
|
||||||
|
rump_server_start $SOCKLOCAL
|
||||||
|
rump_server_start $SOCKGATEWAY
|
||||||
|
rump_server_start $SOCKREMOTE
|
||||||
|
|
||||||
|
#
|
||||||
|
# Setup servers
|
||||||
|
#
|
||||||
|
# [local server] [gateway server] [remote server with httpd]
|
||||||
|
# | 10.0.0.2 10.0.0.1 | | 10.0.1.1 10.0.1.2 |
|
||||||
|
# shmif0(mtu=1500) ----- shmif1(mtu=1280) shmif0(mtu=1500) ----- shmif0(mtu=1500)
|
||||||
|
#
|
||||||
|
|
||||||
|
# Assign IP addresses
|
||||||
|
setup_server $SOCKLOCAL shmif0 bus1 $local_ip/$prefixlen
|
||||||
|
setup_server $SOCKGATEWAY shmif0 bus1 $gateway_local_ip/$prefixlen
|
||||||
|
setup_server $SOCKGATEWAY shmif1 bus2 $gateway_remote_ip/$prefixlen
|
||||||
|
setup_server $SOCKREMOTE shmif0 bus2 $remote_ip/$prefixlen
|
||||||
|
|
||||||
|
### Setup gateway server
|
||||||
|
export RUMP_SERVER=$SOCKGATEWAY
|
||||||
|
|
||||||
|
# Set mtu of shmif0 to 1280
|
||||||
|
export RUMP_SERVER=$SOCKGATEWAY
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 mtu 1280
|
||||||
|
|
||||||
|
# Enable IPv4 forwarding
|
||||||
|
atf_check -s exit:0 rump.sysctl -w -q net.inet.ip.forwarding=1
|
||||||
|
|
||||||
|
### Setup remote server
|
||||||
|
export RUMP_SERVER=$SOCKREMOTE
|
||||||
|
|
||||||
|
# Check default value
|
||||||
|
atf_check -s exit:0 -o match:"1" rump.sysctl -n net.inet.ip.mtudisc
|
||||||
|
|
||||||
|
# Start httpd daemon
|
||||||
|
prepare_download_file $HTML_FILE
|
||||||
|
start_httpd $SOCKREMOTE $remote_ip
|
||||||
|
$DEBUG && rump.netstat -a -f inet
|
||||||
|
|
||||||
|
# Teach the peer thar 10.0.0.2(local serer) is behind 10.0.1.1(gateway server)
|
||||||
|
atf_check -s exit:0 -o ignore rump.route add $local_ip/32 $gateway_remote_ip
|
||||||
|
|
||||||
|
### Setup local server
|
||||||
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
|
|
||||||
|
# Teach the peer thar 10.0.1.2(remote serer) is behind 10.0.0.1(gateway server)
|
||||||
|
atf_check -s exit:0 -o ignore rump.route add $remote_ip/32 $gateway_local_ip
|
||||||
|
|
||||||
|
# Don't accept fragmented packets
|
||||||
|
atf_check -s exit:0 -o ignore rump.sysctl -w -q net.inet.ip.maxfragpackets=0
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test disabled path mtu discorvery
|
||||||
|
#
|
||||||
|
export RUMP_SERVER=$SOCKREMOTE
|
||||||
|
atf_check -s exit:0 -o ignore rump.sysctl -w -q net.inet.ip.mtudisc=0
|
||||||
|
|
||||||
|
# Get the webpage (expect: failed)
|
||||||
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
|
do_http_get $remote_ip 1
|
||||||
|
$DEBUG && extract_new_packets bus2 > ./out
|
||||||
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
|
# Check path mtu size on remote server
|
||||||
|
export RUMP_SERVER=$SOCKREMOTE
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:"^10.0.0.2 +10.0.1.1 +UGHS +- +- +- +shmif0" \
|
||||||
|
rump.netstat -nr -f inet
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test enabled path mtu discorvery
|
||||||
|
#
|
||||||
|
export RUMP_SERVER=$SOCKREMOTE
|
||||||
|
atf_check -s exit:0 -o ignore rump.sysctl -w -q net.inet.ip.mtudisc=1
|
||||||
|
|
||||||
|
# Get the webpage (expect: success)
|
||||||
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
|
do_http_get $remote_ip 0
|
||||||
|
$DEBUG && extract_new_packets bus2 > ./out
|
||||||
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
|
# Check path mtu size on remote server
|
||||||
|
export RUMP_SERVER=$SOCKREMOTE
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:"^10.0.0.2 +10.0.1.1 +UGHS +- +- +1280 +shmif0" \
|
||||||
|
rump.netstat -nr -f inet
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
mtudisc_basic_cleanup()
|
||||||
|
{
|
||||||
|
$DEBUG && dump
|
||||||
|
stop_httpd
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_init_test_cases()
|
||||||
|
{
|
||||||
|
atf_add_test_case mtudisc_basic
|
||||||
|
}
|
179
contrib/netbsd-tests/net/net/t_mtudisc6.sh
Executable file
179
contrib/netbsd-tests/net/net/t_mtudisc6.sh
Executable file
@ -0,0 +1,179 @@
|
|||||||
|
# $NetBSD: t_mtudisc6.sh,v 1.5 2016/11/25 08:51:17 ozaki-r Exp $
|
||||||
|
#
|
||||||
|
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
SOCKLOCAL=unix://commsock1
|
||||||
|
SOCKGATEWAY=unix://commsock2
|
||||||
|
SOCKREMOTE=unix://commsock3
|
||||||
|
HTML_FILE=index.html
|
||||||
|
|
||||||
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
|
atf_test_case mtudisc6_basic cleanup
|
||||||
|
|
||||||
|
mtudisc6_basic_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "Tests for IPv6 Path MTU Dicorvery basic behavior"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_server()
|
||||||
|
{
|
||||||
|
local sock=$1
|
||||||
|
local if=$2
|
||||||
|
local bus=$3
|
||||||
|
local ip=$4
|
||||||
|
|
||||||
|
rump_server_add_iface $sock $if $bus
|
||||||
|
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
|
atf_check -s exit:0 rump.ifconfig $if inet6 $ip
|
||||||
|
atf_check -s exit:0 rump.ifconfig $if up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
|
$DEBUG && rump.ifconfig $if
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare_download_file()
|
||||||
|
{
|
||||||
|
local file=$1
|
||||||
|
local data="0123456789"
|
||||||
|
|
||||||
|
touch $file
|
||||||
|
for i in `seq 1 512`
|
||||||
|
do
|
||||||
|
echo $data >> $file
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
do_http_get()
|
||||||
|
{
|
||||||
|
local ip=$1
|
||||||
|
local ret=$2
|
||||||
|
local timeout=5
|
||||||
|
|
||||||
|
# get the webpage
|
||||||
|
atf_check -s exit:$ret env LD_PRELOAD=/usr/lib/librumphijack.so \
|
||||||
|
ftp -q $timeout -o ./out "http://[$ip]/$HTML_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
mtudisc6_basic_body()
|
||||||
|
{
|
||||||
|
local pkt=
|
||||||
|
local local_ip=fc00:0:0:1::2
|
||||||
|
local gateway_local_ip=fc00:0:0:1::1
|
||||||
|
local gateway_remote_ip=fc00:0:0:2::1
|
||||||
|
local remote_ip=fc00:0:0:2::2
|
||||||
|
local prefixlen=64
|
||||||
|
|
||||||
|
rump_server_start $SOCKLOCAL netinet6
|
||||||
|
rump_server_start $SOCKGATEWAY netinet6
|
||||||
|
rump_server_start $SOCKREMOTE netinet6
|
||||||
|
|
||||||
|
#
|
||||||
|
# Setup servers
|
||||||
|
#
|
||||||
|
# [local server] [gateway server] [remote server]
|
||||||
|
# | | | |
|
||||||
|
# shmif0(1500) -- shmif1(1280) shmif0(1500) -- shmif0(1500)
|
||||||
|
#
|
||||||
|
|
||||||
|
# Assign IP addresses
|
||||||
|
setup_server $SOCKLOCAL shmif0 bus1 $local_ip/$prefixlen
|
||||||
|
setup_server $SOCKGATEWAY shmif0 bus1 $gateway_local_ip/$prefixlen
|
||||||
|
setup_server $SOCKGATEWAY shmif1 bus2 $gateway_remote_ip/$prefixlen
|
||||||
|
setup_server $SOCKREMOTE shmif0 bus2 $remote_ip/$prefixlen
|
||||||
|
|
||||||
|
### Setup gateway server
|
||||||
|
export RUMP_SERVER=$SOCKGATEWAY
|
||||||
|
|
||||||
|
# Set MTU of shmif0 to 1280
|
||||||
|
export RUMP_SERVER=$SOCKGATEWAY
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 mtu 1280
|
||||||
|
|
||||||
|
# Enable IPv6 forwarding
|
||||||
|
atf_check -s exit:0 rump.sysctl -w -q net.inet6.ip6.forwarding=1
|
||||||
|
|
||||||
|
### Setup remote server
|
||||||
|
export RUMP_SERVER=$SOCKREMOTE
|
||||||
|
|
||||||
|
# Start httpd daemon
|
||||||
|
prepare_download_file $HTML_FILE
|
||||||
|
start_httpd $SOCKREMOTE $remote_ip
|
||||||
|
$DEBUG && rump.netstat -a
|
||||||
|
|
||||||
|
# Teach the peer that local serer is behind gateway server
|
||||||
|
atf_check -s exit:0 -o ignore \
|
||||||
|
rump.route add -inet6 $local_ip/128 $gateway_remote_ip
|
||||||
|
|
||||||
|
# Check path MTU size on remote server
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:"^$local_ip +$gateway_remote_ip +UGHS +- +- +- +shmif0" \
|
||||||
|
rump.netstat -nr -f inet6
|
||||||
|
|
||||||
|
### Setup local server
|
||||||
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
|
|
||||||
|
# Teach the peer that remote serer is behind gateway server
|
||||||
|
atf_check -s exit:0 -o ignore \
|
||||||
|
rump.route add -inet6 $remote_ip/128 $gateway_local_ip
|
||||||
|
|
||||||
|
# Don't accept fragmented packets
|
||||||
|
atf_check -s exit:0 -o ignore \
|
||||||
|
rump.sysctl -w -q net.inet6.ip6.maxfragpackets=0
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test enabled path MTU discorvery
|
||||||
|
#
|
||||||
|
# Get the webpage (expect: success)
|
||||||
|
export RUMP_SERVER=$SOCKLOCAL
|
||||||
|
do_http_get $remote_ip 0
|
||||||
|
$DEBUG && extract_new_packets bus2 > ./out
|
||||||
|
$DEBUG && cat ./out
|
||||||
|
|
||||||
|
# Check path MTU size on remote server
|
||||||
|
export RUMP_SERVER=$SOCKREMOTE
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:"^$local_ip +$gateway_remote_ip +UGHS +- +- +1280 +shmif0" \
|
||||||
|
rump.netstat -nr -f inet6
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
mtudisc6_basic_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
stop_httpd
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_init_test_cases()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_add_test_case mtudisc6_basic
|
||||||
|
}
|
380
contrib/netbsd-tests/net/net/t_ping6_opts.sh
Executable file
380
contrib/netbsd-tests/net/net/t_ping6_opts.sh
Executable file
@ -0,0 +1,380 @@
|
|||||||
|
# $NetBSD: t_ping6_opts.sh,v 1.8 2016/11/25 08:51:17 ozaki-r Exp $
|
||||||
|
#
|
||||||
|
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
SOCKSRC=unix://commsock1
|
||||||
|
SOCKFWD=unix://commsock2
|
||||||
|
SOCKDST=unix://commsock3
|
||||||
|
IP6SRC=fc00:0:0:1::2
|
||||||
|
IP6SRCGW=fc00:0:0:1::1
|
||||||
|
IP6DSTGW=fc00:0:0:2::1
|
||||||
|
IP6DST=fc00:0:0:2::2
|
||||||
|
BUS_SRCGW=bus1
|
||||||
|
BUS_DSTGW=bus2
|
||||||
|
|
||||||
|
IP6SRC2=fc00:0:0:1::3
|
||||||
|
IP6SRCGW2=fc00:0:0:1::254
|
||||||
|
|
||||||
|
DEBUG=${DEBUG:-false}
|
||||||
|
TIMEOUT=1
|
||||||
|
|
||||||
|
#
|
||||||
|
# Utility functions
|
||||||
|
#
|
||||||
|
setup_endpoint()
|
||||||
|
{
|
||||||
|
local sock=${1}
|
||||||
|
local addr=${2}
|
||||||
|
local bus=${3}
|
||||||
|
local gw=${4}
|
||||||
|
|
||||||
|
rump_server_add_iface $sock shmif0 $bus
|
||||||
|
|
||||||
|
export RUMP_SERVER=${sock}
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${addr}
|
||||||
|
atf_check -s exit:0 -o ignore rump.route add -inet6 default ${gw}
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
|
if $DEBUG; then
|
||||||
|
rump.ifconfig shmif0
|
||||||
|
rump.netstat -nr
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_forwarder()
|
||||||
|
{
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCKFWD shmif0 $BUS_SRCGW
|
||||||
|
rump_server_add_iface $SOCKFWD shmif1 $BUS_DSTGW
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SOCKFWD
|
||||||
|
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6SRCGW}
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6DSTGW}
|
||||||
|
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif1 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
|
if $DEBUG; then
|
||||||
|
rump.netstat -nr
|
||||||
|
rump.sysctl net.inet6.ip6.forwarding
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_forwarding6()
|
||||||
|
{
|
||||||
|
export RUMP_SERVER=$SOCKFWD
|
||||||
|
atf_check -s exit:0 -o ignore rump.sysctl -w net.inet6.ip6.forwarding=1
|
||||||
|
}
|
||||||
|
|
||||||
|
setup6()
|
||||||
|
{
|
||||||
|
|
||||||
|
rump_server_start $SOCKSRC netinet6
|
||||||
|
rump_server_start $SOCKFWD netinet6
|
||||||
|
rump_server_start $SOCKDST netinet6
|
||||||
|
|
||||||
|
setup_endpoint $SOCKSRC $IP6SRC $BUS_SRCGW $IP6SRCGW
|
||||||
|
setup_endpoint $SOCKDST $IP6DST $BUS_DSTGW $IP6DSTGW
|
||||||
|
setup_forwarder
|
||||||
|
}
|
||||||
|
|
||||||
|
check_echo_request_pkt()
|
||||||
|
{
|
||||||
|
local pkt="$1 > $2: .+ echo request"
|
||||||
|
|
||||||
|
extract_new_packets $BUS_SRCGW > ./out
|
||||||
|
$DEBUG && echo $pkt
|
||||||
|
$DEBUG && cat ./out
|
||||||
|
atf_check -s exit:0 -o match:"$pkt" cat ./out
|
||||||
|
}
|
||||||
|
|
||||||
|
check_echo_request_pkt_with_macaddr()
|
||||||
|
{
|
||||||
|
local pkt="$1 > $2, .+ $3 > $4: .+ echo request"
|
||||||
|
|
||||||
|
extract_new_packets $BUS_SRCGW > ./out
|
||||||
|
$DEBUG && echo $pkt
|
||||||
|
$DEBUG && cat ./out
|
||||||
|
atf_check -s exit:0 -o match:"$pkt" cat ./out
|
||||||
|
}
|
||||||
|
|
||||||
|
check_echo_request_pkt_with_macaddr_and_rthdr0()
|
||||||
|
{
|
||||||
|
local pkt=
|
||||||
|
|
||||||
|
pkt="$1 > $2, .+ $3 > $4:"
|
||||||
|
pkt="$pkt srcrt \\(len=2, type=0, segleft=1, \\[0\\]$5\\)"
|
||||||
|
pkt="$pkt .+ echo request"
|
||||||
|
|
||||||
|
extract_new_packets $BUS_SRCGW > ./out
|
||||||
|
$DEBUG && echo $pkt
|
||||||
|
$DEBUG && cat ./out
|
||||||
|
atf_check -s exit:0 -o match:"$pkt" cat ./out
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Tests
|
||||||
|
#
|
||||||
|
atf_test_case ping6_opts_sourceaddr cleanup
|
||||||
|
ping6_opts_sourceaddr_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "tests of ping6 -S option"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
|
ping6_opts_sourceaddr_body()
|
||||||
|
{
|
||||||
|
|
||||||
|
setup6
|
||||||
|
setup_forwarding6
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT $IP6DST
|
||||||
|
check_echo_request_pkt $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6SRC2
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT $IP6DST
|
||||||
|
check_echo_request_pkt $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
# ping6 -S <sourceaddr>
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-S $IP6SRC $IP6DST
|
||||||
|
check_echo_request_pkt $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-S $IP6SRC2 $IP6DST
|
||||||
|
check_echo_request_pkt $IP6SRC2 $IP6DST
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ping6_opts_sourceaddr_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ping6_opts_interface cleanup
|
||||||
|
ping6_opts_interface_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "tests of ping6 -I option"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
|
ping6_opts_interface_body()
|
||||||
|
{
|
||||||
|
local shmif0_lladdr=
|
||||||
|
local shmif1_lladdr=
|
||||||
|
local gw_lladdr=
|
||||||
|
|
||||||
|
setup6
|
||||||
|
setup_forwarding6
|
||||||
|
|
||||||
|
shmif0_lladdr=$(get_linklocal_addr ${SOCKSRC} shmif0)
|
||||||
|
gw_lladdr=$(get_linklocal_addr ${SOCKFWD} shmif0)
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT $gw_lladdr
|
||||||
|
check_echo_request_pkt $shmif0_lladdr $gw_lladdr
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCKSRC shmif1 $BUS_SRCGW
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif1 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
shmif1_lladdr=$(get_linklocal_addr ${SOCKSRC} shmif1)
|
||||||
|
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT $gw_lladdr
|
||||||
|
check_echo_request_pkt $shmif0_lladdr $gw_lladdr
|
||||||
|
|
||||||
|
# ping6 -I <interface>
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-I shmif0 $gw_lladdr
|
||||||
|
check_echo_request_pkt $shmif0_lladdr $gw_lladdr
|
||||||
|
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-I shmif1 $gw_lladdr
|
||||||
|
check_echo_request_pkt $shmif1_lladdr $gw_lladdr
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ping6_opts_interface_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ping6_opts_gateway cleanup
|
||||||
|
ping6_opts_gateway_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "tests of ping6 -g option"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
|
ping6_opts_gateway_body()
|
||||||
|
{
|
||||||
|
local my_macaddr=
|
||||||
|
local gw_shmif0_macaddr=
|
||||||
|
local gw_shmif2_macaddr=
|
||||||
|
|
||||||
|
setup6
|
||||||
|
setup_forwarding6
|
||||||
|
|
||||||
|
my_macaddr=$(get_macaddr ${SOCKSRC} shmif0)
|
||||||
|
gw_shmif0_macaddr=$(get_macaddr ${SOCKFWD} shmif0)
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr \
|
||||||
|
$my_macaddr $gw_shmif0_macaddr $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCKFWD shmif2 $BUS_SRCGW
|
||||||
|
export RUMP_SERVER=$SOCKFWD
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif2 inet6 $IP6SRCGW2
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
gw_shmif2_macaddr=$(get_macaddr ${SOCKFWD} shmif2)
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr \
|
||||||
|
$my_macaddr $gw_shmif0_macaddr $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
# ping6 -g <gateway>
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-g $IP6SRCGW $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr \
|
||||||
|
$my_macaddr $gw_shmif0_macaddr $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-g $IP6SRCGW2 $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr \
|
||||||
|
$my_macaddr $gw_shmif2_macaddr $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ping6_opts_gateway_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_test_case ping6_opts_hops cleanup
|
||||||
|
ping6_opts_hops_head()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_set "descr" "tests of ping6 hops (Type 0 Routing Header)"
|
||||||
|
atf_set "require.progs" "rump_server"
|
||||||
|
}
|
||||||
|
|
||||||
|
ping6_opts_hops_body()
|
||||||
|
{
|
||||||
|
local my_macaddr=
|
||||||
|
local gw_shmif0_macaddr=
|
||||||
|
local gw_shmif2_macaddr=
|
||||||
|
|
||||||
|
setup6
|
||||||
|
setup_forwarding6
|
||||||
|
|
||||||
|
my_macaddr=$(get_macaddr ${SOCKSRC} shmif0)
|
||||||
|
gw_shmif0_macaddr=$(get_macaddr ${SOCKFWD} shmif0)
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr \
|
||||||
|
$my_macaddr $gw_shmif0_macaddr $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCKFWD shmif2 $BUS_SRCGW
|
||||||
|
export RUMP_SERVER=$SOCKFWD
|
||||||
|
atf_check -s exit:0 rump.ifconfig shmif2 inet6 $IP6SRCGW2
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
gw_shmif2_macaddr=$(get_macaddr ${SOCKFWD} shmif2)
|
||||||
|
|
||||||
|
export RUMP_SERVER=$SOCKSRC
|
||||||
|
atf_check -s exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr \
|
||||||
|
$my_macaddr $gw_shmif0_macaddr $IP6SRC $IP6DST
|
||||||
|
|
||||||
|
# ping6 hops
|
||||||
|
|
||||||
|
# ping6 fails expectedly because the kernel doesn't support
|
||||||
|
# to receive packets with type 0 routing headers, but we can
|
||||||
|
# check whether a sent packet is correct.
|
||||||
|
atf_check -s not-exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
$IP6SRCGW $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr_and_rthdr0 \
|
||||||
|
$my_macaddr $gw_shmif0_macaddr $IP6SRC $IP6SRCGW $IP6DST
|
||||||
|
|
||||||
|
atf_check -s not-exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
$IP6SRCGW2 $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr_and_rthdr0 \
|
||||||
|
$my_macaddr $gw_shmif2_macaddr $IP6SRC $IP6SRCGW2 $IP6DST
|
||||||
|
|
||||||
|
# ping6 -g <gateway> hops
|
||||||
|
atf_check -s not-exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-g $IP6SRCGW $IP6SRCGW $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr_and_rthdr0 \
|
||||||
|
$my_macaddr $gw_shmif0_macaddr $IP6SRC $IP6SRCGW $IP6DST
|
||||||
|
|
||||||
|
atf_check -s not-exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-g $IP6SRCGW2 $IP6SRCGW2 $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr_and_rthdr0 \
|
||||||
|
$my_macaddr $gw_shmif2_macaddr $IP6SRC $IP6SRCGW2 $IP6DST
|
||||||
|
|
||||||
|
# ping6 -g <gateway> hops, but different nexthops (is it valid?)
|
||||||
|
atf_check -s not-exit:0 -o ignore rump.ping6 -n -c 1 -X $TIMEOUT \
|
||||||
|
-g $IP6SRCGW $IP6SRCGW2 $IP6DST
|
||||||
|
check_echo_request_pkt_with_macaddr_and_rthdr0 \
|
||||||
|
$my_macaddr $gw_shmif0_macaddr $IP6SRC $IP6SRCGW2 $IP6DST
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces
|
||||||
|
}
|
||||||
|
|
||||||
|
ping6_opts_hops_cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
$DEBUG && dump
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_init_test_cases()
|
||||||
|
{
|
||||||
|
|
||||||
|
atf_add_test_case ping6_opts_sourceaddr
|
||||||
|
atf_add_test_case ping6_opts_interface
|
||||||
|
atf_add_test_case ping6_opts_gateway
|
||||||
|
atf_add_test_case ping6_opts_hops
|
||||||
|
}
|
314
contrib/netbsd-tests/net/net_common.sh
Executable file
314
contrib/netbsd-tests/net/net_common.sh
Executable file
@ -0,0 +1,314 @@
|
|||||||
|
# $NetBSD: net_common.sh,v 1.11 2017/01/10 05:55:34 ozaki-r Exp $
|
||||||
|
#
|
||||||
|
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Common utility functions for tests/net
|
||||||
|
#
|
||||||
|
|
||||||
|
HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=sysctl=yes"
|
||||||
|
|
||||||
|
extract_new_packets()
|
||||||
|
{
|
||||||
|
local bus=$1
|
||||||
|
local old=./.__old
|
||||||
|
|
||||||
|
if [ ! -f $old ]; then
|
||||||
|
old=/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
shmif_dumpbus -p - $bus 2>/dev/null| \
|
||||||
|
tcpdump -n -e -r - 2>/dev/null > ./.__new
|
||||||
|
diff -u $old ./.__new |grep '^+' |cut -d '+' -f 2 > ./.__diff
|
||||||
|
mv -f ./.__new ./.__old
|
||||||
|
cat ./.__diff
|
||||||
|
}
|
||||||
|
|
||||||
|
check_route()
|
||||||
|
{
|
||||||
|
local target=$1
|
||||||
|
local gw=$2
|
||||||
|
local flags=${3:-\.\+}
|
||||||
|
local ifname=${4:-\.\+}
|
||||||
|
|
||||||
|
target=$(echo $target |sed 's/\./\\./g')
|
||||||
|
if [ "$gw" = "" ]; then
|
||||||
|
gw=".+"
|
||||||
|
else
|
||||||
|
gw=$(echo $gw |sed 's/\./\\./g')
|
||||||
|
fi
|
||||||
|
|
||||||
|
atf_check -s exit:0 -e ignore \
|
||||||
|
-o match:"^$target +$gw +$flags +- +- +.+ +$ifname" \
|
||||||
|
rump.netstat -rn
|
||||||
|
}
|
||||||
|
|
||||||
|
check_route_flags()
|
||||||
|
{
|
||||||
|
|
||||||
|
check_route "$1" "" "$2" ""
|
||||||
|
}
|
||||||
|
|
||||||
|
check_route_gw()
|
||||||
|
{
|
||||||
|
|
||||||
|
check_route "$1" "$2" "" ""
|
||||||
|
}
|
||||||
|
|
||||||
|
check_route_no_entry()
|
||||||
|
{
|
||||||
|
local target=$(echo $1 |sed 's/\./\\./g')
|
||||||
|
|
||||||
|
atf_check -s exit:0 -e ignore -o not-match:"^$target" \
|
||||||
|
rump.netstat -rn
|
||||||
|
}
|
||||||
|
|
||||||
|
get_linklocal_addr()
|
||||||
|
{
|
||||||
|
|
||||||
|
export RUMP_SERVER=${1}
|
||||||
|
rump.ifconfig ${2} inet6 |
|
||||||
|
awk "/fe80/ {sub(/%$2/, \"\"); sub(/\\/[0-9]*/, \"\"); print \$2;}"
|
||||||
|
unset RUMP_SERVER
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
get_macaddr()
|
||||||
|
{
|
||||||
|
|
||||||
|
env RUMP_SERVER=${1} \
|
||||||
|
rump.ifconfig ${2} |awk '/address/ {print $2;}'
|
||||||
|
}
|
||||||
|
|
||||||
|
HTTPD_PID=./.__httpd.pid
|
||||||
|
start_httpd()
|
||||||
|
{
|
||||||
|
local sock=$1
|
||||||
|
local ip=$2
|
||||||
|
local backup=$RUMP_SERVER
|
||||||
|
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
|
|
||||||
|
# start httpd in daemon mode
|
||||||
|
atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
|
||||||
|
/usr/libexec/httpd -P $HTTPD_PID -i $ip -b -s $(pwd)
|
||||||
|
|
||||||
|
export RUMP_SERVER=$backup
|
||||||
|
|
||||||
|
sleep 3
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_httpd()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ -f $HTTPD_PID ]; then
|
||||||
|
kill -9 $(cat $HTTPD_PID)
|
||||||
|
rm -f $HTTPD_PID
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASIC_LIBS="-lrumpnet -lrumpnet_net -lrumpnet_netinet \
|
||||||
|
-lrumpnet_shmif -lrumpdev"
|
||||||
|
FS_LIBS="$BASIC_LIBS -lrumpvfs -lrumpfs_ffs"
|
||||||
|
|
||||||
|
# We cannot keep variables between test phases, so need to store in files
|
||||||
|
_rump_server_socks=./.__socks
|
||||||
|
_rump_server_ifaces=./.__ifaces
|
||||||
|
_rump_server_buses=./.__buses
|
||||||
|
|
||||||
|
_rump_server_start_common()
|
||||||
|
{
|
||||||
|
local sock=$1
|
||||||
|
local libs=
|
||||||
|
|
||||||
|
shift 1
|
||||||
|
libs="$*"
|
||||||
|
|
||||||
|
atf_check -s exit:0 rump_server $libs $sock
|
||||||
|
|
||||||
|
echo $sock >> $_rump_server_socks
|
||||||
|
$DEBUG && cat $_rump_server_socks
|
||||||
|
}
|
||||||
|
|
||||||
|
rump_server_start()
|
||||||
|
{
|
||||||
|
local sock=$1
|
||||||
|
local _libs=
|
||||||
|
local libs="$BASIC_LIBS"
|
||||||
|
|
||||||
|
shift 1
|
||||||
|
_libs="$*"
|
||||||
|
|
||||||
|
for lib in $_libs; do
|
||||||
|
libs="$libs -lrumpnet_$lib"
|
||||||
|
done
|
||||||
|
|
||||||
|
_rump_server_start_common $sock $libs
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
rump_server_fs_start()
|
||||||
|
{
|
||||||
|
local sock=$1
|
||||||
|
local _libs=
|
||||||
|
local libs="$FS_LIBS"
|
||||||
|
|
||||||
|
shift 1
|
||||||
|
_libs="$*"
|
||||||
|
|
||||||
|
for lib in $_libs; do
|
||||||
|
libs="$libs -lrumpnet_$lib"
|
||||||
|
done
|
||||||
|
|
||||||
|
_rump_server_start_common $sock $libs
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
rump_server_add_iface()
|
||||||
|
{
|
||||||
|
local sock=$1
|
||||||
|
local ifname=$2
|
||||||
|
local bus=$3
|
||||||
|
local backup=$RUMP_SERVER
|
||||||
|
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
|
atf_check -s exit:0 rump.ifconfig $ifname create
|
||||||
|
atf_check -s exit:0 rump.ifconfig $ifname linkstr $bus
|
||||||
|
export RUMP_SERVER=$backup
|
||||||
|
|
||||||
|
echo $sock $ifname >> $_rump_server_ifaces
|
||||||
|
$DEBUG && cat $_rump_server_ifaces
|
||||||
|
|
||||||
|
echo $bus >> $_rump_server_buses
|
||||||
|
cat $_rump_server_buses |sort -u >./.__tmp
|
||||||
|
mv -f ./.__tmp $_rump_server_buses
|
||||||
|
$DEBUG && cat $_rump_server_buses
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
rump_server_destroy_ifaces()
|
||||||
|
{
|
||||||
|
local backup=$RUMP_SERVER
|
||||||
|
|
||||||
|
$DEBUG && cat $_rump_server_ifaces
|
||||||
|
|
||||||
|
# Try to dump states before destroying interfaces
|
||||||
|
for sock in $(cat $_rump_server_socks); do
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig
|
||||||
|
atf_check -s exit:0 -o ignore rump.netstat -nr
|
||||||
|
# XXX still need hijacking
|
||||||
|
atf_check -s exit:0 -o ignore $HIJACKING rump.netstat -i -a
|
||||||
|
atf_check -s exit:0 -o ignore rump.arp -na
|
||||||
|
atf_check -s exit:0 -o ignore rump.ndp -na
|
||||||
|
atf_check -s exit:0 -o ignore $HIJACKING ifmcstat
|
||||||
|
done
|
||||||
|
|
||||||
|
# XXX using pipe doesn't work. See PR bin/51667
|
||||||
|
#cat $_rump_server_ifaces | while read sock ifname; do
|
||||||
|
while read sock ifname; do
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
|
if rump.ifconfig -l |grep -q $ifname; then
|
||||||
|
atf_check -s exit:0 rump.ifconfig $ifname destroy
|
||||||
|
fi
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig
|
||||||
|
done < $_rump_server_ifaces
|
||||||
|
export RUMP_SERVER=$backup
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
rump_server_halt_servers()
|
||||||
|
{
|
||||||
|
local backup=$RUMP_SERVER
|
||||||
|
|
||||||
|
$DEBUG && cat $_rump_server_socks
|
||||||
|
for sock in $(cat $_rump_server_socks); do
|
||||||
|
env RUMP_SERVER=$sock rump.halt
|
||||||
|
done
|
||||||
|
export RUMP_SERVER=$backup
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
rump_server_dump_servers()
|
||||||
|
{
|
||||||
|
local backup=$RUMP_SERVER
|
||||||
|
|
||||||
|
$DEBUG && cat $_rump_server_socks
|
||||||
|
for sock in $(cat $_rump_server_socks); do
|
||||||
|
echo "### Dumping $sock"
|
||||||
|
export RUMP_SERVER=$sock
|
||||||
|
rump.ifconfig
|
||||||
|
rump.netstat -nr
|
||||||
|
# XXX still need hijacking
|
||||||
|
$HIJACKING rump.netstat -i -a
|
||||||
|
rump.arp -na
|
||||||
|
rump.ndp -na
|
||||||
|
$HIJACKING ifmcstat
|
||||||
|
$HIJACKING dmesg
|
||||||
|
done
|
||||||
|
export RUMP_SERVER=$backup
|
||||||
|
|
||||||
|
if [ -f rump_server.core ]; then
|
||||||
|
gdb -ex bt /usr/bin/rump_server rump_server.core
|
||||||
|
strings rump_server.core |grep panic
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
rump_server_dump_buses()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ ! -f $_rump_server_buses ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
$DEBUG && cat $_rump_server_buses
|
||||||
|
for bus in $(cat $_rump_server_buses); do
|
||||||
|
echo "### Dumping $bus"
|
||||||
|
shmif_dumpbus -p - $bus 2>/dev/null| tcpdump -n -e -r -
|
||||||
|
done
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
rump_server_halt_servers
|
||||||
|
}
|
||||||
|
|
||||||
|
dump()
|
||||||
|
{
|
||||||
|
|
||||||
|
rump_server_dump_servers
|
||||||
|
rump_server_dump_buses
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_change.sh,v 1.8 2016/08/10 23:00:39 roy Exp $
|
# $NetBSD: t_change.sh,v 1.9 2016/11/07 05:25:37 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 The NetBSD Foundation, Inc.
|
# Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -30,7 +30,7 @@ netserver=\
|
|||||||
-lrumpnet_netinet -lrumpnet_shmif"
|
-lrumpnet_netinet -lrumpnet_shmif"
|
||||||
export RUMP_SERVER=unix://commsock
|
export RUMP_SERVER=unix://commsock
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
atf_test_case route_change_reject2blackhole cleanup
|
atf_test_case route_change_reject2blackhole cleanup
|
||||||
route_change_reject2blackhole_head()
|
route_change_reject2blackhole_head()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_flags.sh,v 1.11 2016/08/10 23:00:39 roy Exp $
|
# $NetBSD: t_flags.sh,v 1.15 2016/12/21 02:46:08 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
# Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,27 +25,24 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
netserver=\
|
|
||||||
"rump_server -lrumpdev -lrumpnet -lrumpnet_net -lrumpnet_netinet \
|
|
||||||
-lrumpnet_shmif"
|
|
||||||
SOCK_LOCAL=unix://commsock1
|
SOCK_LOCAL=unix://commsock1
|
||||||
SOCK_PEER=unix://commsock2
|
SOCK_PEER=unix://commsock2
|
||||||
SOCK_GW=unix://commsock3
|
SOCK_GW=unix://commsock3
|
||||||
BUS=bus1
|
BUS=bus1
|
||||||
BUS2=bus2
|
BUS2=bus2
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
setup_local()
|
setup_local()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_LOCAL}
|
rump_server_start $SOCK_LOCAL
|
||||||
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.2/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.2/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.ifconfig
|
$DEBUG && rump.ifconfig
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
@ -54,13 +51,13 @@ setup_local()
|
|||||||
setup_peer()
|
setup_peer()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_PEER}
|
rump_server_start $SOCK_PEER
|
||||||
|
rump_server_add_iface $SOCK_PEER shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.1/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.1/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.ifconfig
|
$DEBUG && rump.ifconfig
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
@ -69,16 +66,14 @@ setup_peer()
|
|||||||
setup_gw()
|
setup_gw()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 ${netserver} ${SOCK_GW}
|
rump_server_start $SOCK_GW
|
||||||
|
rump_server_add_iface $SOCK_GW shmif0 $BUS
|
||||||
|
rump_server_add_iface $SOCK_GW shmif1 $BUS2
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_GW
|
export RUMP_SERVER=$SOCK_GW
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.254/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 10.0.0.254/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 linkstr ${BUS2}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 10.0.2.1/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 10.0.2.1/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 alias 10.0.2.2/24
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 alias 10.0.2.2/24
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif1 up
|
||||||
@ -91,46 +86,13 @@ setup_gw()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown_gw()
|
|
||||||
{
|
|
||||||
|
|
||||||
env RUMP_SERVER=$SOCK_GW rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_flags()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local flags=$2
|
|
||||||
|
|
||||||
atf_check -s exit:0 -o match:" $flags " -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_gw()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local gw=$2
|
|
||||||
|
|
||||||
atf_check -s exit:0 -o match:" $gw " -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_fail()
|
|
||||||
{
|
|
||||||
ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
flags=$2 # Not used currently
|
|
||||||
|
|
||||||
atf_check -s not-exit:0 -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
test_lo()
|
test_lo()
|
||||||
{
|
{
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
|
|
||||||
# Up, Host, local
|
# Up, Host, local
|
||||||
check_entry_flags 127.0.0.1 UHl
|
check_route_flags 127.0.0.1 UHl
|
||||||
}
|
}
|
||||||
|
|
||||||
test_connected()
|
test_connected()
|
||||||
@ -139,10 +101,10 @@ test_connected()
|
|||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
|
|
||||||
# Up, Host, LLINFO, local
|
# Up, Host, LLINFO, local
|
||||||
check_entry_flags 10.0.0.2 UHl
|
check_route_flags 10.0.0.2 UHl
|
||||||
|
|
||||||
# Up, Cloning
|
# Up, Cloning
|
||||||
check_entry_flags 10.0.0/24 UC
|
check_route_flags 10.0.0/24 UC
|
||||||
}
|
}
|
||||||
|
|
||||||
test_default_gateway()
|
test_default_gateway()
|
||||||
@ -154,7 +116,7 @@ test_default_gateway()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags default UGS
|
check_route_flags default UGS
|
||||||
}
|
}
|
||||||
|
|
||||||
test_static()
|
test_static()
|
||||||
@ -167,14 +129,14 @@ test_static()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Host, Static
|
# Up, Gateway, Host, Static
|
||||||
check_entry_flags 10.0.1.1 UGHS
|
check_route_flags 10.0.1.1 UGHS
|
||||||
|
|
||||||
# Static route to network
|
# Static route to network
|
||||||
atf_check -s exit:0 -o ignore rump.route add -net 10.0.2.0/24 10.0.0.1
|
atf_check -s exit:0 -o ignore rump.route add -net 10.0.2.0/24 10.0.0.1
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags 10.0.2/24 UGS
|
check_route_flags 10.0.2/24 UGS
|
||||||
}
|
}
|
||||||
|
|
||||||
test_blackhole()
|
test_blackhole()
|
||||||
@ -193,14 +155,14 @@ test_blackhole()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Blackhole, Static
|
# Up, Gateway, Blackhole, Static
|
||||||
check_entry_flags 10.0.0/24 UGBS
|
check_route_flags 10.0.0/24 UGBS
|
||||||
|
|
||||||
atf_check -s not-exit:0 -o match:'100.0% packet loss' \
|
atf_check -s not-exit:0 -o match:'100.0% packet loss' \
|
||||||
rump.ping -n -w 1 -c 1 10.0.0.1
|
rump.ping -n -w 1 -c 1 10.0.0.1
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Shouldn't be created
|
# Shouldn't be created
|
||||||
check_entry_fail 10.0.0.1 UH
|
check_route_no_entry 10.0.0.1
|
||||||
}
|
}
|
||||||
|
|
||||||
test_reject()
|
test_reject()
|
||||||
@ -215,14 +177,14 @@ test_reject()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Reject, Static
|
# Up, Gateway, Reject, Static
|
||||||
check_entry_flags 10.0.0/24 UGRS
|
check_route_flags 10.0.0/24 UGRS
|
||||||
|
|
||||||
atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
|
atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
|
||||||
rump.ping -n -w 1 -c 1 10.0.0.1
|
rump.ping -n -w 1 -c 1 10.0.0.1
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Shouldn't be created
|
# Shouldn't be created
|
||||||
check_entry_fail 10.0.0.1 UH
|
check_route_no_entry 10.0.0.1
|
||||||
|
|
||||||
# Gateway is lo0 (RTF_GATEWAY)
|
# Gateway is lo0 (RTF_GATEWAY)
|
||||||
|
|
||||||
@ -234,14 +196,14 @@ test_reject()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Reject, Static
|
# Up, Gateway, Reject, Static
|
||||||
check_entry_flags 10.0.0/24 UGRS
|
check_route_flags 10.0.0/24 UGRS
|
||||||
|
|
||||||
atf_check -s not-exit:0 -o ignore -e match:'Network is unreachable' \
|
atf_check -s not-exit:0 -o ignore -e match:'Network is unreachable' \
|
||||||
rump.ping -n -w 1 -c 1 10.0.0.1
|
rump.ping -n -w 1 -c 1 10.0.0.1
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Shouldn't be created
|
# Shouldn't be created
|
||||||
check_entry_fail 10.0.0.1 UH
|
check_route_no_entry 10.0.0.1
|
||||||
|
|
||||||
# Gateway is lo0 (RTF_HOST)
|
# Gateway is lo0 (RTF_HOST)
|
||||||
|
|
||||||
@ -253,7 +215,7 @@ test_reject()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Host, Reject, Static
|
# Up, Host, Reject, Static
|
||||||
check_entry_flags 10.0.0.1 UHRS
|
check_route_flags 10.0.0.1 UHRS
|
||||||
|
|
||||||
atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
|
atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
|
||||||
rump.ping -n -w 1 -c 1 10.0.0.1
|
rump.ping -n -w 1 -c 1 10.0.0.1
|
||||||
@ -278,7 +240,7 @@ test_icmp_redirect()
|
|||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
atf_check -s exit:0 -o ignore rump.route add -net 10.0.2.0/24 10.0.0.254
|
atf_check -s exit:0 -o ignore rump.route add -net 10.0.2.0/24 10.0.0.254
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags 10.0.2/24 UGS
|
check_route_flags 10.0.2/24 UGS
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup the default gateway to the peer, 10.0.0.1
|
# Setup the default gateway to the peer, 10.0.0.1
|
||||||
@ -286,15 +248,15 @@ test_icmp_redirect()
|
|||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.route add default 10.0.0.1
|
atf_check -s exit:0 -o ignore rump.route add default 10.0.0.1
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags default UGS
|
check_route_flags default UGS
|
||||||
|
|
||||||
# Try ping 10.0.2.1
|
# Try ping 10.0.2.1
|
||||||
atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 10.0.2.1
|
atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 10.0.2.1
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Host, Dynamic
|
# Up, Gateway, Host, Dynamic
|
||||||
check_entry_flags 10.0.2.1 UGHD
|
check_route_flags 10.0.2.1 UGHD
|
||||||
check_entry_gw 10.0.2.1 10.0.0.254
|
check_route_gw 10.0.2.1 10.0.0.254
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
@ -307,18 +269,16 @@ test_icmp_redirect()
|
|||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.route add 10.0.2.2 10.0.0.1
|
atf_check -s exit:0 -o ignore rump.route add 10.0.2.2 10.0.0.1
|
||||||
# Up, Gateway, Host, Static
|
# Up, Gateway, Host, Static
|
||||||
check_entry_flags 10.0.2.2 UGHS
|
check_route_flags 10.0.2.2 UGHS
|
||||||
check_entry_gw 10.0.2.2 10.0.0.1
|
check_route_gw 10.0.2.2 10.0.0.1
|
||||||
|
|
||||||
# Try ping 10.0.2.2
|
# Try ping 10.0.2.2
|
||||||
atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 10.0.2.2
|
atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 10.0.2.2
|
||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Host, Modified, Static
|
# Up, Gateway, Host, Modified, Static
|
||||||
check_entry_flags 10.0.2.2 UGHMS
|
check_route_flags 10.0.2.2 UGHMS
|
||||||
check_entry_gw 10.0.2.2 10.0.0.254
|
check_route_gw 10.0.2.2 10.0.0.254
|
||||||
|
|
||||||
teardown_gw
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test_announce()
|
test_announce()
|
||||||
@ -332,19 +292,11 @@ test_announce()
|
|||||||
$DEBUG && rump.netstat -rn -f inet
|
$DEBUG && rump.netstat -rn -f inet
|
||||||
|
|
||||||
# Up, Gateway, Static, proxy
|
# Up, Gateway, Static, proxy
|
||||||
check_entry_flags 10.0.0/24 UGSp
|
check_route_flags 10.0.0/24 UGSp
|
||||||
|
|
||||||
# TODO test its behavior
|
# TODO test its behavior
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
|
||||||
{
|
|
||||||
$DEBUG && /usr/bin/shmif_dumpbus -p - $BUS 2>/dev/null | \
|
|
||||||
/usr/sbin/tcpdump -n -e -r -
|
|
||||||
env RUMP_SERVER=$SOCK_LOCAL rump.halt
|
|
||||||
env RUMP_SERVER=$SOCK_PEER rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
add_test()
|
add_test()
|
||||||
{
|
{
|
||||||
local name=$1
|
local name=$1
|
||||||
@ -359,8 +311,10 @@ add_test()
|
|||||||
setup_local; \
|
setup_local; \
|
||||||
setup_peer; \
|
setup_peer; \
|
||||||
test_${name}; \
|
test_${name}; \
|
||||||
|
rump_server_destroy_ifaces; \
|
||||||
}; \
|
}; \
|
||||||
route_flags_${name}_cleanup() { \
|
route_flags_${name}_cleanup() { \
|
||||||
|
$DEBUG && dump; \
|
||||||
cleanup; \
|
cleanup; \
|
||||||
}"
|
}"
|
||||||
atf_add_test_case "route_flags_${name}"
|
atf_add_test_case "route_flags_${name}"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_flags6.sh,v 1.7 2016/08/10 23:00:39 roy Exp $
|
# $NetBSD: t_flags6.sh,v 1.12 2016/12/21 02:46:08 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,9 +25,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
RUMP_OPTS="-lrumpdev -lrumpnet -lrumpnet_net"
|
|
||||||
RUMP_OPTS="$RUMP_OPTS -lrumpnet_netinet -lrumpnet_netinet6"
|
|
||||||
RUMP_OPTS="$RUMP_OPTS -lrumpnet_shmif"
|
|
||||||
SOCK_LOCAL=unix://commsock1
|
SOCK_LOCAL=unix://commsock1
|
||||||
SOCK_PEER=unix://commsock2
|
SOCK_PEER=unix://commsock2
|
||||||
SOCK_GW=unix://commsock3
|
SOCK_GW=unix://commsock3
|
||||||
@ -37,18 +34,18 @@ BUS2=bus2
|
|||||||
IP6_LOCAL=fc00::2
|
IP6_LOCAL=fc00::2
|
||||||
IP6_PEER=fc00::1
|
IP6_PEER=fc00::1
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
|
|
||||||
setup_local()
|
setup_local()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 rump_server ${RUMP_OPTS} ${SOCK_LOCAL}
|
rump_server_start $SOCK_LOCAL netinet6
|
||||||
|
rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $IP6_LOCAL
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $IP6_LOCAL
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.ifconfig
|
$DEBUG && rump.ifconfig
|
||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
@ -57,55 +54,28 @@ setup_local()
|
|||||||
setup_peer()
|
setup_peer()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 rump_server ${RUMP_OPTS} ${SOCK_PEER}
|
rump_server_start $SOCK_PEER netinet6
|
||||||
|
rump_server_add_iface $SOCK_PEER shmif0 $BUS
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_PEER
|
export RUMP_SERVER=$SOCK_PEER
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS}
|
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $IP6_PEER
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 $IP6_PEER
|
||||||
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.ifconfig
|
$DEBUG && rump.ifconfig
|
||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
}
|
}
|
||||||
|
|
||||||
check_entry_flags()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local flags=$2
|
|
||||||
|
|
||||||
atf_check -s exit:0 -o match:" $flags " -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet6 | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_gw()
|
|
||||||
{
|
|
||||||
local ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
local gw=$2
|
|
||||||
|
|
||||||
atf_check -s exit:0 -o match:" $gw " -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet6 | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_entry_fail()
|
|
||||||
{
|
|
||||||
ip=$(echo $1 |sed 's/\./\\./g')
|
|
||||||
flags=$2 # Not used currently
|
|
||||||
|
|
||||||
atf_check -s not-exit:0 -e ignore -x \
|
|
||||||
"rump.netstat -rn -f inet6 | grep ^'$ip'"
|
|
||||||
}
|
|
||||||
|
|
||||||
test_lo6()
|
test_lo6()
|
||||||
{
|
{
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
|
|
||||||
# Up, Host, local
|
# Up, Host, local
|
||||||
check_entry_flags fe80::1 UHl
|
check_route_flags fe80::1 UHl
|
||||||
|
|
||||||
# Up, Host
|
# Up, Host, local
|
||||||
check_entry_flags ::1 UH
|
check_route_flags ::1 UHl
|
||||||
}
|
}
|
||||||
|
|
||||||
test_connected6()
|
test_connected6()
|
||||||
@ -114,10 +84,10 @@ test_connected6()
|
|||||||
export RUMP_SERVER=$SOCK_LOCAL
|
export RUMP_SERVER=$SOCK_LOCAL
|
||||||
|
|
||||||
# Up, Host, local
|
# Up, Host, local
|
||||||
check_entry_flags $IP6_LOCAL UHl
|
check_route_flags $IP6_LOCAL UHl
|
||||||
|
|
||||||
# Up, Connected
|
# Up, Connected
|
||||||
check_entry_flags fc00::/64 UC
|
check_route_flags fc00::/64 UC
|
||||||
}
|
}
|
||||||
|
|
||||||
test_default_gateway6()
|
test_default_gateway6()
|
||||||
@ -129,7 +99,7 @@ test_default_gateway6()
|
|||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags default UGS
|
check_route_flags default UGS
|
||||||
}
|
}
|
||||||
|
|
||||||
test_static6()
|
test_static6()
|
||||||
@ -143,7 +113,7 @@ test_static6()
|
|||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Up, Gateway, Host, Static
|
# Up, Gateway, Host, Static
|
||||||
check_entry_flags fc00::1:1 UGHS
|
check_route_flags fc00::1:1 UGHS
|
||||||
|
|
||||||
# Static route to network
|
# Static route to network
|
||||||
atf_check -s exit:0 -o ignore \
|
atf_check -s exit:0 -o ignore \
|
||||||
@ -151,7 +121,7 @@ test_static6()
|
|||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Up, Gateway, Static
|
# Up, Gateway, Static
|
||||||
check_entry_flags fc00::/24 UGS
|
check_route_flags fc00::/24 UGS
|
||||||
}
|
}
|
||||||
|
|
||||||
test_blackhole6()
|
test_blackhole6()
|
||||||
@ -171,14 +141,14 @@ test_blackhole6()
|
|||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Up, Gateway, Blackhole, Static
|
# Up, Gateway, Blackhole, Static
|
||||||
check_entry_flags fc00::/64 UGBS
|
check_route_flags fc00::/64 UGBS
|
||||||
|
|
||||||
atf_check -s not-exit:0 -o match:'100.0% packet loss' \
|
atf_check -s not-exit:0 -o match:'100.0% packet loss' \
|
||||||
rump.ping6 -n -X 1 -c 1 $IP6_PEER
|
rump.ping6 -n -X 1 -c 1 $IP6_PEER
|
||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Shouldn't be created
|
# Shouldn't be created
|
||||||
check_entry_fail $IP6_PEER UH
|
check_route_no_entry $IP6_PEER
|
||||||
}
|
}
|
||||||
|
|
||||||
test_reject6()
|
test_reject6()
|
||||||
@ -195,14 +165,14 @@ test_reject6()
|
|||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Up, Gateway, Reject, Static
|
# Up, Gateway, Reject, Static
|
||||||
check_entry_flags fc00::/64 UGRS
|
check_route_flags fc00::/64 UGRS
|
||||||
|
|
||||||
atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
|
atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
|
||||||
rump.ping6 -n -X 1 -c 1 $IP6_PEER
|
rump.ping6 -n -X 1 -c 1 $IP6_PEER
|
||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Shouldn't be created
|
# Shouldn't be created
|
||||||
check_entry_fail $IP6_PEER UH
|
check_route_no_entry $IP6_PEER
|
||||||
|
|
||||||
# Gateway is lo0 (RTF_GATEWAY)
|
# Gateway is lo0 (RTF_GATEWAY)
|
||||||
|
|
||||||
@ -215,14 +185,14 @@ test_reject6()
|
|||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Up, Gateway, Reject, Static
|
# Up, Gateway, Reject, Static
|
||||||
check_entry_flags fc00::/64 UGRS
|
check_route_flags fc00::/64 UGRS
|
||||||
|
|
||||||
atf_check -s not-exit:0 -o ignore -e match:'Network is unreachable' \
|
atf_check -s not-exit:0 -o ignore -e match:'Network is unreachable' \
|
||||||
rump.ping6 -n -X 1 -c 1 $IP6_PEER
|
rump.ping6 -n -X 1 -c 1 $IP6_PEER
|
||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Shouldn't be created
|
# Shouldn't be created
|
||||||
check_entry_fail $IP6_PEER UH
|
check_route_no_entry $IP6_PEER
|
||||||
|
|
||||||
# Gateway is lo0 (RTF_HOST)
|
# Gateway is lo0 (RTF_HOST)
|
||||||
|
|
||||||
@ -235,7 +205,7 @@ test_reject6()
|
|||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Up, Host, Reject, Static
|
# Up, Host, Reject, Static
|
||||||
check_entry_flags fc00:: UHRS
|
check_route_flags fc00:: UHRS
|
||||||
|
|
||||||
atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
|
atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
|
||||||
rump.ping6 -n -X 1 -c 1 $IP6_PEER
|
rump.ping6 -n -X 1 -c 1 $IP6_PEER
|
||||||
@ -257,19 +227,11 @@ test_announce6()
|
|||||||
$DEBUG && rump.netstat -rn -f inet6
|
$DEBUG && rump.netstat -rn -f inet6
|
||||||
|
|
||||||
# Up, Gateway, Static, proxy
|
# Up, Gateway, Static, proxy
|
||||||
check_entry_flags fc00::/64 UGSp
|
check_route_flags fc00::/64 UGSp
|
||||||
|
|
||||||
# TODO test its behavior
|
# TODO test its behavior
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
|
||||||
{
|
|
||||||
$DEBUG && /usr/bin/shmif_dumpbus -p - $BUS 2>/dev/null | \
|
|
||||||
/usr/sbin/tcpdump -n -e -r -
|
|
||||||
env RUMP_SERVER=$SOCK_LOCAL rump.halt
|
|
||||||
env RUMP_SERVER=$SOCK_PEER rump.halt
|
|
||||||
}
|
|
||||||
|
|
||||||
add_test()
|
add_test()
|
||||||
{
|
{
|
||||||
local name=$1
|
local name=$1
|
||||||
@ -284,8 +246,10 @@ add_test()
|
|||||||
setup_local; \
|
setup_local; \
|
||||||
setup_peer; \
|
setup_peer; \
|
||||||
test_${name}; \
|
test_${name}; \
|
||||||
|
rump_server_destroy_ifaces; \
|
||||||
}; \
|
}; \
|
||||||
route_flags_${name}_cleanup() { \
|
route_flags_${name}_cleanup() { \
|
||||||
|
$DEBUG && dump; \
|
||||||
cleanup; \
|
cleanup; \
|
||||||
}"
|
}"
|
||||||
atf_add_test_case "route_flags_${name}"
|
atf_add_test_case "route_flags_${name}"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_route.sh,v 1.7 2016/08/10 23:00:39 roy Exp $
|
# $NetBSD: t_route.sh,v 1.10 2016/12/21 02:46:08 ozaki-r Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
# Copyright (c) 2016 Internet Initiative Japan Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,9 +25,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
RUMP_LIBS="-lrumpdev -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif"
|
|
||||||
RUMP_LIBS_IPV6="$RUMP_LIBS -lrumpnet_netinet6"
|
|
||||||
|
|
||||||
# non_subnet_gateway
|
# non_subnet_gateway
|
||||||
SOCK_CLIENT=unix://commsock1
|
SOCK_CLIENT=unix://commsock1
|
||||||
SOCK_GW=unix://commsock2
|
SOCK_GW=unix://commsock2
|
||||||
@ -49,7 +46,7 @@ IP6DST=fc00:0:0:2::2
|
|||||||
BUS_SRCGW=bus1
|
BUS_SRCGW=bus1
|
||||||
BUS_DSTGW=bus2
|
BUS_DSTGW=bus2
|
||||||
|
|
||||||
DEBUG=false
|
DEBUG=${DEBUG:-false}
|
||||||
TIMEOUT=1
|
TIMEOUT=1
|
||||||
PING_OPTS="-n -c 1 -w $TIMEOUT"
|
PING_OPTS="-n -c 1 -w $TIMEOUT"
|
||||||
|
|
||||||
@ -64,13 +61,11 @@ route_non_subnet_gateway_head()
|
|||||||
route_non_subnet_gateway_body()
|
route_non_subnet_gateway_body()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 rump_server ${RUMP_LIBS} ${SOCK_CLIENT}
|
rump_server_start $SOCK_CLIENT
|
||||||
atf_check -s exit:0 rump_server ${RUMP_LIBS} ${SOCK_GW}
|
rump_server_start $SOCK_GW
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCK_GW}
|
export RUMP_SERVER=${SOCK_GW}
|
||||||
|
rump_server_add_iface $SOCK_GW shmif0 $BUS
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.1
|
atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.1
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
|
||||||
@ -81,11 +76,10 @@ route_non_subnet_gateway_body()
|
|||||||
$DEBUG && rump.netstat -nr -f inet
|
$DEBUG && rump.netstat -nr -f inet
|
||||||
|
|
||||||
export RUMP_SERVER=${SOCK_CLIENT}
|
export RUMP_SERVER=${SOCK_CLIENT}
|
||||||
|
rump_server_add_iface $SOCK_CLIENT shmif0 $BUS
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 10.0.0.1/32
|
atf_check -s exit:0 rump.ifconfig shmif0 10.0.0.1/32
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
$DEBUG && rump.netstat -nr -f inet
|
$DEBUG && rump.netstat -nr -f inet
|
||||||
|
|
||||||
@ -104,15 +98,14 @@ route_non_subnet_gateway_body()
|
|||||||
# Be reachable to the gateway
|
# Be reachable to the gateway
|
||||||
atf_check -s exit:0 -o ignore rump.ping $PING_OPTS 192.168.0.1
|
atf_check -s exit:0 -o ignore rump.ping $PING_OPTS 192.168.0.1
|
||||||
|
|
||||||
unset RUMP_SERVER
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
route_non_subnet_gateway_cleanup()
|
route_non_subnet_gateway_cleanup()
|
||||||
{
|
{
|
||||||
|
|
||||||
$DEBUG && shmif_dumpbus -p - $BUS 2>/dev/null | tcpdump -n -e -r -
|
$DEBUG && dump
|
||||||
env RUMP_SERVER=$SOCK_CLIENT rump.halt
|
cleanup
|
||||||
env RUMP_SERVER=$SOCK_GW rump.halt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_test_case route_command_get cleanup
|
atf_test_case route_command_get cleanup
|
||||||
@ -140,8 +133,7 @@ setup_endpoint()
|
|||||||
local gw=${5}
|
local gw=${5}
|
||||||
|
|
||||||
export RUMP_SERVER=${sock}
|
export RUMP_SERVER=${sock}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
rump_server_add_iface $sock shmif0 $bus
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${bus}
|
|
||||||
if [ $mode = "ipv6" ]; then
|
if [ $mode = "ipv6" ]; then
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${addr}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${addr}
|
||||||
atf_check -s exit:0 -o ignore rump.route add -inet6 default ${gw}
|
atf_check -s exit:0 -o ignore rump.route add -inet6 default ${gw}
|
||||||
@ -150,6 +142,7 @@ setup_endpoint()
|
|||||||
atf_check -s exit:0 -o ignore rump.route add default ${gw}
|
atf_check -s exit:0 -o ignore rump.route add default ${gw}
|
||||||
fi
|
fi
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
if $DEBUG; then
|
if $DEBUG; then
|
||||||
rump.ifconfig shmif0
|
rump.ifconfig shmif0
|
||||||
@ -161,13 +154,10 @@ setup_forwarder()
|
|||||||
{
|
{
|
||||||
mode=${1}
|
mode=${1}
|
||||||
|
|
||||||
|
rump_server_add_iface $SOCKFWD shmif0 $BUS_SRCGW
|
||||||
|
rump_server_add_iface $SOCKFWD shmif1 $BUS_DSTGW
|
||||||
|
|
||||||
export RUMP_SERVER=$SOCKFWD
|
export RUMP_SERVER=$SOCKFWD
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS_SRCGW
|
|
||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 create
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 linkstr $BUS_DSTGW
|
|
||||||
|
|
||||||
if [ $mode = "ipv6" ]; then
|
if [ $mode = "ipv6" ]; then
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6SRCGW}
|
atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6SRCGW}
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6DSTGW}
|
atf_check -s exit:0 rump.ifconfig shmif1 inet6 ${IP6DSTGW}
|
||||||
@ -178,6 +168,7 @@ setup_forwarder()
|
|||||||
|
|
||||||
atf_check -s exit:0 rump.ifconfig shmif0 up
|
atf_check -s exit:0 rump.ifconfig shmif0 up
|
||||||
atf_check -s exit:0 rump.ifconfig shmif1 up
|
atf_check -s exit:0 rump.ifconfig shmif1 up
|
||||||
|
atf_check -s exit:0 rump.ifconfig -w 10
|
||||||
|
|
||||||
if $DEBUG; then
|
if $DEBUG; then
|
||||||
rump.netstat -nr
|
rump.netstat -nr
|
||||||
@ -204,9 +195,9 @@ setup_forwarding6()
|
|||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 rump_server $RUMP_LIBS $SOCKSRC
|
rump_server_start $SOCKSRC
|
||||||
atf_check -s exit:0 rump_server $RUMP_LIBS $SOCKFWD
|
rump_server_start $SOCKFWD
|
||||||
atf_check -s exit:0 rump_server $RUMP_LIBS $SOCKDST
|
rump_server_start $SOCKDST
|
||||||
|
|
||||||
setup_endpoint $SOCKSRC $IP4SRC $BUS_SRCGW ipv4 $IP4SRCGW
|
setup_endpoint $SOCKSRC $IP4SRC $BUS_SRCGW ipv4 $IP4SRCGW
|
||||||
setup_endpoint $SOCKDST $IP4DST $BUS_DSTGW ipv4 $IP4DSTGW
|
setup_endpoint $SOCKDST $IP4DST $BUS_DSTGW ipv4 $IP4DSTGW
|
||||||
@ -216,9 +207,9 @@ setup()
|
|||||||
setup6()
|
setup6()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_check -s exit:0 rump_server $RUMP_LIBS_IPV6 $SOCKSRC
|
rump_server_start $SOCKSRC netinet6
|
||||||
atf_check -s exit:0 rump_server $RUMP_LIBS_IPV6 $SOCKFWD
|
rump_server_start $SOCKFWD netinet6
|
||||||
atf_check -s exit:0 rump_server $RUMP_LIBS_IPV6 $SOCKDST
|
rump_server_start $SOCKDST netinet6
|
||||||
|
|
||||||
setup_endpoint $SOCKSRC $IP6SRC $BUS_SRCGW ipv6 $IP6SRCGW
|
setup_endpoint $SOCKSRC $IP6SRC $BUS_SRCGW ipv6 $IP6SRCGW
|
||||||
setup_endpoint $SOCKDST $IP6DST $BUS_DSTGW ipv6 $IP6DSTGW
|
setup_endpoint $SOCKDST $IP6DST $BUS_DSTGW ipv6 $IP6DSTGW
|
||||||
@ -380,6 +371,7 @@ route_command_get_body()
|
|||||||
setup
|
setup
|
||||||
setup_forwarding
|
setup_forwarding
|
||||||
test_route_get
|
test_route_get
|
||||||
|
rump_server_destroy_ifaces
|
||||||
}
|
}
|
||||||
|
|
||||||
route_command_get6_body()
|
route_command_get6_body()
|
||||||
@ -388,36 +380,20 @@ route_command_get6_body()
|
|||||||
setup6
|
setup6
|
||||||
setup_forwarding6
|
setup_forwarding6
|
||||||
test_route_get6
|
test_route_get6
|
||||||
}
|
rump_server_destroy_ifaces
|
||||||
|
|
||||||
dump()
|
|
||||||
{
|
|
||||||
|
|
||||||
env RUMP_SERVER=$SOCKSRC rump.netstat -nr
|
|
||||||
env RUMP_SERVER=$SOCKFWD rump.netstat -nr
|
|
||||||
env RUMP_SERVER=$SOCKDST rump.netstat -nr
|
|
||||||
|
|
||||||
shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r -
|
|
||||||
shmif_dumpbus -p - bus2 2>/dev/null| tcpdump -n -e -r -
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup()
|
|
||||||
{
|
|
||||||
|
|
||||||
env RUMP_SERVER=$SOCKSRC rump.halt
|
|
||||||
env RUMP_SERVER=$SOCKFWD rump.halt
|
|
||||||
env RUMP_SERVER=$SOCKDST rump.halt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
route_command_get_cleanup()
|
route_command_get_cleanup()
|
||||||
{
|
{
|
||||||
|
|
||||||
$DEBUG && dump
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
route_command_get6_cleanup()
|
route_command_get6_cleanup()
|
||||||
{
|
{
|
||||||
dump
|
|
||||||
|
$DEBUG && dump
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_modautoload.c,v 1.4 2015/12/27 08:21:44 pgoyette Exp $ */
|
/* $NetBSD: t_modautoload.c,v 1.5 2016/09/14 03:19:11 ozaki-r Exp $ */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
@ -46,6 +46,7 @@ mountkernfs(void)
|
|||||||
atf_tc_fail_errno("mkdir /kern");
|
atf_tc_fail_errno("mkdir /kern");
|
||||||
|
|
||||||
new_autoload = true;
|
new_autoload = true;
|
||||||
|
old_len = sizeof(old_autoload);
|
||||||
new_len = sizeof(new_autoload);
|
new_len = sizeof(new_autoload);
|
||||||
error = sysctlbyname("kern.module.autoload",
|
error = sysctlbyname("kern.module.autoload",
|
||||||
&old_autoload, &old_len,
|
&old_autoload, &old_len,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_lwproc.c,v 1.7 2015/01/21 15:19:01 pooka Exp $ */
|
/* $NetBSD: t_lwproc.c,v 1.8 2017/01/10 22:36:29 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||||
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <rump/rump.h>
|
#include <rump/rump.h>
|
||||||
#include <rump/rump_syscalls.h>
|
#include <rump/rump_syscalls.h>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: t_print.c,v 1.1 2014/12/02 19:48:21 christos Exp $ */
|
/* $NetBSD: t_print.c,v 1.2 2016/08/27 11:30:49 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014 The NetBSD Foundation, Inc.
|
* Copyright (c) 2014 The NetBSD Foundation, Inc.
|
||||||
@ -29,7 +29,7 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: t_print.c,v 1.1 2014/12/02 19:48:21 christos Exp $");
|
__RCSID("$NetBSD: t_print.c,v 1.2 2016/08/27 11:30:49 christos Exp $");
|
||||||
|
|
||||||
#include "net/dl_print.c"
|
#include "net/dl_print.c"
|
||||||
|
|
||||||
@ -147,6 +147,9 @@ ATF_TC_BODY(sdl_print, tc)
|
|||||||
memcpy(&sdl.sdl_addr, &tst[i].ia, sizeof(sdl.sdl_addr));
|
memcpy(&sdl.sdl_addr, &tst[i].ia, sizeof(sdl.sdl_addr));
|
||||||
sdl.sdl_index = (uint16_t)i;
|
sdl.sdl_index = (uint16_t)i;
|
||||||
r = sdl_print(buf, l, &sdl);
|
r = sdl_print(buf, l, &sdl);
|
||||||
|
if (i == 3)
|
||||||
|
e = snprintf(res, l, "link#%zu", i);
|
||||||
|
else
|
||||||
e = snprintf(res, l, "[%s]:%zu", tst[i].str, i);
|
e = snprintf(res, l, "[%s]:%zu", tst[i].str, i);
|
||||||
ATF_REQUIRE_STREQ(buf, res);
|
ATF_REQUIRE_STREQ(buf, res);
|
||||||
ATF_REQUIRE_EQ(r, e);
|
ATF_REQUIRE_EQ(r, e);
|
||||||
@ -157,6 +160,9 @@ ATF_TC_BODY(sdl_print, tc)
|
|||||||
memcpy(&sdl.sdl_addr, &tst[i].ia, sizeof(sdl.sdl_addr));
|
memcpy(&sdl.sdl_addr, &tst[i].ia, sizeof(sdl.sdl_addr));
|
||||||
sdl.sdl_index = (uint16_t)i;
|
sdl.sdl_index = (uint16_t)i;
|
||||||
r = sdl_print(buf, l, &sdl);
|
r = sdl_print(buf, l, &sdl);
|
||||||
|
if (i == 3)
|
||||||
|
e = snprintf(res, l, "link#%zu", i);
|
||||||
|
else
|
||||||
e = snprintf(res, l, "[%s]:%zu", tst[i].str, i);
|
e = snprintf(res, l, "[%s]:%zu", tst[i].str, i);
|
||||||
ATF_REQUIRE_STREQ(buf, res);
|
ATF_REQUIRE_STREQ(buf, res);
|
||||||
ATF_REQUIRE_EQ(r, e);
|
ATF_REQUIRE_EQ(r, e);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $NetBSD: t_config.sh,v 1.7 2015/10/04 07:59:47 uebayasi Exp $
|
# $NetBSD: t_config.sh,v 1.8 2016/08/27 12:08:14 christos Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
|
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -25,12 +25,32 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
srcdir=..
|
||||||
|
merge_backslash()
|
||||||
|
{
|
||||||
|
sed '
|
||||||
|
: again
|
||||||
|
/\\$/ {
|
||||||
|
N
|
||||||
|
s/\\\n//
|
||||||
|
t again
|
||||||
|
}
|
||||||
|
' "$1"
|
||||||
|
}
|
||||||
run_and_check_prep()
|
run_and_check_prep()
|
||||||
{
|
{
|
||||||
local name="${1}"; shift
|
local name="${1}"; shift
|
||||||
|
|
||||||
mkdir compile
|
mkdir -p compile
|
||||||
supportdir="$(atf_get_srcdir)/support"
|
srcdir="$(atf_get_srcdir)"
|
||||||
|
if [ ! -d "${srcdir}/support" ]; then
|
||||||
|
srcdir="$(dirname "${srcdir}")"
|
||||||
|
if [ ! -d "${srcdir}/support" ]; then
|
||||||
|
atf_fail "bad source directory ${srcdir}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
supportdir="${srcdir}/support"
|
||||||
|
|
||||||
local config_str
|
local config_str
|
||||||
eval config_str=\$${name}_config_str
|
eval config_str=\$${name}_config_str
|
||||||
@ -38,7 +58,7 @@ run_and_check_prep()
|
|||||||
config="d_${name}"
|
config="d_${name}"
|
||||||
printf "$config_str" >"${config}"
|
printf "$config_str" >"${config}"
|
||||||
else
|
else
|
||||||
config="$(atf_get_srcdir)/d_${name}"
|
config="${srcdir}/d_${name}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,28 +141,28 @@ test_case deffs_redef fail "Checks that config doesn't allow a deffs to use" \
|
|||||||
"the same name as a previous defflag/defparam"
|
"the same name as a previous defflag/defparam"
|
||||||
|
|
||||||
# Selecting an undefined option.
|
# Selecting an undefined option.
|
||||||
undefined_opt_config_str='
|
undefined_opt_config_str="
|
||||||
include "../d_min"
|
include \"${srcdir}/d_min\"
|
||||||
options UNDEFINED
|
options UNDEFINED
|
||||||
'
|
"
|
||||||
test_case undefined_opt pass \
|
test_case undefined_opt pass \
|
||||||
"Checks that config allows a selection for an undefined options"
|
"Checks that config allows a selection for an undefined options"
|
||||||
|
|
||||||
# Negating an undefined option.
|
# Negating an undefined option.
|
||||||
no_undefined_opt_config_str='
|
no_undefined_opt_config_str="
|
||||||
include "../d_min"
|
include \"${srcdir}/d_min\"
|
||||||
no options UNDEFINED
|
no options UNDEFINED
|
||||||
'
|
"
|
||||||
no_undefined_opt_stderr='match:UNDEFINED'
|
no_undefined_opt_stderr='match:UNDEFINED'
|
||||||
test_case no_undefined_opt warn \
|
test_case no_undefined_opt warn \
|
||||||
"Checks that config allows a negation for an undefined options"
|
"Checks that config allows a negation for an undefined options"
|
||||||
|
|
||||||
# Attribute selection
|
# Attribute selection
|
||||||
test_case select pass "Attribute selection"
|
test_case select pass "Attribute selection"
|
||||||
select_config_str='
|
select_config_str="
|
||||||
include "../d_min"
|
include \"${srcdir}/d_min\"
|
||||||
select c
|
select c
|
||||||
'
|
"
|
||||||
check_select()
|
check_select()
|
||||||
{
|
{
|
||||||
local f=Makefile
|
local f=Makefile
|
||||||
@ -158,11 +178,11 @@ select_body() {
|
|||||||
|
|
||||||
# Attribute negation
|
# Attribute negation
|
||||||
test_case no_select pass "Attribute negation"
|
test_case no_select pass "Attribute negation"
|
||||||
no_select_config_str='
|
no_select_config_str="
|
||||||
include "../d_min"
|
include \"${srcdir}/d_min\"
|
||||||
select c
|
select c
|
||||||
no select a
|
no select a
|
||||||
'
|
"
|
||||||
check_no_select()
|
check_no_select()
|
||||||
{
|
{
|
||||||
local f=Makefile
|
local f=Makefile
|
||||||
@ -181,10 +201,10 @@ no_select_body() {
|
|||||||
|
|
||||||
# Device instance
|
# Device instance
|
||||||
test_case devi pass "Device instance"
|
test_case devi pass "Device instance"
|
||||||
devi_config_str='
|
devi_config_str="
|
||||||
include "../d_min"
|
include \"${srcdir}/d_min\"
|
||||||
d0 at root
|
d0 at root
|
||||||
'
|
"
|
||||||
check_devi()
|
check_devi()
|
||||||
{
|
{
|
||||||
local f=ioconf.c
|
local f=ioconf.c
|
||||||
@ -226,9 +246,7 @@ check_min_makefile()
|
|||||||
grep -q '^%' $f >tmp.template
|
grep -q '^%' $f >tmp.template
|
||||||
|
|
||||||
grep -q '^MACHINE=regress$' $f &&
|
grep -q '^MACHINE=regress$' $f &&
|
||||||
grep -q '^PARAM=-DMAXUSERS=4$' $f &&
|
(merge_backslash $f | grep -q '^IDENT=[ ]*-DMAXUSERS="4"') &&
|
||||||
grep -q '^all: regress$' $f &&
|
|
||||||
grep -q '^regress:' $f &&
|
|
||||||
[ ! -s tmp.template ] &&
|
[ ! -s tmp.template ] &&
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# $NetBSD: t_netpgpverify.sh,v 1.3 2016/06/01 06:39:11 agc Exp $
|
# $NetBSD: t_netpgpverify.sh,v 1.4 2016/08/28 15:59:15 christos Exp $
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 The NetBSD Foundation, Inc.
|
# Copyright (c) 2016 The NetBSD Foundation, Inc.
|
||||||
@ -525,7 +525,7 @@ StZtC+VbuN66pfHwsAIAAw==
|
|||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
begin-base64 644 NetBSD-6.0_hashes.asc.gz
|
begin-base64 644 NetBSD-6.0_hashes.asc.gz
|
||||||
H4sICAAAAAACA05ldEJTRC02LjBfaGFzaGVzLmFzYwDUvduOXceVpX3deoq87B8o
|
H4sICLYIw1cCA05ldEJTRC02LjBfaGFzaGVzLmFzYwDUvduOXceVpX3deoq87B8o
|
||||||
y3E+NNDA7yqrXQZKsmHZQN8V4igTRYkCSVWV++n7G4tMcu9kZnJlSgW4SYsmM3fG
|
y3E+NNDA7yqrXQZKsmHZQN8V4igTRYkCSVWV++n7G4tMcu9kZnJlSgW4SYsmM3fG
|
||||||
ihUz5pxjRMzDr37Fr3/86ne//+bmj7/74823v//dN1/99ubrr7799je/+0rf+9UX
|
ihUz5pxjRMzDr37Fr3/86ne//+bmj7/74823v//dN1/99ubrr7799je/+0rf+9UX
|
||||||
/9ze/PV/3Hz7z7+xX/Drz39dN/vVy5ev/uPFD9/dvHhz027Gq+9/fLnerpuXL968
|
/9ze/PV/3Hz7z7+xX/Drz39dN/vVy5ev/uPFD9/dvHhz027Gq+9/fLnerpuXL968
|
||||||
@ -6708,223 +6708,223 @@ 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
|
/GT7l6b4IzOiSzqEbJXLa80Eeffmy3FTPqnPntz/bb4/HveTGMxUQylCOdmFsLGo
|
||||||
r1apDdenRypwK92mKxjztSegAZcpUJs2r0WvrVOCstVVlAxM9MZhNFJ4HkZ+edCn
|
V6vUhuvTIxW4lW7TFYz52hPQgMsUqE2b16LX1ilB2eoqSgYmeuMwGik8DyO/POjT
|
||||||
jSZjgIpl5WZWgglv7OLeNlWr/ZeHhY0Yne29TWltW0kto0XpquCS4nJpZjYLc9UV
|
RpMxQMWycjMrwYQ3dnFvm6rV/svDwkaMzvbeprS2raSW0aJ0VXBJcbk0M5uFueoK
|
||||||
zPnazOUKw1bQ8B4brFhWqG1pgSzNuZdE5XuKyeejBn1teHnCTM4yo0NYvIWsdy/B
|
5nxt5nKFYStoeI8NViwr1La0QJbm3Eui8j3F5PNRg742vDxhJmeZ0SEs3kLWu5fg
|
||||||
jY0m6H51k74CtZDnaR8U5Ql7MiF0XutQBoBY7jTCJpumv97BpC+foF1D9fyS80oD
|
xkYTdL+6SV+BWsjztA+K8oQ9mRA6r3UoA0Asdxphk03TX+9g0pdP0K6hen7JeaUB
|
||||||
wrjNbyiQLwtHoVW8ywn9EB+4ojBCqcXKOXMcu8vJocQVAuS1icxEX9MV5C09Jx3a
|
YdzmNxTIl4Wj0Cre5YR+iA9cURih1GLlnDmO3eXkUOIKAfLaRGair+kK8paekw5t
|
||||||
iArASFk6oV8TvUdoYoOjk2P+Wc27mPTlzD0cGxlJRvAVTBilyaUrBG09dgFF1Gy0
|
RAVgpCyd0K+J3iM0scHRyTH/rOZdTPpy5h6OjYwkI/gKJozS5NIVgrYeu4AiajZa
|
||||||
nq5q0pfD08BpTEibFqTlEl1vH7JQgnyCqc5e2aTPTzp9phtclbbVVtLOqEn7oHgX
|
T1c16cvhaeA0JqRNC9Jyia63D1koQT7BVGevbNLnJ50+0w2uSttqK2ln1KR9ULwL
|
||||||
6BtqlvOzcdFd4iXj03+klMEFBOkLFZMZaFtRiUL1tVGd73eZvb0sp3ID5QYcqlBf
|
9A01y/nZuOgu8ZLx6T9SyuACgvSFiskMtK2oRKH62qjO97vM3l6WU7mBcgMOVaiv
|
||||||
IbKbmpawcr20mR44pVVKKccSBTxbFu4UtChRI1UIseROrGsW/Se3KZC8gzmfnzAb
|
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
|
FtbC0ccwQdCqxqi8vB0165lJI1owIKxS4B8QhEFwsHP1CT53jtaE/RRrDpny7Oco
|
||||||
ZtJ0m0CDHFrbFNx9F/gQFBHQP0966vwhXwqnWL/JImvnfq+2urQfbWj63sb9JLis
|
M2m6TaBBDq1tCu6+C3wIigjonyc9df6QL4VTrN9kkbVzv1dbXdqPNjR9b+N+ElxW
|
||||||
pkQwHTfdy4GF4JSEjIqQkaWgcyn3sRTU6rvHbQOVKtaXqFzOUX4XDK4YXbygFEwg
|
UyKYjpvu5cBCcEpCRkXIyFLQuZT7WApq9d3jtoFKFetLVC7nKL8LBleMLl5QCiaQ
|
||||||
ifvt4maQC7R652KmfpNvXDysvX7Z+Ox6tZo88rIniTdHjV5ffR4328sJzzYiW3yD
|
xP12cTPIBVq9czFTv8k3Lh7WXr9sfHa9Wk0eedmTxJujRq+vPo+b7eWEZxuRLb7B
|
||||||
217BKis6VWA0DdJOa0ERRYHWHzTZy1HpLxacb80pPZOpWszdCHySpyStu2v/mz8+
|
ba9glRWdKjCaBmmntaCIokDrD5rs5aj0FwvOt+aUnslULeZuBD7JU5LW3bX/zR8f
|
||||||
/OiTW1/8484nd/7x9a1Pvrj+zb+++mj/9Wvfzie/arz/849PHj6988k/frfv+/ft
|
3vr49uf/uPvx3X98dfvjz69//a8vb+2/fu2b+eRXjfd//vHxo6d3P/7H7/Z9/779
|
||||||
n+b9X9eu3bt7q394/aMPr/94/ZMP7352d918+Mn1648+++j6D5/1+Pzzrx9++PRx
|
07z/69q1+/du9w+v3/rw+g/XP/7w3qf31s1HH1+//vjTW9e//7TH55999ejDp7+U
|
||||||
uX7nA/sw/fzw3sOH8/aX927cvxm++ua38XWJ1369/7ymm+17+3zkH279872fHvT/
|
63c/sI/ST4/uP3o073xx/8aDm+HLr38bX5V47dcHz2u62b6zz0f+/vY/3/vxYf/P
|
||||||
/PD0yYPHj2/PD8dP0f14/Z83H8Vvf7n+69fti099+MrcauXJi98/u/fs65++un0t
|
90+fPPzllzvzw/FjdD9c/+fNx/Gbn6//+lX7/BMfvjS3W3ny4vdP7z/76scv71xL
|
||||||
3fn0zuN79397/uP1Gx9/6//VHzz51/ff/fbre3eex+tf57vPP19P//njV8+emtsf
|
dz+5+8v9B789/+H6jY++8f/qD5/867tvf/v1vbvP4/Wv8r3nn62n//zhy2dPzZ1b
|
||||||
ffPvzx8+/Sp/8p9fyr9vxue3Pnlcn1376ZNwZz18/Ov2+Lt75e4HyTz95sHPn/34
|
X//7s0dPv8wf/+fn8u+b8fntj3+pz679+HG4ux798uv2y7f3y70Pknn69cOfPv3h
|
||||||
wN376P4Ht7/+bdz843n/+dPt2wfz/m/XP3n+2fPH33777G78/pfrT8ML+8O1L7/9
|
obt/68EHd776bdz843n/6ZPtm4fzwW/XP37+6fNfvvnm2b343c/Xn4YX9vtrX3zz
|
||||||
/OdHPzz6an48b9775ofrf4xlvn3x+7M/1s+fPr3z+/e315f5h/fu/Oenj9uj6/9a
|
2U+Pv3/85fxo3rz/9ffX/xjLfPPi92d/rJ8+eXr39+/urC/y9+/d/c+PH7XH1/+1
|
||||||
T2/dvvVlvrke3L+brocvP/zl2qOPPrptHz68z/1Zuf3dneu/3/K32vfr26c37KPt
|
nt6+c/uLfHM9fHAvXQ9ffPjztce3bt2xjx494P6s3Pn27vXfb/vb7bv1zdMb9vH2
|
||||||
yUf//vmfn74ov3/4/NPb9+6s8vXzf/rv73/Rfnj0Yt7//tfPb177j/3iu+9+84/j
|
5Na/f/rnJy/K7x8+/+TO/burfPX8n/67B5+37x+/mA+++/Wzm9f+Yz//9tvf/C/x
|
||||||
w5v+4Sd365d3/vhKEeEL88N3D57eeC/261/ffe/rJz8/+cDc/az9+uGzH3/7/unt
|
0U3/6ON79Yu7f3ypiPC5+f7bh09vvBf79a/uvffVk5+efGDufdp+/fDZD7999/TO
|
||||||
F3X7/dkXv5p7N67d+jibO/+09+7cv3nn52Vv3H345Q+PP/vpt3+t35W6Xe/6bfnR
|
i7r9/uzzX839G9duf5TN3X/a+3cf3Lz707I37j364vtfPv3xt3+t35W6Xe/6bfnx
|
||||||
vcfv/fbo1oMfv/zp1rMbLz6++/H99eDhH+WXr27/cu2Df3/5/NnH/873Xtxo8Zen
|
/V/e++3x7Yc/fPHj7Wc3Xnx076MH6+GjP8rPX975+doH//7i+bOP/p3vv7jR4s9P
|
||||||
5gP3z8+3G18//e3ZzY9++irdivX6wxg+/Pg7c6/Gb/4I9cUq9259/OX1W+3FXD99
|
zQfun59tN756+tuzm7d+/DLdjvX6oxg+/Ohbc7/Gr/8I9cUq929/9MX12+3FXD9+
|
||||||
eu36HXvjs9sPXfz9x9/6wz8++KrcfjpvPfsgmE8f/bQ9efLxk5uPX9zIP3/+ONx3
|
cu36XXvj0zuPXPz9h9/6oz8++LLceTpvP/sgmE8e/7g9efLRk5u/vLiRf/rsl/DA
|
||||||
dx7M337+wM/HT3/+9ql87ntP+zVz/5t7Xzy78WmLP/z+9NGXpCsPntz66KPP7nz0
|
3X04f/vpAz9/efrTN0/lc9972q+ZB1/f//zZjU9a/P73p4+/IF15+OT2rVuf3r31
|
||||||
/Yzx+/7z/XLvsxeP3rt+zz78z4379sObX/zw8H558Wm79ezOrbvX4h93f3x+49M7
|
3Yzxu/7Tg3L/0xeP37t+3z76z40H9sObn3//6EF58Um7/ezu7XvX4h/3fnh+45O7
|
||||||
5Yv5xwfmvv32vV8/vvZ/H376fb/2/wGUHa4t0v0NAA==
|
5fP5xwfmgf3mvV8/uvZ/H33yXT/ZJLc+v3neFvn/qZKFEe79DQA=
|
||||||
====
|
====
|
||||||
EOF
|
EOF
|
||||||
gunzip NetBSD-6.0_hashes.asc.gz
|
gunzip NetBSD-6.0_hashes.asc.gz
|
||||||
@ -6958,18 +6958,15 @@ YzFlNiBiZjcxIDg4NDUgNDE2YiA5NTIyIDc5ZGUgYjYxZSA0ODhlIGVlNzQgCgo=
|
|||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
begin-base64 644 expected18
|
begin-base64 644 expected18
|
||||||
R29vZCBzaWduYXR1cmUgZm9yIGdwZ3NpZ25lZC1hLmdwZyBtYWRlIFN1biBTZXAg
|
R29vZCBzaWduYXR1cmUgZm9yIGEuZ3BnIG1hZGUgVHVlIE1heSAzMSAyMzoyOTox
|
||||||
IDkgMTc6NDM6MDEgMjAxMgpzaWduYXR1cmUgIDIwNDgvUlNBIChFbmNyeXB0IG9y
|
MCAyMDE2CnNpZ25hdHVyZSAgICAgMjA0OC9SU0EgKEVuY3J5cHQgb3IgU2lnbikg
|
||||||
IFNpZ24pIDFiNjhkY2ZjYzA1OTY4MjMgMjAwNC0wMS0xMgpmaW5nZXJwcmludDog
|
MWI2OGRjZmNjMDU5NjgyMyAyMDA0LTAxLTEyCmZpbmdlcnByaW50ICAgZDQxNSA5
|
||||||
IGQ0MTUgOWRlYiAzMzZkIGU0Y2MgY2RmYSAwMGNkIDFiNjggZGNmYyBjMDU5IDY4
|
ZGViIDMzNmQgZTRjYyBjZGZhIDAwY2QgMWI2OCBkY2ZjIGMwNTkgNjgyMyAKdWlk
|
||||||
MjMgCnVpZCAgICAgICAgICAgICAgQWxpc3RhaXIgQ3Jvb2tzIDxhZ2NAYWxpc3Rh
|
ICAgICAgICAgICBBbGlzdGFpciBDcm9va3MgPGFnY0BhbGlzdGFpcmNyb29rcy5j
|
||||||
aXJjcm9va3MuY29tPgp1aWQgICAgICAgICAgICAgIEFsaXN0YWlyIENyb29rcyA8
|
b20+CnVpZCAgICAgICAgICAgQWxpc3RhaXIgQ3Jvb2tzIDxhZ2NAcGtnc3JjLm9y
|
||||||
YWdjQHBrZ3NyYy5vcmc+CnVpZCAgICAgICAgICAgICAgQWxpc3RhaXIgQ3Jvb2tz
|
Zz4KdWlkICAgICAgICAgICBBbGlzdGFpciBDcm9va3MgPGFnY0BuZXRic2Qub3Jn
|
||||||
IDxhZ2NAbmV0YnNkLm9yZz4KdWlkICAgICAgICAgICAgICBBbGlzdGFpciBDcm9v
|
Pgp1aWQgICAgICAgICAgIEFsaXN0YWlyIENyb29rcyA8YWdjQG5ldGZsaXguY29t
|
||||||
a3MgPGFnY0BuZXRmbGl4LmNvbT4KZW5jcnlwdGlvbiAyMDQ4L1JTQSAoRW5jcnlw
|
PgoK
|
||||||
dCBvciBTaWduKSA3OWRlYjYxZTQ4OGVlZTc0IDIwMDQtMDEtMTIKZmluZ2VycHJp
|
|
||||||
bnQ6ICA1N2MwIGMxZTYgYmY3MSA4ODQ1IDQxNmIgOTUyMiA3OWRlIGI2MWUgNDg4
|
|
||||||
ZSBlZTc0IAoK
|
|
||||||
====
|
====
|
||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
@ -6995,18 +6992,15 @@ aW5hcnkvdGV4dApiIGxlbmd0aApjIHN0cmluZwpMIG10aW1lCnRleHQK
|
|||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
begin-base64 644 expected21
|
begin-base64 644 expected21
|
||||||
R29vZCBzaWduYXR1cmUgZm9yIFtzdGRpbl0gbWFkZSBTdW4gU2VwICA5IDE3OjQ0
|
R29vZCBzaWduYXR1cmUgZm9yIFtzdGRpbl0gbWFkZSBUdWUgTWF5IDMxIDIzOjI5
|
||||||
OjExIDIwMTIKc2lnbmF0dXJlICAyMDQ4L1JTQSAoRW5jcnlwdCBvciBTaWduKSAx
|
OjEwIDIwMTYKc2lnbmF0dXJlICAgICAyMDQ4L1JTQSAoRW5jcnlwdCBvciBTaWdu
|
||||||
YjY4ZGNmY2MwNTk2ODIzIDIwMDQtMDEtMTIKZmluZ2VycHJpbnQ6ICBkNDE1IDlk
|
KSAxYjY4ZGNmY2MwNTk2ODIzIDIwMDQtMDEtMTIKZmluZ2VycHJpbnQgICBkNDE1
|
||||||
ZWIgMzM2ZCBlNGNjIGNkZmEgMDBjZCAxYjY4IGRjZmMgYzA1OSA2ODIzIAp1aWQg
|
IDlkZWIgMzM2ZCBlNGNjIGNkZmEgMDBjZCAxYjY4IGRjZmMgYzA1OSA2ODIzIAp1
|
||||||
ICAgICAgICAgICAgIEFsaXN0YWlyIENyb29rcyA8YWdjQGFsaXN0YWlyY3Jvb2tz
|
aWQgICAgICAgICAgIEFsaXN0YWlyIENyb29rcyA8YWdjQGFsaXN0YWlyY3Jvb2tz
|
||||||
LmNvbT4KdWlkICAgICAgICAgICAgICBBbGlzdGFpciBDcm9va3MgPGFnY0Bwa2dz
|
LmNvbT4KdWlkICAgICAgICAgICBBbGlzdGFpciBDcm9va3MgPGFnY0Bwa2dzcmMu
|
||||||
cmMub3JnPgp1aWQgICAgICAgICAgICAgIEFsaXN0YWlyIENyb29rcyA8YWdjQG5l
|
b3JnPgp1aWQgICAgICAgICAgIEFsaXN0YWlyIENyb29rcyA8YWdjQG5ldGJzZC5v
|
||||||
dGJzZC5vcmc+CnVpZCAgICAgICAgICAgICAgQWxpc3RhaXIgQ3Jvb2tzIDxhZ2NA
|
cmc+CnVpZCAgICAgICAgICAgQWxpc3RhaXIgQ3Jvb2tzIDxhZ2NAbmV0ZmxpeC5j
|
||||||
bmV0ZmxpeC5jb20+CmVuY3J5cHRpb24gMjA0OC9SU0EgKEVuY3J5cHQgb3IgU2ln
|
b20+Cgo=
|
||||||
bikgNzlkZWI2MWU0ODhlZWU3NCAyMDA0LTAxLTEyCmZpbmdlcnByaW50OiAgNTdj
|
|
||||||
MCBjMWU2IGJmNzEgODg0NSA0MTZiIDk1MjIgNzlkZSBiNjFlIDQ4OGUgZWU3NCAK
|
|
||||||
Cg==
|
|
||||||
====
|
====
|
||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
@ -7123,18 +7117,15 @@ MDIwNSA5ZmYyIGMyNGYgZGYyYyBlNjIwIAoK
|
|||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
begin-base64 644 expected31
|
begin-base64 644 expected31
|
||||||
YmVnaW4tYmFzZTY0IDY0NCBleHBlY3RlZDMxClVGSlBSejF3Q2xOU1ExTTljR0Z5
|
UFJPRz1wClNSQ1M9cGFyc2UuYwpXQVJOUz01Ck1LTUFOPW5vCkNQUEZMQUdTKz0t
|
||||||
YzJVdVl3cFhRVkpPVXowMUNrMUxUVUZPUFc1dkNrTlFVRVpNUVVkVEt6MHQKWnlB
|
ZyAtTzAKTERGTEFHUys9LWcgLU8wCgouaW5jbHVkZSA8YnNkLnByb2cubWs+Cgp0
|
||||||
dFR6QUtURVJHVEVGSFV5czlMV2NnTFU4d0Nnb3VhVzVqYkhWa1pTQThZbk5rTG5C
|
OiAke1BST0d9CgkuLyR7UFJPR30gZ3Bnc2lnbmVkLWEuZ3BnClBST0c9cApTUkNT
|
||||||
eWIyY3ViV3MrQ2dwMApPaUFrZTFCU1QwZDlDZ2t1THlSN1VGSlBSMzBnWjNCbmMy
|
PXBhcnNlLmMKV0FSTlM9NQpNS01BTj1ubwpDUFBGTEFHUys9LWcgLU8wCkxERkxB
|
||||||
bG5ibVZrTFdFdVozQm5DbEJTVDBjOWNBcFRVa05UClBYQmhjbk5sTG1NS1YwRlNU
|
R1MrPS1nIC1PMAoKLmluY2x1ZGUgPGJzZC5wcm9nLm1rPgoKdDogJHtQUk9HfQoJ
|
||||||
bE05TlFwTlMwMUJUajF1YndwRFVGQkdURUZIVXlzOUxXY2dMVTh3Q2t4RVJreEIK
|
Li8ke1BST0d9IGdwZ3NpZ25lZC1hLmdwZwpQUk9HPXAKU1JDUz1wYXJzZS5jCldB
|
||||||
UjFNclBTMW5JQzFQTUFvS0xtbHVZMngxWkdVZ1BHSnpaQzV3Y205bkxtMXJQZ29L
|
Uk5TPTUKTUtNQU49bm8KQ1BQRkxBR1MrPS1nIC1PMApMREZMQUdTKz0tZyAtTzAK
|
||||||
ZERvZ0pIdFFVazlIZlFvSgpMaThrZTFCU1QwZDlJR2R3WjNOcFoyNWxaQzFoTG1k
|
Ci5pbmNsdWRlIDxic2QucHJvZy5taz4KCnQ6ICR7UFJPR30KCS4vJHtQUk9HfSBn
|
||||||
d1p3cFFVazlIUFhBS1UxSkRVejF3WVhKelpTNWpDbGRCClVrNVRQVFVLVFV0TlFV
|
cGdzaWduZWQtYS5ncGcK
|
||||||
NDlibThLUTFCUVJreEJSMU1yUFMxbklDMVBNQXBNUkVaTVFVZFRLejB0WnlBdFR6
|
|
||||||
QUsKQ2k1cGJtTnNkV1JsSUR4aWMyUXVjSEp2Wnk1dGF6NEtDblE2SUNSN1VGSlBS
|
|
||||||
MzBLQ1M0dkpIdFFVazlIZlNCbgpjR2R6YVdkdVpXUXRZUzVuY0djSwo9PT09Cg==
|
|
||||||
====
|
====
|
||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
@ -7168,20 +7159,16 @@ aXguY29tPgoK
|
|||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
begin-base64 644 expected33
|
begin-base64 644 expected33
|
||||||
YmVnaW4tYmFzZTY0IDY0NCBleHBlY3RlZDMzClVGSlBSejF3Q2xOU1ExTTljR0Z5
|
UFJPRz1wClNSQ1M9cGFyc2UuYwpXQVJOUz01Ck1LTUFOPW5vCkNQUEZMQUdTKz0t
|
||||||
YzJVdVl3cFhRVkpPVXowMUNrMUxUVUZPUFc1dkNrTlFVRVpNUVVkVEt6MHQKWnlB
|
ZyAtTzAKTERGTEFHUys9LWcgLU8wCgouaW5jbHVkZSA8YnNkLnByb2cubWs+Cgp0
|
||||||
dFR6QUtURVJHVEVGSFV5czlMV2NnTFU4d0Nnb3VhVzVqYkhWa1pTQThZbk5rTG5C
|
OiAke1BST0d9CgkuLyR7UFJPR30gZ3Bnc2lnbmVkLWEuZ3BnCjEuIHRhZyAmIDB4
|
||||||
eWIyY3ViV3MrQ2dwMApPaUFrZTFCU1QwZDlDZ2t1THlSN1VGSlBSMzBnWjNCbmMy
|
M2YKMi4gbGVuCgpvbmUgcGFzcyAodGFnIDQpCj09PT09PT09CmIgdmVyc2lvbjoz
|
||||||
bG5ibVZrTFdFdVozQm5DakV1SUhSaFp5QW1JREI0Ck0yWUtNaTRnYkdWdUNncHZi
|
CmIgc2lnIHR5cGUKYiBoYXNoIGFsZwpiIHB1YmtleSBhbGcKOGIga2V5aWQKCmxp
|
||||||
bVVnY0dGemN5QW9kR0ZuSURRcENqMDlQVDA5UFQwOUNtSWdkbVZ5YzJsdmJqb3oK
|
dGVyYWwgZGF0YSAodGFnIDExKQo9PT09PT09PT09PT09CmIgYmluYXJ5L3RleHQK
|
||||||
Q21JZ2MybG5JSFI1Y0dVS1lpQm9ZWE5vSUdGc1p3cGlJSEIxWW10bGVTQmhiR2NL
|
YiBsZW5ndGgKYyBzdHJpbmcKTCBtdGltZQp0ZXh0ClBST0c9cApTUkNTPXBhcnNl
|
||||||
T0dJZ2EyVjVhV1FLQ214cApkR1Z5WVd3Z1pHRjBZU0FvZEdGbklERXhLUW85UFQw
|
LmMKV0FSTlM9NQpNS01BTj1ubwpDUFBGTEFHUys9LWcgLU8wCkxERkxBR1MrPS1n
|
||||||
OVBUMDlQVDA5UFQwOUNtSWdZbWx1WVhKNUwzUmxlSFFLCllpQnNaVzVuZEdnS1l5
|
IC1PMAoKLmluY2x1ZGUgPGJzZC5wcm9nLm1rPgoKdDogJHtQUk9HfQoJLi8ke1BS
|
||||||
QnpkSEpwYm1jS1RDQnRkR2x0WlFwMFpYaDBDbEJTVDBjOWNBcFRVa05UUFhCaGNu
|
T0d9IGdwZ3NpZ25lZC1hLmdwZwo=
|
||||||
TmwKTG1NS1YwRlNUbE05TlFwTlMwMUJUajF1YndwRFVGQkdURUZIVXlzOUxXY2dM
|
|
||||||
VTh3Q2t4RVJreEJSMU1yUFMxbgpJQzFQTUFvS0xtbHVZMngxWkdVZ1BHSnpaQzV3
|
|
||||||
Y205bkxtMXJQZ29LZERvZ0pIdFFVazlIZlFvSkxpOGtlMUJTClQwZDlJR2R3WjNO
|
|
||||||
cFoyNWxaQzFoTG1kd1p3bz0KPT09PQo=
|
|
||||||
====
|
====
|
||||||
EOF
|
EOF
|
||||||
uudecode << EOF
|
uudecode << EOF
|
||||||
@ -7207,13 +7194,12 @@ IG5ldHBncHZlcmlmeQo=
|
|||||||
====
|
====
|
||||||
EOF
|
EOF
|
||||||
atf_check -s eq:0 -o file:expected16 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify b.gpg
|
atf_check -s eq:0 -o file:expected16 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify b.gpg
|
||||||
atf_check -s eq:0 -o file:2.expected -e empty b2e < 2.in
|
atf_check -s eq:0 -o file:expected18 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify a.gpg
|
||||||
atf_check -s eq:0 -o file:expected18 -e empty env TZ=US/Pacific netpgpverify -c verify a.gpg
|
# atf_check -s eq:0 -o file:expected19 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify NetBSD-6.0_RC2_hashes.asc
|
||||||
atf_check -s eq:0 -o file:expected19 -e empty env TZ=US/Pacific netpgpverify -c verify NetBSD-6.0_RC2_hashes.asc
|
|
||||||
atf_check -s eq:0 -o file:expected20 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat jj.asc
|
atf_check -s eq:0 -o file:expected20 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat jj.asc
|
||||||
atf_check -s eq:0 -o file:expected21 -e empty env TZ=US/Pacific netpgpverify < a.gpg
|
atf_check -s eq:0 -o file:expected21 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < a.gpg
|
||||||
atf_check -s eq:0 -o file:expected22 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < jj.asc
|
atf_check -s eq:0 -o file:expected22 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < jj.asc
|
||||||
atf_check -s eq:0 -o file:expected23 -e empty env TZ=US/Pacific netpgpverify < NetBSD-6.0_RC2_hashes.asc
|
# atf_check -s eq:0 -o file:expected23 -e empty env TZ=US/Pacific netpgpverify < NetBSD-6.0_RC2_hashes.asc
|
||||||
atf_check -s eq:0 -o file:expected24 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < b.gpg
|
atf_check -s eq:0 -o file:expected24 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < b.gpg
|
||||||
#atf_check -s eq:0 -o file:expected25 -e empty netpgpverify NetBSD-6.0_RC1_hashes.gpg
|
#atf_check -s eq:0 -o file:expected25 -e empty netpgpverify NetBSD-6.0_RC1_hashes.gpg
|
||||||
#atf_check -s eq:0 -o file:expected26 -e empty netpgpverify < NetBSD-6.0_RC1_hashes.gpg
|
#atf_check -s eq:0 -o file:expected26 -e empty netpgpverify < NetBSD-6.0_RC1_hashes.gpg
|
||||||
@ -7225,7 +7211,7 @@ EOF
|
|||||||
atf_check -s eq:0 -o file:expected32 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg b.gpg b.gpg b.gpg
|
atf_check -s eq:0 -o file:expected32 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg b.gpg b.gpg b.gpg
|
||||||
atf_check -s eq:0 -o file:expected33 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg jj.asc b.gpg
|
atf_check -s eq:0 -o file:expected33 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg jj.asc b.gpg
|
||||||
atf_check -s eq:0 -o file:expected34 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg det.sig
|
atf_check -s eq:0 -o file:expected34 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg det.sig
|
||||||
atf_check -s eq:0 -o file:expected35 -e empty env TZ=US/Pacific netpgpverify -c cat -k pubring.gpg det.sig
|
atf_check -s eq:0 -o file:expected35 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat det.sig
|
||||||
#atf_check -s eq:0 -o file:expected46 -e empty netpgpverify -k problem-pubring.gpg NetBSD-6.0_hashes.asc
|
#atf_check -s eq:0 -o file:expected46 -e empty netpgpverify -k problem-pubring.gpg NetBSD-6.0_hashes.asc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_union.c
Normal file
16
contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_union.c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/* struct with only anonymous members */
|
||||||
|
|
||||||
|
struct foo {
|
||||||
|
union {
|
||||||
|
long loo;
|
||||||
|
double doo;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
main(void) {
|
||||||
|
|
||||||
|
struct foo *f = 0;
|
||||||
|
printf("%p\n", &f[1]);
|
||||||
|
return 0;
|
||||||
|
}
|
18
contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_cast.c
Normal file
18
contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_cast.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/* union cast */
|
||||||
|
|
||||||
|
struct bar {
|
||||||
|
int a;
|
||||||
|
int b;
|
||||||
|
};
|
||||||
|
|
||||||
|
union foo {
|
||||||
|
struct bar *a;
|
||||||
|
int b;
|
||||||
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
foo(void) {
|
||||||
|
struct bar *a;
|
||||||
|
|
||||||
|
((union foo)a).a;
|
||||||
|
}
|
@ -13,6 +13,8 @@ NETBSD_ATF_TESTS_C+= db_hash_seq_test
|
|||||||
NETBSD_ATF_TESTS_SH+= db_test
|
NETBSD_ATF_TESTS_SH+= db_test
|
||||||
ATF_TESTS_SH_SED_db_test= -e 's,/bin/csh,/bin/cat,g'
|
ATF_TESTS_SH_SED_db_test= -e 's,/bin/csh,/bin/cat,g'
|
||||||
|
|
||||||
|
CFLAGS+= -I${SRCTOP}/lib/libc/db/btree
|
||||||
|
|
||||||
.include "../Makefile.netbsd-tests"
|
.include "../Makefile.netbsd-tests"
|
||||||
|
|
||||||
.include <bsd.test.mk>
|
.include <bsd.test.mk>
|
||||||
|
@ -13,10 +13,20 @@ ATF_TESTS_C+= posix_spawn_test
|
|||||||
ATF_TESTS_C+= wordexp_test
|
ATF_TESTS_C+= wordexp_test
|
||||||
ATF_TESTS_C+= dlopen_empty_test
|
ATF_TESTS_C+= dlopen_empty_test
|
||||||
|
|
||||||
# TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, t_sleep
|
# TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid,
|
||||||
# TODO: t_siginfo (fixes require further inspection)
|
# TODO: t_siginfo (fixes require further inspection)
|
||||||
# TODO: t_sethostname_test (consistently screws up the hostname)
|
# TODO: t_sethostname_test (consistently screws up the hostname)
|
||||||
|
|
||||||
|
CFLAGS+= -DTEST_LONG_DOUBLE
|
||||||
|
|
||||||
|
# Not sure why this isn't defined for all architectures, since most
|
||||||
|
# have long double.
|
||||||
|
.if ${MACHINE_CPUARCH} == "aarch64" || \
|
||||||
|
${MACHINE_CPUARCH} == "amd64" || \
|
||||||
|
${MACHINE_CPUARCH} == "i386"
|
||||||
|
CFLAGS+= -D__HAVE_LONG_DOUBLE
|
||||||
|
.endif
|
||||||
|
|
||||||
NETBSD_ATF_TESTS_C= alarm_test
|
NETBSD_ATF_TESTS_C= alarm_test
|
||||||
NETBSD_ATF_TESTS_C+= assert_test
|
NETBSD_ATF_TESTS_C+= assert_test
|
||||||
NETBSD_ATF_TESTS_C+= basedirname_test
|
NETBSD_ATF_TESTS_C+= basedirname_test
|
||||||
|
@ -61,8 +61,12 @@ NETBSD_ATF_TESTS_C+= ucontext_test
|
|||||||
NETBSD_ATF_TESTS_C+= umask_test
|
NETBSD_ATF_TESTS_C+= umask_test
|
||||||
NETBSD_ATF_TESTS_C+= unlink_test
|
NETBSD_ATF_TESTS_C+= unlink_test
|
||||||
NETBSD_ATF_TESTS_C+= wait_test
|
NETBSD_ATF_TESTS_C+= wait_test
|
||||||
|
NETBSD_ATF_TESTS_C+= wait_noproc_test
|
||||||
|
NETBSD_ATF_TESTS_C+= wait_noproc_wnohang_test
|
||||||
NETBSD_ATF_TESTS_C+= write_test
|
NETBSD_ATF_TESTS_C+= write_test
|
||||||
|
|
||||||
|
CSTD?= c99
|
||||||
|
|
||||||
LIBADD.getpid_test+= pthread
|
LIBADD.getpid_test+= pthread
|
||||||
LIBADD.timer_create_test+= rt
|
LIBADD.timer_create_test+= rt
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ NETBSD_ATF_TESTS_C+= sleep_test
|
|||||||
.if ${MACHINE} != "arm64" # ARM64TODO: Missing makecontext
|
.if ${MACHINE} != "arm64" # ARM64TODO: Missing makecontext
|
||||||
NETBSD_ATF_TESTS_C+= swapcontext_test
|
NETBSD_ATF_TESTS_C+= swapcontext_test
|
||||||
.endif
|
.endif
|
||||||
|
NETBSD_ATF_TESTS_C+= timedmutex_test
|
||||||
|
|
||||||
NETBSD_ATF_TESTS_SH= atexit_test
|
NETBSD_ATF_TESTS_SH= atexit_test
|
||||||
NETBSD_ATF_TESTS_SH+= cancel_test
|
NETBSD_ATF_TESTS_SH+= cancel_test
|
||||||
|
@ -23,12 +23,15 @@ NETBSD_ATF_TESTS_C+= asin_test
|
|||||||
NETBSD_ATF_TESTS_C+= atan_test
|
NETBSD_ATF_TESTS_C+= atan_test
|
||||||
NETBSD_ATF_TESTS_C+= cbrt_test
|
NETBSD_ATF_TESTS_C+= cbrt_test
|
||||||
NETBSD_ATF_TESTS_C+= ceil_test
|
NETBSD_ATF_TESTS_C+= ceil_test
|
||||||
|
NETBSD_ATF_TESTS_C+= casinh_test
|
||||||
NETBSD_ATF_TESTS_C+= cos_test
|
NETBSD_ATF_TESTS_C+= cos_test
|
||||||
NETBSD_ATF_TESTS_C+= cosh_test
|
NETBSD_ATF_TESTS_C+= cosh_test
|
||||||
NETBSD_ATF_TESTS_C+= erf_test
|
NETBSD_ATF_TESTS_C+= erf_test
|
||||||
NETBSD_ATF_TESTS_C+= exp_test
|
NETBSD_ATF_TESTS_C+= exp_test
|
||||||
NETBSD_ATF_TESTS_C+= fmod_test
|
NETBSD_ATF_TESTS_C+= fmod_test
|
||||||
|
NETBSD_ATF_TESTS_C+= fe_round_test
|
||||||
NETBSD_ATF_TESTS_C+= infinity_test
|
NETBSD_ATF_TESTS_C+= infinity_test
|
||||||
|
NETBSD_ATF_TESTS_C+= ilogb_test
|
||||||
NETBSD_ATF_TESTS_C+= ldexp_test
|
NETBSD_ATF_TESTS_C+= ldexp_test
|
||||||
NETBSD_ATF_TESTS_C+= log_test
|
NETBSD_ATF_TESTS_C+= log_test
|
||||||
NETBSD_ATF_TESTS_C+= pow_test
|
NETBSD_ATF_TESTS_C+= pow_test
|
||||||
@ -56,7 +59,7 @@ TAP_TESTS_C+= fma_test
|
|||||||
.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800)
|
.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800)
|
||||||
TAP_TESTS_C+= fmaxmin_test
|
TAP_TESTS_C+= fmaxmin_test
|
||||||
.endif
|
.endif
|
||||||
TAP_TESTS_C+= ilogb_test
|
TAP_TESTS_C+= ilogb2_test
|
||||||
TAP_TESTS_C+= invtrig_test
|
TAP_TESTS_C+= invtrig_test
|
||||||
TAP_TESTS_C+= invctrig_test
|
TAP_TESTS_C+= invctrig_test
|
||||||
TAP_TESTS_C+= logarithm_test
|
TAP_TESTS_C+= logarithm_test
|
||||||
@ -80,6 +83,8 @@ CSTD= c99
|
|||||||
|
|
||||||
IGNORE_PRAGMA=
|
IGNORE_PRAGMA=
|
||||||
|
|
||||||
|
SRCS.ilogb2_test= ilogb_test.c
|
||||||
|
|
||||||
LIBADD+= m
|
LIBADD+= m
|
||||||
|
|
||||||
# Copied from lib/msun/Makefile
|
# Copied from lib/msun/Makefile
|
||||||
|
Loading…
Reference in New Issue
Block a user