2011年8月5日 星期五

Embedded Linux IPv6 ready logo phase-2

The past month I'm working on IPv6 ready test on an embedded linux platform.
Since the kernel is really old 2.6.10 and I have to do some porting from newer kernel to get IPv6 ready test pass. Last week I finally all pass and below are some tips.

1.The test node (TN) is FreeBSD 7.4 release with v6eval-3.3.2 / v6eval-remotes-3.0 / Self_Test_5.0.0

It's very important that to disable ipv6 autoconfiguration on TN, because the testing suit needs clean ipv6 environment.

To disable ipv6 autoconfiguration, edit /etc/rc.conf and set

ipv6_enable="NO"

then after TN boot, the ipv6 link local address (fe80:X) won't be exist.

2./usr/local/v6eval/etc/tn.def

#
# tn.def
#
#  Information about the Tester Node (TN)
#

#
# Remote Controal Configuration
#
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           rl0             00:00:00:00:01:00
#Link1          de1             00:00:00:00:01:01
#Link2          de2             00:00:00:00:01:02
#Link3          de4             00:00:00:00:01:03

3./usr/local/v6eval/etc/nut.def

#
# nut.def
#
#  Information about the Node Under Test (NUT)
#

# System type
System          linux-v6

# System information
TargetName      FreeBSD/i386 4.9-RELEASE + kame-20040726-freebsd49-snap

# Name
HostName        HL200

# Type
#   host, router, special
Type            host

# Super user name and it's password
# if you select manual as "System", you don't care "User" and "Password"
#
User            root
Password        1234

#linkname       interface       The EXACT ether source address
#               name            of the Interface Under Test
Link0           eth0            00:AE:45:BC:84:1E
#Link0          eth0            00:60:37:c0:ff:ee
#Link1          fxp1            00:00:92:a7:6d:f6
#Link2          de0             00:c0:f6:b0:aa:ef
#Link3          de1             00:00:92:a7:6d:f8
#Link4          de2             00:90:27:14:ce:e3

4./usr/local/lib/perl5/site_perl/5.10.1/V6evalRemote.pm
This file is really important for self test. It makes the TN to communicate NUT through serial RS232 port. TN can login / logout NUT system even more reboot NUT.

So, find key words below in this file and get it right

    $Type="linux-v6";
    $Device="cuad0";
    $User="root";
    $Password="1234";

The TN will detect message from NUT to login / logout. For example "login: " and "Password: ". Also get it right for your NUT's Behavior

    # login prompt
    %prompt_user = (
           ...
           'linux-v6',         'login: ',
           ...
    );

    # password prompt
    %prompt_password = (
       ...
        'linux-v6',             'Password: ',
        ...
    );

    # command prompt
    %prompt_command = (
        ...
        'linux-v6',              '(\$|#) ',
        ...
    );

    and so on

5.Test TN <-RS232-> NUT
If you can see login screen or promopt, it works

touch /var/log/aculog
chown uucp:dialer /var/log/aculog
chmod 660 /var/log/aculog
cu -l /dev/cuad0
Connected

[root@HL200 ~]$

6.Remote test
To test if TN can login then logout NUT

/usr/local/v6eval/bin/linux-v6/loginout.rmt -o1

HL200 login: root
Password:


