Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Eclipse Titan on Win 10 WSL part 1: command line
Eclipse Titan on Win 10 WSL part 1: command line [message #1741454] Thu, 25 August 2016 09:50 Go to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 756
Registered: January 2015
Senior Member
As promised, we have re-examined the usability of WSL from Titan perspective after the Windows Anniversary update, with the findings below:


First of all, WSL appears to be a Ubuntu 14.04 with 3.4 kernel and gcc 4.8.4 installed.

exosphere@GLOBALWARNING8:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty



exosphere@GLOBALWARNING8:~$ uname -a
Linux GLOBALWARNING8 3.4.0+ #1 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linux

exosphere@GLOBALWARNING8:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)




Secondly, the IP stack is present and can be used by both Linux and Windows, but it can only be managed from the Windows side.

ifconfig, ip addr xxx , traceroute don't work; ping only works if bash is "run as administrator".


root@GLOBALWARNING8:/home/exosphere# ifconfig
Warning: cannot open /proc/net/dev (No such file or directory). Limited output.
root@GLOBALWARNING8:/home/exosphere# traceroute microsoft.com
traceroute to microsoft.com (104.43.195.251), 30 hops max, 60 byte packets
setsockopt IP_MTU_DISCOVER: Invalid argument
root@GLOBALWARNING8:/home/exosphere# ping google.com
PING google.com (216.58.213.46) 56(84) bytes of data.
64 bytes from ber01s15-in-f46.1e100.net (216.58.213.46): icmp_seq=1 ttl=49 time=67.2 ms
64 bytes from ber01s15-in-f46.1e100.net (216.58.213.46): icmp_seq=2 ttl=49 time=65.9 ms
64 bytes from ber01s15-in-f46.1e100.net (216.58.213.46): icmp_seq=3 ttl=49 time=66.4 ms
64 bytes from ber01s15-in-f46.1e100.net (216.58.213.46): icmp_seq=4 ttl=49 time=66.8 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 65.945/66.591/67.209/0.502 ms



but get, curl, host, nslookup, apt-get update, apt-get upgrade , apg-get install xxx will work,
so packages can be installed


root@GLOBALWARNING8:/home/exosphere# curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.se/?gfe_rd=cr&amp;ei=sq2-V8DWCOrj8wf26pf4Aw">here</A>.
</BODY></HTML>
root@GLOBALWARNING8:/home/exosphere#


root@GLOBALWARNING8:/home/exosphere# wget google.com
--2016-08-25 10:35:28--  http://google.com/
Resolving google.com (google.com)... 216.58.213.46, 2a00:1450:4008:803::200e
Connecting to google.com (google.com)|216.58.213.46|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.google.se/?gfe_rd=cr&ei=zq2-V_KDOObj8wfly56YAg [following]
--2016-08-25 10:35:29--  http://www.google.se/?gfe_rd=cr&ei=zq2-V_KDOObj8wfly56YAg
Resolving www.google.se (www.google.se)... 216.58.209.67, 2a00:1450:401b:801::2003
Connecting to www.google.se (www.google.se)|216.58.209.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'index.html'

    [           <=>                                       ] 10,950      2.09KB/s   in 8.6s

2016-08-25 10:35:38 (1.24 KB/s) - 'index.html' saved [10950]

root@GLOBALWARNING8:/home/exosphere# nslookup microsoft.com
Server:         192.168.45.11
Address:        192.168.45.11#53

Non-authoritative answer:
Name:   microsoft.com
Address: 104.43.195.251
Name:   microsoft.com
Address: 104.40.211.35
Name:   microsoft.com
Address: 191.239.213.197
Name:   microsoft.com
Address: 23.96.52.53
Name:   microsoft.com
Address: 23.100.122.175

root@GLOBALWARNING8:/home/exosphere# host  microsoft.com
microsoft.com has address 191.239.213.197
microsoft.com has address 23.96.52.53
microsoft.com has address 104.43.195.251
microsoft.com has address 23.100.122.175
microsoft.com has address 104.40.211.35
microsoft.com mail is handled by 10 microsoft-com.mail.protection.outlook.com.



netstat returns empty, but processes are displayed by ps -ef:

root@GLOBALWARNING8:/home/exosphere# netstat -antu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State


root@GLOBALWARNING8:/home/exosphere/TitanProjects/SNMP_IPL4/bin# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0  2432 ?        00:00:00 /init
exosphere      2     1  0  2432 ?        00:00:00 /bin/bash
root      2429     2  0  2432 ?        00:00:00 sudo su
root      2430  2429  0  2432 ?        00:00:00 su
root      2431  2430  0  2432 ?        00:00:00 bash
exosphere   2485     1  0  2432 ?        00:00:00 /bin/bash
root      2525  2431  0  2432 ?        00:00:00 ps -ef


and they can also be monitored and managed (killed if needed) by the Windows Task Manager.



After installing the necessary packages, the Titan source code can be compiled ( alternatively a pre-built Titan package for Ubuntu 14.04 can be installed)
and all function/regression test validated, with one caveat around termination of execution.

