Chinaunix首页 | 论坛 | 博客
  • 博客访问: 563993
  • 博文数量: 107
  • 博客积分: 3079
  • 博客等级: 少校
  • 技术积分: 1306
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-08 00:03
个人简介

emmoblin.github.com

文章分类

全部博文(107)

文章存档

2012年(8)

2011年(15)

2010年(49)

2009年(9)

2008年(26)

分类: LINUX

2010-03-31 10:52:37



参考: 以及测试套件中的README,INSTALL.*** 文件

TAHI是一组专门针对IPv6的测试套件,系统通过这个测试套件的测试后,就可以申请IPv6 Ready Logo Phase-2 和 IPv6 Ready Logo Phase-1。
该测试套件是经常更新的,如果想通过该测试申请以上说的两个logo,就必须用最新版的测试套件,可以去下载。

本文将会介绍如何如何搭建测试环境,以及如何配置测试机和被测试机。文章中涉及到的套件版本如下:
v6eval-3.1.0
ct-2.1.1    
Self_Test_4-0-5

在正式介绍之前,先说明两个概念:
TN :Tester Node
        A tester node for the conformance tests.即测试机
NUT:Node Under Test (NUT)
        A testee node for the conformance tests.即被测机

1.在测试机上安装FreeBSD系统
该套测试套件只能运行在FreeBSD系统上,且必须是6.3或更高版本的FreeBSD。
被测机可以是各种Unix,linux系统,本文一linux系统为例。windows系统不知道能不能测,没试过,也没看到相关介绍。

至 于如何安装FreeBSD,在此不在多说,网上有很多相关文档。不过要记得把编译环境和apache2装上,因为安装测试套件时需要编译,而测试完成后, 看结果是通过web页面看得,安装一个apache会比较方便。在FreeBSD上安装apache的方法和注意事项在前一篇文章中有介绍。

2.安装测试包
一共有三个包需要安装:v6eval-3.1.0 ,ct-2.1.1 ,Self_Test_4-0-5
 1) v6eval-3.1.0
    该包不提供测试脚本,他只是一个测试平台,是跑其他TAHI测试的前提,所以首先要安装它。
    解包到任何一个目录:
   mkdir /usr/ipv6test
   cd /ust/ipv6test  
   tar zxvf /root/v6eval-3.1.0.tar.gz
    安装相关的perl模块:
   cd /usr/ports/lang/p5-Expect && make install
   cd /usr/ports/security/p5-Digest-MD5 && make install
    安装v6eval:
   cd /usr/ipv6test/v6eval-3.1.0
   make
   make install
    执行完毕后,会在/usr/local/v6eval/下安装一系列文件和目录。

    创建bpf特殊设备:
   vi /etc/rc.conf
   ----------------------------------------------------------------
   devfs_system_ruleset="devfsrules_unhide_bpf"
   ----------------------------------------------------------------
   
   vi /etc/devfs.rules
   ----------------------------------------------------------------
   [devfsrules_unhide_bpf=1025]
   add path 'bpf*' user root group wheel mode 0660 unhide
   ----------------------------------------------------------------
   
   vi /etc/group
    执行测试的用户必须属于wheel组,如:wheel:*:0:root

    配置串口(如果在后面nut.def的配置中选择manual,则不用管串口的配置,因为手动情况下不需要串口):
   touch /var/log/aculog
   chown uucp:dialer /var/log/aculog
   chmod 660 /var/log/aculog

   vi /etc/group
    执行测试的用户必须属于dialer组,如:dialer:*:68:root

    配置网络接口:
   vi /etc/rc.conf
   ----------------------------------------------------------------
   ipv6_enable="NO"  
   ----------------------------------------------------------------
    不知道这个地方为什么要设置为NO,系统默认是YES,我就默认是YES了。

    保证至少一个网络接口启动,一般会是DHCP,如:ifconfig_em0="DHCP"
   # vi /etc/rc.conf
   ----------------------------------------------------------------
   ifconfig_="up"
   ----------------------------------------------------------------
   If NUT is a router, you need to specify also Link1.

 2)ct-2.1.1
   ct的安装非常简单。
   cd /ust/ipv6test  
   tar zxvf /root/ct-2.1.1.tar.gz
   cd ct-2.1.1
   make install
    此时系统会将ct安装到/usr/local/v6eval/下,我们需要将其拷贝到任意一个目录A下,在目录A中执行测试脚本。
   cp -pR /usr/local/v6eval/ct  /usr/ipv6test/
   chmod -R +w /usr/ipv6test/ct
    如果跑完一遍测试脚本,还想对另一个NUT进行测试,那么就需要从/usr/local/v6eval/ct再复制一份ct出来,这样做的目的是保证前一次的测试结果不会被覆盖。

 3)Self_Test_4-0-5
   不用安装,直接解包到任意目录即可
   cd /ust/ipv6test  
   tar zxvf /root/Self_Test_4-0-5.tgz
 