BusyBox v1.2.2 (2011.07.20-06:33+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

[root@HL200 ~]$
[root@HL200 ~]$ exit

7.Run self test

cd Self_Test_5-0-0
make clean
make ipv6ready_p2_host

8.Run parts of self test

There are 5 test sections, you can test separated.

cd nd.p2/
make clean
make ipv6ready_p2_host

Also can test only few items, for example test items 10 to 20

make AROPT="-s 10 -e 20" ipv6ready_p2_host

9.Embedded linux setup.
There are some sysctl for ipv6 need to be set correct.

echo 0 > /proc/sys/net/ipv6/conf/default/forwarding
echo 2 > /proc/sys/net/ipv6/conf/default/dad_transmits
echo 1 > /proc/sys/net/ipv6/conf/default/use_tempaddr
echo 2 > /proc/sys/net/ipv6/conf/default/accept_dad
echo 1 > /proc/sys/net/ipv6/conf/default/optimistic_dad
echo 1 > /proc/sys/net/ipv6/conf/default/accept_redirects

Remember to set promisc and allmulti to ethernet port.
Another tip is to sleep 10 seconds after the ethernet up then go login screen

ip -6 link set lo up
#ip -6 link set eth0 up
ifconfig eth0 up promisc allmulti

echo "Wait 10 secs..."            
sleep 10                          

10.Finally, fix /usr/local/v6eval/bin/unknown/ping6.rmt

########################################################################
use V6evalRemote;

rOpen() || goto error;

$NUTif = $rOpt_if;
$dstaddress = $rOpt_addr;
$rOpt_timeout = 5 if ! defined $rOpt_timeout;

if($rOpt_size < 1) {
    $rOpt_size = 2;
}

$pingpath = "ping6";
$pingopt  = "-n -c 1 -i 1 -s $rOpt_size -p 00 -w 2 -M want";
$ifopt    = "-I $NUTif" if $NUTif ne "";

rLogin($rOpt_timeout) || goto error;
rCommand("$pingpath $pingopt $ifopt $dstaddress", 15) || goto error;
rLogout($rOpt_timeout) || goto error;

rClose();
exit($V6evalRemote::exitPass);

error:
    rClose();
    exit($V6evalRemote::exitFail);

########################################################################





3 則留言:

  1. 你好, 我是不小心在你留言板上提問以下問題題的Miya,
      想跟你請教有關Embedded Linux IPv6 ready logo 中的Section 2: RFC 4861 - Neighbor Discovery for IPv6 - Item 147 測試問題.
      之前用SUSE Linux Enterprise Desktop 11 SP1 (linux kernel 2.6.32.46-0.3), 測試這一項是PASS的.
      但自從改用SUSE Linux Enterprise Desktop 11 SP2 (linux kernel 3.0.13-0.27), Neighbor Discovery 測試總是fail 在第147項
       21 < invalid expiration < 23
       FAIL
      我的test node (TN) is FreeBSD 7.4 release with v6eval-3.3.2 / v6eval-remotes-3.0 / Self_Test_5.0.0和你的一樣.
    我是用RJ45 LAN 連接TN(Freebsd)和NUT (client).
    不知方便傳我的測試REPORT給你呢?

     
    是的, 就如同你在留言板所回答這可能是timing issue. 當超過21秒時, ECHO reply 還是會繼續做回應.   但這個部份在SUSE Linux Enterprise Desktop 11 SP1 (linux kernel 2.6.32.46-0.3)是沒問題的, 而問題卻發生在SUSE Linux Enterprise Desktop 11 SP2 (linux kernel 3.0.13-0.27).  目前無法得知為什麼這個會發生這個現象.  是誰忘了通知時間到了?? 你知道如何追查嗎? 
     
     
    [版主回覆05/15/2012 19:24:52]我google一下有發現相同的問題,而且日期在今年四月.
    http://www.tahi.org/users/mail-list/201204.month/2321.html
    看起來應該是bug.這類的問題相當不容易抓.
    如果你能自己build kernel那就先diff 2.6.32 & 3.0.1 kernel source ipv6的部份看做了什麼更動試著改改看吧

    回覆刪除
  2. 近期進行Phase-2/Conformance Test當機在『Test v6LC.2.2.11: Default Router Switch (Hosts Only)』好一陣子... 沒錯,就是nd.p2#138!我的kernel是2.6.31,請問還有其他參數需要調動的嗎、假使已參考您上述文章?感謝。
    [版主回覆01/23/2013 17:58:46]Sned me your nd.p2 #138 Error log, so I can tell the problem.

    回覆刪除
  3. Many thanks to Steve, I found the root cause of failure in nd.p2#138! Linux should be compiled with "IPv6: Router Preference (RFC 4191) support".

    回覆刪除