参考:http://www.tahi.org/ 以及测试套件中的README,INSTALL.*** 文件

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

本文将会介绍如何如何搭建测试环境,以及如何配置测试机和被测试机。文章中涉及到的套件版本如下:
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_<Link0_device_name>="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)

    TN                           NUT
     |the Tester I/f: ed1    |the I/f Under Test: fxp0
     |                                |
     |                                |
   -+------------------------+- Link0
      the Network Under Test

    Example: (If NUT is router implementation)

   -+------------------------+- Link1
     |                                |
     |                                |
     |the Tester I/f: ed2    |the I/f Under Test: fxp1
     TN                          NUT
     |the Tester I/f: ed1    |the I/f Under Test: fxp0
     |                                |
     |                                |
   -+------------------------+- Link0
       the Network Under Test
   
    以上两个图分别是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
     例子如下:
    RemoteDevice    cuad0
    RemoteDebug        0
    RemoteIntDebug    0
    RemoteLog        1
    RemoteSpeed        0
    RemoteLogout    0
    RemoteMethod    serial
    #filter        ipv6

    #linkname    interface    BOGUS ether source address
    #        name        of the Tester Interface
    Link0        em0        00:00:00:00:01:00

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地址即可。


文章出处:飞诺网(www.firnow.com):http://dev.firnow.com/course/6_system/linux/Linuxjs/20090912/174942_2.html


arrow
arrow
    全站熱搜

    Frank 發表在 痞客邦 留言(2) 人氣()