3.物理配置
  NOTE:TN的IP地址可以是IPv4或IPv6的,NUT的IP地址必须是IPv6的。
    TN和NUT网络连接图:
    Example: (If NUT is host implementation)
           Example if NUT is a host or a special device
                TN (tester)                       NUT (host or special device)
+------------+ Ether cross cable +------------+
| [ed1]+--------------------+[fxp0] |
+------------+ +------------+
           Example if NUT is router 
                TN (tester)                       NUT (router)
+------------+ Ether cross cable +------------+
| [ed2]+--------------------+[fxp1] |
| | Ether cross cable | |
| [ed1]+--------------------+[fxp0] |
+------------+ +------------+

    以上两个图分别是NUT为host和router的网络连接图。

    TN和NUT串口连接:
       COM1            COM1
    TN -------------------- NUT
           serial line
     串口连接是为了TN能向NUT发送命令,已使NUT能自动完成某些工作,比如重启。如果在配置nut.def是选择手动,则不需要配置串口,NUT重启的工作也有人工完成。

4.配置文件
 1)配置TN
    a. /etc/resolv.conf
     建议删除该文件,以消除其他网络包对测试的影响。也可以不删除。

    b.建议删除IPv4的默认路由,也可以不删。

    c.配置/usr/local/v6eval/etc/tn.def
   

Configuration is stored in files tn.def and nut.def stored in /usr/local/v6eval/etc/. There are provided sample files tn.def.sample and nut.def.sample in the directory.

Empty lines and lines starting with '#' are comments.

In tn.def, there are these settings:

       RemoteDevice    Device to be used for remote control.
Default: cuaa0
                       If TN is FreeBSD 6.0-RELEASE or higher,
you may need to specify cuad0 as RemoteDevice.
       RemoteDebug     Specifies debug level for remote control.
Default: 0
       RemoteLog       Specifies log level for remote control.
0: don't logged serial line message
1: logged serial line message
Some of test need to edit this part.
Default: 0
       RemoteSpeed     Specifies interval that characters are sent at.
Default: 0 (sec.)
       RemoteLogout    Enable/disable logout
0: logout is omitted
1: do logout every remote command invocation
Usually, you don't need to edit this part.
Default: 0
       RemoteMethod    Enable/disable remote command invocation.
serial: enable it.
none: disable it.
Default: serial
       LinkX           Specifies interface name and MAC address
of a Tester Interface:
                       Link0   de0     00:00:00:00:01:00
(1) (2) (3)
                       (1): a link name.
Note that the current version of the Tool
supports only "Link0" and "Link1" for (1),
and does not accept any other entry.
                       (2): the EXACT name of a Tester Interface.
                       (3): a BOGUS ether source address of
a Tester Interface.
Note that (3) must be different from
the TN's interface's MAC address.
Usually, you don't need to edit this part.
                       If NUT is a router, you need to specify also Link1.

