"UnetStack libraries missing" error received when trying to run UnetStack simulation script from command line - unetstack

I am trying to run my UnetStack simulation script using command line. My simulation file is in the sample folder, and I open a terminal window in the unet folder (where README.txt exists). I followed the README.txt instructions, and I tried to run other simulations script from the sample folder, but I always get the following error:
ERROR: UnetStack libraries missing...
However, everything works well if I run the simulation using IDE. I will be grateful if you help sort out this problem, so I run the simulation through command line.
I tried to run the simulation script using command line. I followed README. txt instructions, but it didn't work.
I tried this: bin/unet samples/super-tdma/e3-network.groovy and many other simulation scripts.

This is to make sure that my question has been posted, as I can't see it within the listed questions.

You can use v1.3 or
In v1.4, Copy all the Items from the folder "UnetID" to the "root folder", then run the simulation.

Related

Jenkins/Windows - Launch TestNG suite from .bat

Stackoverflow helped me a lot to reach that point but now I'm completely stuck, here is my problem :
I'm currently developing several tests to check a website. I code with Java in Eclipse, using testNG plugin with ReportNG for report, all of this using Windows 7 pro.
My tests work, and my report is well generated, so now I have to put it on Jenkins for my company so they will run my tests every X hours.
In order to launch my tests, I have made a file, named Run.bat, which runs the Java code, I tested it and it works, here is the code :
Run.bat
set classpath=blex_test_v1\bin;blex_test_v1\lib\*
java org.testng.TestNG blex_test_v1\blex_test_v1.xml
I now try to launch the tests on Jenkins, creating a new job and configuring it with the build section :
Run.bat
And this is my problem, I've tried everything (relative path, only the name of the file etc...) I always get this error :
java.io.IOException: Cannot run program "cmd" (in directory "/var/jenkins_home/jobs/blex_functional_test/workspace"): error=2, No such file or directory
So I checked the Jenkins workspace but my Run.bat is in it :
Workspace
I have read that Jenkins is in Linux so it might cause problem with bat files, so I tried to create a script but I didn't succeed either ..
So my question is : How can I run my test on Jenkins using my file Run.bat ? What am I doing wrong here ?
Thanks a lot !
Finally I can add an answer :
Jenkins is installed on a Unix machine so you can't run a bat file, it has to be a bash script.
To create a bash script, refer here.
Then you have to make sure that the plugin Xvfb is installed (and works) on the computer where Jenkins is installed.
I use testNG with reportNg and it doesn't work with the last firefox version so you I use firefox v34.0.5 and this version must be installed also on the Jenkins computer.
If you want to open the report after the execution, install another plugin and configure it (report HTML or something like that)
God it took me about a week but it's good to see it working !

Nunit TestResult.xml is not created during Jenkins build

To run tests in Jenkins I use the next batch command:
"C:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console.exe" /result:TestResult.xml "C:\Users\Denis\Documents\Visual Studio 2013\Projects\MyProject\App.nunit"
Here how it looks in Jenkis:
The problem is: it doesn't generate TestResult.xml file!
When I run the same command as a .bat file from my desctop it creates the TestResult.xml file.
Any ideas what is wrong with Jenkins?
P.S. I searched for created file in all possible folders and even via "search"
I came up with thought that the file is generated and removed then or something like this.
The thing is that I don't see this file indeed but Jenkins generated report based on this file! So I think maybe after generating report the file was removed automatically.
I had faced the same issue and I found the test results xml file under my user directory in Win 7.
Note : I think it's some problem with nunit that it doesn't export the file to the location of which we provide the path.

loading program in econotag (contiki 2.7)

