How to call shell command via VAPI-XP-TEST - hp-quality-center

I have .py script that run from the cmd.
I want to execute it in quality center automatically (I understood that is done using the test type VAPI-XP-TEST) and to get indication of '"Pass"/"Fail".
How exactly I can do it?
Thanks.

Check this link: http://alm-help.saas.hpe.com/en/12.50/online_help/Content/UG/t_create_vapixp_scripts.htm
Also, VAPI-XP allows Python script. I have not used Python for VAPI-XP yet, but HP documentation in the above link I believe can help you get up to speed.

Related

R: send multiple commands to Windows' cmd

I think and hope this is super easy, but I am jsut too stupid/blind:
I want to use system and not only open the command-line of windows, but to perform a simple copy task within it:
system('cmd' , 'copy Frame_Ind* all.dat')
So I thought... I want to copy alle files which start with "Frame_Ind" together into one that is calles "all.dat".
Can you tell me how to prompt more than one command with system?
I know this is a weird workaround, but it would help me a lot! Thanks and Cheers,
Al
Try the following:
shell('copy Frame_Ind* all.dat')

Hide and show comments

I'm writing all my scripts on .R file using R for mac. It is convenient to me because there are colors to highlight the type of commands.
I have a many comments following the # symbol that are useful when I forget about the meaning of my script but they tend to blur my script so that it gets harder to find a given command line.
Is there a way to hide and show these comments ? (Using the programm I'm currently using or another one). What would you suggest as the best program to write R script ?
Thanks a lot !
RStudio supports code folding. You can standardize your comment blocks so that they are recognized as code blocks.
For example, enter this into your RStudio editor
#=======================================================
# this is a comment block
# more comments here
# comments upon comments
and then press Alt+L to fold, and Alt+Shift+L to unfold.
Try RStudio for mac. One of the greatest code writing environment for R there is.
You can also try Emacs, which is more like old-fashioned command line editor. You can find a good guide here.

Is there any way in Linux to show what's going on about the freezing code on the R session?

I am running a set of selected code on R. Like
source("/tmp/r-plugin-honli/Rsource-2704-quantmod.R")
There is no output. Only the prompt '>' flickered there.
I use 'killall' to kill the R session. But I don't know where is wrong on the code. Because R did not give any output. How could I know what's going on about the code.
I'd try two things:
Run the code interactively. As in, open the Rsource-2704 file and run its lines one by one.
If that doesn't replicate the problem or is not possible, you can take Joshua Ulrich's suggestion or use:
R CMD BATCH --vanilla Rsource-2704-quantmod.R out.log
Which will run the code in a batch mode and output the usual console lines to a file called out.log (you can name it whatever you like).
Instead of using print statements, you could also take a look at the browser() command. This drops you into an interactive session at the point where the command is put. This works particularly well when trying to figure out what is happening inside a function, although I don't know if your script contains them.

Is there a way to use Expect-Lite variables inside of a spawned command?

I've been working on trying to automate the complicated process of building source code on a build machine and then transferring the compiled image files over to my embedded ARMv7 device to be flashed. Each step by itself is easy to automate with standard Linux Shell Script, but when trying to do everything in one giant script things get complicated. Thus far I've been using expect-lite to do the work, which is working except now I've run into a problem. When transferring the images over I have expect-lite code that looks like the following:
$imageDestination="/the/destination"
$imageSource="/the/source/"
>sftp $userName'#'$buildMachine
>$password
>get $imageSource'/'x-load_sdcard.bin.ift $imageDestination'/'MLO
>echo "Finished"
>bye
If you know a thing or two about expect-lite, then you'll know that the above variables will be read as "Shell" variables. The problem is that as far as I know SFTP doesn't allow the use of variables. Is there a way to tell expect-lite to use the predefined variables instead of trying to use "Shell" variables? Or, is there some cleaver way to get around this limitation without removing the variables?
All help is greatly appreciated.
Dreligor,
There is no scope issue. Expect-lite variables are all of global scope (as stated in the documentation). I think the problem is that you are using quotes which is making things more difficult. You should try:
$imageDestination=/the/destination
$imageSource=/the/source
>sftp $userName'#'$buildMachine
>$password
>get $imageSource/x-load_sdcard.bin.ift $imageDestination/MLO
>echo "Finished"
>bye
Craig Miller - author and maintainer of expect-lite
After some experimentation it turns out that this is a scope issue. The solution is to simply move the variable declarations down. They need to be declared after the script has connected to the remote machine via sftp. The fixed code is as follows:
>sftp $userName'#'$buildMachine
>$password
$imageDestination="/the/destination"
$imageSource="/the/source/"
>get $imageSource'/'x-load_sdcard.bin.ift $imageDestination'/'MLO
>echo "Finished"
>bye
Hopefully this will help others.

What are the ways to create an executable from R program

I want to know if there is anyway of creating an executable R program to be run in UNIX. I think RInside will do the job but just want to know if there is any other way of doing this.
Thanks in Advance
The exact answer depends on your requirements, but you can start by looking at Rscript (see http://stat.ethz.ch/R-manual/R-devel/library/utils/html/Rscript.html and http://blog.revolutionanalytics.com/2009/01/using-r-as-a-scripting-language-with-rscript.html), as well as littler (http://code.google.com/p/littler/).

Resources