In nut.def, there are these settings:

       System          Specifies system type of NUT. The Tool
switches remote control methods by the entry.
Default: manual
       TargetName      This entry will be displayed in test result file.
Default: null
       HostName        Specifies the name of NUT.
Default: null
       Type            Specifies NUT type.
Either "host" or "router" or "special" is acceptable.
                       It can not be omitted.
Default: host
       User            Specifies the account name of NUT's super user.
if you select manual as "System", you don't care "User"
Default: root
       Password        Specifies the password of NUT's super user.
if you select manual as "System",
you don't need to care "Password"
Default: v6eval
       LinkX           Specifies interface name and MAC address
of a Interface Under Test:
                       Link0   fxp0    00:00:00:00:01:00
(1) (2) (3)
                       (1): a link name.
Note that the current version of the Tool
supports only "Link0" and "Link1" for (1),
and does not accept any other entry.
                       (2): the EXACT name of a Interface Under Test.
                       (3): The EXACT MAC address of
a Interface Under Test.
Note that (3) must be same with
the NUT's interface's MAC address.
                       If NUT is a router, you need to configure also Link1.

To automatize testing process, you also need remotes. These are special scripts which make work you'd otherwise had to do manually.

These remotes can also be downloaded from . However, these are no longer maintained.

You can make own and place them into /usr/local/v6eval/bin/linux-v6. Then, go to the /usr/local/lib/perl5/site-perl/"version" and edit file V6evalRemote.pm. Find blocks of commented lines and uncomment all lines with linux-v6. Take care that uncommented lines are not out of brackets.




    RemoteDevice:TN上指定用来通信的串口节点名,可以到/dev/下查看,或者执行sysinstall->Configure->Networking->Interfaces查看。
    filter:如果只想执行IPv6的测试脚本,而不测试ipsec4, ipsec4-udp或tunnel,就把这一行的注释去掉。
    Link0:TN的网卡名,通过ifconfig查看,在我的机器上是em0,后面跟一个伪造的MAC地址,这个地址必须不同于实际em0的MAC地址(用默认的即可)。如果NUT是router,则还要写一行Link1。
     其他参数默认即可,具体含义查看v6eval-3.1.0中的INSTALL.v6eval,有详细介绍。

    d.配置/usr/local/v6eval/etc/nut.def
     例子如下:
    System        manual
    TargetName        WRLinux3.0
    HostName        localhost
    Type        host
    User        root
    Password        dztq1234
    Link0        eth0        00:1e:4f:e9:c2:84

    System:系统类型,默认为manual,手动操作。手动操作时不需要串口。
    TargetName:NUT的系统名称及版本号,没有固定格式,随便写。
    HostName:NUT的主机名
    Type:NUT的类型,host,router或special。此处根据NUT的类型填写。
    User:NUT上超级用户的用户名。System为manual时,用不到该参数
    Password:NUT上超级用户的密码。System为manual时,用不到该参数
    Link0:NUT上于TN相连的网卡名,及其MAC地址。如果NUT是router,则还要写一行Link1。

 2)配置NUT
    a. /etc/resolv.conf
     删除该文件,以消除其他网络包对测试的影响。

    b.建议删除IPv4的默认路由,也可以不删。

    c.修改/etc/sysconfig/network
    echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
    
    d.加在IPv6模块
    modprobe ipv6
    echo "modprobe ipv6" >> /etc/rc.local
     使系统每次启动都会自动加载IPv6模块

    e.设置echo服务
    vim /etc/xinetd.d/echo-stream
    --------------------------------------------------------------------
    disable         = no
    flags           = IPv6
    --------------------------------------------------------------------

