Jenkins with linux machine for selenium script - linux

I have created selenium testng.xml file and make windows batch file for my local window machine and Jenkins build now function perfectly working
But now client expectation is run jenkins projects for same selenium script in Linux server machine.
I m not aware about how can i start for my testng file for linux server?

You created batch file while working with testng.xml on Windows. You would create an equivalent shell file while working with testng.xml on Linux.
Once done, Go to Jenkins Job configuration build section and select Execute Shell option.
Put you shell script in command window or execute shell file directly from command window itself.
To execute shell file, use below syntax:
./<file>

Related

Running two shell commands using Python 3.6 on Ubuntu 18.02

In order to get some software running I need to 1. Run a script that will execute a remote license manage, 2. Execute a shell script to start the software. I can do this by opening a command window in the directory with the rlm , and then type ./rlm to run the Linux executable. Then I can go into the directory that contains the shell script, open a terminal in that location and run ./myshell.sh. This opens the GUI for my software.
I would like to run these steps using a single Python script. I have tried:
#change the working directory...
os.chdir(r'/opt/mysoftwarelocation')
#confirm location change...
print(os.getcwd() )
#run ./rlm...
os.system('./rlm')
At this point I can see from a python terminal that the rlm is running.
I would then like to run the code below to run the shell script...
os.chdir(r'/opt/mysoftwarelocation/sumsubdirectory')
print(os.getcwd() )
os.system('./some.sh')
Unfortunately, after os.system('./rlm') finishes the script stalls and will not execute further and without an errors.
How to I get the second part of my script to run within a single Python script?
Have you tried to run the rlm command in the background?
subprocess module gives a nice interface for that

Run and start denodo platform using Command Line Linux Remote Server without GUI

Run Denodo Platform sh files using Command Line Linux Remote Server.
Denodo Platform showing GUI to start Virtual DataPort, and I can only interact using Command Line only.
Is there a way to do this?
ssh into the server and go to your DENODO_HOME\bin folder
run this command there:
sh vqlserver_startup.sh

How to remotely control Trace32 via Terminal

I have an automated Linux agent (CentOS) with Bamboo to aid in building and deployment of new software onto a board. I want to be able to run .cmm files via Trace32 and a Lauterbach onto my locally located board using the remote Bamboo agent to trigger daily builds and deployment.
I am aware of the terminal command option: ./trace32 -s file.cmm to avoid using the GUI.
Is there anyway I can use this kind of thing for remote deployment, perhaps utilising ssh?
There is no SSH server in TRACE32. However you can control TRACE32 remotely via the TRACE32 remote API. See the document "api_remote.pdf" in the PDF folder of your TRACE32 installation.
To launch some scripts or execute some simple commands from a bash shell, you can use the command line tool t32rem from the <t32>/bin/linux folder.
This tool uses the TRACE32 remote API to send TRACE32 commands to open TRACE32 GUIs.
Do the following:
Enable the TRACE32 remote API to add the following two lines to your TRACE32 configuration file (usually "config.t32")RCL=NETASSIST
PORT=20000 You have to ensure that there is an empty line before and after these lines in your configuration file.
Launch TRACE32 and send a command to it with t32rem like that: t32rem localhost port=20000 <command> For <command> you can choose any TRACE32 command like DO file.cmm to execute your mentioned PRACTICE script.
For more complex remote control of TRACE32 (e.g. from a Python script) you should have a look at the previously mentioned "api_remote.pdf" and the examples at <t32>/demo/api.
When you already have a command to run, how about using a Script task in your plan, so that you can execute the command you wanted?

How can CruiseControl.NET realize that it can control remote pc to execute automation test and monitor the status?

I want to realize that CCNET can control remote pc to execute a bat file which is in file server and monitor the status,stop or finished.
the bat file is CodeUI automation test.
Your question is a little vague but what I am assuming that you are trying to do is to have CruiseControl execute a shell command.
Check out
http://www.cruisecontrolnet.org/projects/ccnet/wiki/Executable_Task
So something like this in your script
<exec executable="\\server\c$\projects\myproject\build.bat" />
If however that bat file must be run from the computer the script is located try looking in psexec.exe.
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
https://superuser.com/questions/781796/run-a-batch-file-on-a-remote-computer-as-administrator

How to make a shell script run automatically daily?

My operating system is windows xp and my server is Linux. I have developed a code in perl(saved in shell file).
I want to connect to Linux machine from Windows using your script only and then run a script on linux and this should be done on daily basis and automatically also.
Is it possible to do that?
Shell file under windows? that's called a batch file
Here is an example how you can set up a scheduled task on windows
If your remote machine is on linux, you can read here how you can set them.
You have several options to run the script on remote machine:
copy the file on the remote machine in the same location with the same file name (with ftp or ssh you can do this with another script) and set the linux machine's cron job to execute that same file daily
install a (web) server on the linux machine and create a web page through which's interface to upload and execute the script (this way you don't have to set up a cron job on linux)
create a script on the linux machine which to connect to another service (like a ftp location), download the needed script (the one which you want to execute) and execute it. Put the downloading script in your cron to execute whenever you want
use Net::SSH::Perl in your script to run commands on the linux machine (for this, you need ssh access to that machine, obviuosly)
Yes. Create a Scheduled Task which runs the PERL.exe with the script file name as an argument.

Resources