In general, parallel execution can be done via command line using two terminals (or via the ttcn3_start script which a wrapper for these commands):

for example:

terminal 1:


start mctr_cli

exosphere@GLOBALWARNING8:~/TitanProjects/SNMP_IPL4/bin$ mctr_cli SNMP_demo.cfg

*************************************************************************
* TTCN-3 Test Executor - Main Controller 2                              *
* Version: CRL 113 200/5 R5A                                            *
* Copyright (c) 2000-2016 Ericsson Telecom AB                           *
* All rights reserved. This program and the accompanying materials      *
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at              *
* http://www.eclipse.org/legal/epl-v10.html                             *
*************************************************************************

Using configuration file: SNMP_demo.cfg
MC@GLOBALWARNING8: Unix server socket created successfully.
MC@GLOBALWARNING8: Listening on TCP port 7298.


terminal 2: start the executable built for parallel mode:

root@GLOBALWARNING8:/home/exosphere/TitanProjects/SNMP_IPL4/bin# ./SNMP localhost 7298
TTCN-3 Host Controller (parallel mode), version CRL 113 200/5 R5A
The address of MC was set to a local IP address. This may cause incorrect behavior if a HC from a remote host also connects to MC.


terminal 1:

create mtc

MC2> MC@GLOBALWARNING8: New HC connected from 127.0.0.1 [127.0.0.1]. GLOBALWARNING8: Linux 3.4.0+ on x86_64.
cmtc
MC@GLOBALWARNING8: Downloading configuration file to all HCs.
HC@GLOBALWARNING8: Warning: The address of MC was set to a local IP address. This may cause incorrect behavior if a HC from a remote host also connects to MC.
MC@GLOBALWARNING8: Configuration file was processed on all HCs.
MC@GLOBALWARNING8: Creating MTC on host 127.0.0.1.
MC@GLOBALWARNING8: MTC is created.



start mtc:

MC2> smtc
Executing all items of [EXECUTE] section.
MC2> MTC@GLOBALWARNING8: Test case tc_SNMP_1 started.
MTC@GLOBALWARNING8: Test case tc_SNMP_1 finished. Verdict: pass
MC@GLOBALWARNING8: Test execution finished.
MTC@GLOBALWARNING8: Test case tc_SNMP_2 started.
MTC@GLOBALWARNING8: Test case tc_SNMP_2 finished. Verdict: pass
MC@GLOBALWARNING8: Test execution finished.
Execution of [EXECUTE] section finished.



This last command will execute whatever needs to be executed. This is normally follwed by "end mtc" (emtc) and quit in terminal 1 but in WSL emtc does not work properly.
Although in terminal 2 the executable terminates, the process remains in the memory and can only be killed with the Windows task manager.

As a workaround, after the execution is finished as seen in terminal 1, in terminal 2 the executable has to be interrupted with Ctrl-C.

Summing up: the command line execution in sigle mode is flawless, in parallel mode termination is problematic, ttcn3_start cannot be used, but a workaround solves this for the moment.
However if your executable assumes managing the IP stack, you may run into problems.



Next we will look into using the Eclipse Titan plug-ins with WSL environment.



Best regards

Elemer
Re: Eclipse Titan on Win 10 WSL part 1: command line [message #1741461 is a reply to message #1741454] Thu, 25 August 2016 11:09 Go to previous messageGo to next message
Gustavo Gonnet is currently offline Gustavo GonnetFriend
Messages: 34
Registered: October 2015
Location: Montreal, Quebec, Canada
Member
nice findings!
Re: Eclipse Titan on Win 10 WSL part 1: command line [message #1741785 is a reply to message #1741461] Mon, 29 August 2016 15:15 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 756
Registered: January 2015
Senior Member
Update: after reading this post https://www.reddit.com/r/Windows10/comments/4rsmzp/bash_on_windows_getting_dbus_and_x_server_working/
I realized that the problem with emtc may be due to insufficient support of Unix domain sockets in WSL.
Titan uses by default Unix domain sockets for internal communication on the same machine (that is, if main controller, host controller , test components reside on one machine, they will use Unix sockets to talk to each other). Across the network, TCP sockets will be used. Internal communication can be switched to TCP sockets by explicitly disabling Unix sockets in the configuration file, section [MAIN_CONTROLLER]:

[MAIN_CONTROLLER]
UnixSocketsEnabled := No   


With this setting , emtc works as expected and ttcn3_start can be used as well, so on WSL command line Titan performs as in any other Linux environment.
This also confirms that the problem originates somewhere in the area of Unix domain socket support.

I will look into the details of Unix domain sockets vs. TCP sockets in a separate post.

Best regards

Elemer


[Updated on: Mon, 29 August 2016 16:55]

Report message to a moderator

Previous Topic:Client and server perspective in testing
Next Topic:Titan internal communication
Goto Forum:
  


Current Time: Wed Jun 20 02:18:54 GMT 2018

Powered by FUDForum. Page generated in 0.01433 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top