5.执行测试
  在执行测试之前,可以做一个小的测试,看看测试套件是不是能正常运行。
  cd /usr/ipv6test/v6eval-3.1.0/sample
  /usr/local/v6eval/bin/autorun INDEX
   如果大部分是PASS,则正常,如果输出的都是NG,则要检查一下是不是TN和NUT之间的网络不通。这种情况下可以先互相ping一下,如果是通的,那就给两个机器配上IPv6的地址,然后ping6试一下。
  NOTE:TN和NUT至少要在同一个网段下,如:TN   128.224.163.111 和 NUT  128.224.163.123, 最好是直连。

  另外,还可以根据NUT的实际情况,修改测试参数,如下:
    If NUT does not support the advanced functionalities
        $ vi config.txt
            
            "TRANSMITTING_EREQ" parameter is:
                - zero:     NUT can't transmit Echo Requests
                            or can't set packet size
                - non-zero: NUT supports.

            "MULTICAST_ROUTING" parameter is:
                - zero:     NUT does not support Multicast Routing.
                - non-zero: NUT supports.

            "MTU_CONFIGURATION" parameter is:
                - zero:     NUT does not support MTU Configuration.
                - non-zero: NUT supports.

    If NUT is a router, and if NUT does not have multiple interfaces
        $ vi config.txt

            "HAS_MULTIPLE_INTERFACES" parameter is:
                - zero:     NUT is one physical interface router
                - non-zero: NUT is generic router which has multiple interfaces

    You can also modify test specific parameter in
        - spec.p2/config.pl
        - nd.p2/config.pl
        - addr.p2/config.pl
        - pmtu.p2/config.pl
        - icmp.p2/config.pl



  执行测试:
  cd /ust/ipv6test/Self_Test_4-0-5
   然后根据下面提示,执行不同的测试:
  IPv6 Ready Logo Test Program Phase-1
  ------------------------------------
     $ make ipv6ready_p1_host    (If NUT is a host)
     $ make ipv6ready_p1_router  (If NUT is a router)
     $ make ipv6ready_p1_special (If NUT is a special device)
            
  IPv6 Ready Logo Test Program Phase-2 IPv6 Core Protocols
  --------------------------------------------------------
     $ make ipv6ready_p2_host   (If NUT is a host)
     $ make ipv6ready_p2_router (If NUT is a router)

  当TN需要你在NUT上做一些操作时,会在屏幕上有所提示,只要根据提示,去NUT上进行相应操作即可。
  注意,执行下一次测试之前,要先make clean,如果你不想丢掉上一次的测试结果,那么就复制一个新的Self_Test_4-0-5,然后到新的Self_Test_4-0-5中去做新的测试。

如果要对新的NUT进行测试,只需要修改nut.def文件中的网卡名和MAC地址即可。


参考:

http://dev.firnow.com/course/6_system/linux/Linuxjs/20090912/174942.html


PS:
 配置成IPv6的router 
对于router的测试需要配置两个网卡的ip地址:
   另外,还需要修改其他几个文件的内容,分别如下: 
   1./etc/sysconfig/network-scripts/ifcfg-eth0,在其中添加入下语句: 
IPV6INIT='yes' 
IPV6to4INIT='yes' 
IPV6FORWARDING='yes' 
IPV6ADDR="3ffe:501:ffff:100:205:5dff:fea1:b73c/64" 

同样,在/etc/sysconfig/network-scripts/目录下的ifcfg-eth1文件中添加如下语句: 
IPV6INIT='yes' 
IPV6TO4INIT='yes' 
IPV6FORWADING='yes' 
IPV6ADDR="3ffe:501:ffff:101:205:5dff:fea1:c15c/64" 

     2.打开/etc目录下的sysctl.conf文件,看是否有如下语句: 
               net.ipv6.conf.all.forwarding  =  1 

     3. 修改重定向设置。 
在/etc/rc.d/rc.local中加入如下语句: 
for f in /proc/sys/net/ipv6/conf/*/accept-redirects 
do 
 echo 1 > $f 
done


阅读(4056) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~