I am currently trying to run my code(written and compiled in contiki 2.7) in econotag. However i wasn't able to do so. I can compile with out any problem using
make TARGET=econotag hello-world.
but when i try to upload using the command
make TARGET=econotag hello-world.upload
the following message appears
../../platform/econotag/Makefile.econotag:10: ../..
make: *** No rule to make target `hello-world.upload'. Stop.
I know it used to work perfectly in contiki-2.6 with TARGET=redbee-econotag. so i tried it but the message was
**** This platform is old and will soon be removed ****
please use TARGET=econotag instead.
(or set ALLOW_OLD_PLATFORMS=1 to proceed)
. Stop.
I have seen some posts about installing the tool chain for uploading on econotag. but they didn't provide step by step procedure.
can anyone tell me what/how i should to install the tool chain to solve this problem and what command i should use after installation.
Here is how my colleague solved it
first compile the program you want to load (in this case hello-world) with
the command
make TARGET=econotag hello-world
note that this will generate a binary file with file name hello-world_econotag.bin (in the same directory with the code)
then go to directory
contiki-2.7/cpu/mc1322x/tools
and execute the pearl script used to upload binary files. (use the following command)
sudo ./mc1322x-load.pl -f "path to your binary file" -t /dev/ttyUSB1
this will upload the binary of your code to the econotag.
then reset your device (either with command or manually)
and the code should be running now

Unable to execute TestNG Suite file via command line

I am trying to execute a TestNG Suite file via the command line in order to initiate a regression run.
Currently I am doing this through my Eclipse IDE successfully by right-click on the "testng.xml" file then selecting Run As > TestNG Suite.
However, when I try to run it via the command line, I get an error message. Steps below:
I navigate to the directory where my "testng.xml" file is saved. e.g. C:\Users\xxx\Documents\eclipse projects\Automated Testing\config
Run the command:
java org.testng.TestNG testng.xml
The above command generates the below response:
Error: Could not find or load main class org.testng.TestNG
I tried setting the classpath to include all of the selenium and testNG Jar files as per below:
set classpath C:/Users/xxxx/Downloads/selenium-java-2.25.0/selenium-2.25.0/libs/*
However, this generates the below error message:
Environment variable classpath C:/Users/xxxx/Downloads/selenium-java-2.25.0/selenium- 2.25.0/libs/* not defined
I have looked on the testNG Documentation (http://testng.org/doc/documentation-main.html) and this just says that testNG has to be in your classpath, so now I am a bit stuck. Any help would be greatly appreciated.
Either methods work :)
Method #1
cd C:\Workspace\projectname
java -cp C:\Workspace\projectname\lib\*;C:\Workspace\projectname\bin org.testng.TestNG testng.xml
Method #2
cd C:\Workspace\projectname
set ProjectPath=C:\Workspace\projectname
echo %ProjectPath%
set classpath=%ProjectPath%\bin;%ProjectPath%\lib\*
echo %classpath%
java org.testng.TestNG %ProjectPath%\testng.xml
Thanks #siemic, I have finally got it working now. Basically you just need
to run the two commands below:
set classpath=..\bin;C:\libs\selenium-java-2.25.0.jar;C:\libs\testng-6.0.1-nobsh
noguice.jar;C:\libs*
java org.testng.TestNG
It was the first command that I was having trouble with, so just to elaborate I needed to set the following three items on the classpath:
The BIN Directory of my project. This is because the java files that I have developed are located here.
The Selenium.jar file, this is because I am using the selenium framework
The testng.jar file, needed because this is my unit testing framework
Then finally I used a wildcard to include all other JAR files within my libraries folder. The weird thing
is I needed to fully specificy the name of the selenium and testng jar files, or else the tests don't work. Not too sure why.
Anyway it is working fine now and I am able to execute the tests via the command line.

Bash - MSBuild - File Logger

I'm trying to improve our local build implementation, by using Bash and pending the success of a solution build, run the unit tests.
At the moment I want to pipe the results of the build in quite mode to the console (using default console logger) but pipe the results in more detail to a file using the file Logger.
From the bash I can execute the build fine, providing I don't specificy the FileLogger.
C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe /verbosity:q D:/MyDocs/Main.sln
The minute I do this :
C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe /verbosity:q D:/MyDocs/Main.sln /logger:FileLogger,Microsoft.Build.BuildEngine; /flp:logfile=Build.Log
The build fails and I get a could not load file or assembly Microsoft.Build.BuildEngine.
I've also tried changing dir so that I'm in the framework directory, but still get the same error.
As an aside I'm trying to provide the devs's with a quite verbosity for the local builds, but enable auto execution of the tests if the build is successful. I'll analyse build success by reviewing the contents of the Build.Log file for "Build Succeeded" Or "Build Failed"
I tried pushing the result to file using > "Build.log" but that impacts the colouring of the build output on the console which diminishes some of the value of what I'm trying to achieve.
Any help would be great.
Thanks
Microsoft.Build.BuildEngine is a namespace and not an ILogger. If you replace that portion in:
/logger:FileLogger,Microsoft.Build.BuildEngine;
... with a valid ILogger it's more likely to work.

Resources