How to link a test to a launcher (in this case a shell launcher)

Slides:



Advertisements
Similar presentations
Welcome to WebCRD.
Advertisements

Introduction to Unix – CS 21 Lecture 11. Lecture Overview Shell Programming Variable Discussion Command line parameters Arithmetic Discussion Control.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Information Networking Security and Assurance Lab National Chung Cheng University 1 if condition Condition is defined as: "Condition is nothing but comparison.
Shell Programming 1. Understanding Unix shell programming language: A. It has features of high-level languages. B. Convenient to do the programming. C.
SETUP AND CONFIGURATIONS WEBLOGIC SERVER. 1.Weblogic Installation 2.Creating domain through configuration wizard 3.Creating domain using existing template.
Bash Shell Scripting 10 Second Guide Common environment variables PATH - Sets the search path for any executable command. Similar to the PATH variable.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX – Shell Programming The activities of.
Shell Programming, or Scripting Shirley Moore CPS 5401 Fall August 29,
Dataface API Essentials Steve Hannah Web Lite Solutions Corp.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
Chapter Nine Advanced Shell Scripting1 System Programming Advanced Shell Scripting.
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
© 2004 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice SISP Training Documentation Template.
Introduction of Geoprocessing Topic 7a 4/10/2007.
Linux+ Guide to Linux Certification, Third Edition
Linux Operations and Administration
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 11: Shell.
This slide deck is for LPI Academy instructors to use for lectures for LPI Academy courses. ©Copyright Network Development Group Module 9 Basic Scripting.
Oracle Data Integrator Procedures, Advanced Workflows.
Microsoft Office Outlook 2013 Microsoft Office Outlook 2013 Courseware # 3252 Lesson 6: Organizing Information.
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
Chapter 10: BASH Shell Scripting Fun with fi. In this chapter … Control structures File descriptors Variables.
Oracle Data Integrator Agents. 8-2 Understanding Agents.
©Colin Jamison 2004 Shell scripting in Linux Colin Jamison.
Lab 8 Overview Apache Web Server. SCRIPTS Linux Tricks.
Linux+ Guide to Linux Certification, Second Edition
Introduction to Bash Shell. What is Shell? The shell is a command interpreter. It is the layer between the operating system kernel and the user.
If condition1 then statements elif condition2 more statements […] else even more statements fi.
Group, group, group One after the other: cmd1 ; cmd2 One or both: cmd1 && cmd2 Only one of them: cmd1 || cmd2 Cuddling (there):( cmd1 ; cmd2 ) Cuddling.
Subscribers – List Model
PHP Form Processing * referenced from
1 UNIX Operating Systems II Part 2: Shell Scripting Instructor: Stan Isaacs.
Linux Administration Working with the BASH Shell.
1 Lecture 8 Shell Programming – Control Constructs COP 3353 Introduction to UNIX.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Core LIMS Training: Project Management
VAB™ for INFINITY Tutorial
C-Shell with Functions
Create a test that call Rest API
Archiving and Document Transfer Utilities
Data Virtualization Tutorial… CORS and CIS
Understanding how XContinuousIntegration (Xci)
Download/Upload Receipts
Unix Scripting Session 4 March 27, 2008.
The Linux Operating System
CSE 303 Concepts and Tools for Software Development
What is Bash Shell Scripting?
Testing REST IPA using POSTMAN
LGC Website, Software updates, Documentation, and Videos
Topics Introduction to File Input and Output
Oracle Sales Cloud Sales campaign
Exploring the Power of EPDM Tasks - Working with and Developing Tasks in EPDM By: Marc Young XLM Solutions
Copyright © – Curt Hill Bash Flow of Control Copyright © – Curt Hill.
Exploring the Power of EPDM Tasks Working with and Developing Tasks in SolidWorks Enterprise PDM (EPDM) By: Marc Young xLM Solutions
CSE 303 Concepts and Tools for Software Development
Linux Shell Script Programming
[DISCLAIMER] This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation.
Load Runner Mercury Performance Test Tool
Welcome to WebCRD.
HP ALM Test Lab Module To protect the confidential and proprietary information included in this material, it may not be disclosed or provided to any third.
HP Quality Center 10.0 The Test Plan Module
Chapter 5 The Bourne Shell
CST8177 Scripting 2: What?.
Introduction to Bash Programming, part 3
Topics Introduction to File Input and Output
Basic shell scripting CS 2204 Class meeting 7
Presentation transcript:

How to link a test to a launcher (in this case a shell launcher) How to scan existing tests How to create multiple configurations Include tests into a campaign See a sample of shell script (bash .sh)

To use shell scripts you need to cerate a Category that references the shell.jar launcher XStudio DB Testxxx Testxxx will be in Category “shell test script” that uses the shell.jar launcher

Then you create a test and its test case(s) in a folder XStudio DB Testxxx Here, we created The Category A folder “API YYY” to manage a subset of our test The TESTXXX And finally an empty Test Case

Alternatively you can scan all of your existing tests and load them into your category saving you the time to re-enter them all (useful when you already get many…) XStudio DB Testxxx Right click on the category, choose “scan/search local …” It will request you for a configuration

Indicate where your test files are located on your server/PC Here, it is in ‘/schell_Scripts’ Indicate the extension of your shell scripts Here, it is ‘.sh’ Indicate if your want to run your script in synchronous mode (launch the script and wait for it to complete and return an exit code) or not Usually you run in synchronous mode In case of asynchronous mode , indicate how long (in seconds) the launcher waits to declare the script as “failed” because it didn’t get any semaphore indicating it completed

A configuration cannot be modified (because it could impact already existing and running campaigns) If you don’t have any existing configuration, just add one by clicking on If you have an existing configuration but need to adapt it (e.g. your scripts are in a different location on your server), just add one by clicking on Here, we created a configuration that allows scanning from my local PC , in a local git repo that is ‘c:\agitrepo’

After submitting, XStudio will access the repository you specified and search all scripts with the extension you specified (here ‘.sh’) and load them into your category Here, XStudio found only one in the local git repo. select it and it loads into my XStudio DB

The .sh script is now referenced in my XStudio And a default test case has been created for it

Manual or Automated test case ? A test case can support both To be executable as “automated” you need to ensure the test case is flagged for it Here the test case can run in Automated mode Here the test case cannot run in manual mode

XStudio DB Testxxx You can directly run your test - we call it “On-the-Spot” execution Click on the test and the right pane will show the buttons This allows Testing you test script as you build it Testing a working script with various configuration Running a single test to verify Note that you can also run it with another Launcher . This is useful when: your test supports both Manual and Automated You are improving/adapting/creating a launcher

XStudio DB Playground Campaign Testxxx With the on-the-spot run the execution will happen in the “Playground” campaign folder This is a special folder that contains all On-the-Spot run You need to clean it from time to time – delete old campaign /sessions that served to verify your test

But before you execute the test you need to provide some information Mandatory ones: Which SUT are your testing against ? Which configuration are you using ? How do we need to react in case of dependent test failing or not executed ? Optional Who must be executing the test ? (this is for manual tests) On which Agent (server/PC) is the test going to run ? Who needs to be notified through email that event happened on that session ?

Let’s focus on the configuration and behavior

Imagine dependency graph as follows Behavior Imagine dependency graph as follows Test A Test B Test C Test D Test E

Imagine dependency graph as follows Behavior Imagine dependency graph as follows Test A Test B Test C Test C is ‘not executed’ Test D Test D is ‘not executed’ Test E Test E is ‘not executed’

Imagine dependency graph as follows Behavior Imagine dependency graph as follows Test A Test B Test C Test C is ‘executed and fail’ Test D Test D and E are ‘not executed’ Test E

Configuration This is the setup that the agent (the server or PC where the test will be run) will provide to the Launcher DB Executing on distant test harness machine Executing on user PC Xagent (“Harness1”) XStudio Configuration “local PC” Configuration “Harness test servers ” Laucher shell.jar Laucher shell.jar /testHarness/shell_scripts/testXXX.sh /home/tests/shell_scripts/testXXX.sh

“Harness test servers ” Configuration “local PC” Configuration “Harness test servers ”

We have several configurations that can be used for these test Scan scripts from local git repo Local PC Harness test server You select the configuration you want when you execute a test session This allows to run test sessions on different agents (local, remote) with diverse setup

Once you submit the test will execute On-the-Spot And you will get the results in the session that has been automatically created in the Playground folder for you The session includes the test we ran on-the-spot The result (quality) is 0% - because it was either “not executed” , or it “failed”

This is what we expected as our test script was not doing anything … Click on the “results” tab Click on “tree view” sub tab And you see the status of all of your tests – only one you run when on-the-spot And then the detail for each test case This is what we expected as our test script was not doing anything …

Here is a sample shell script for that test Using Curl, it tests a simple REST API (getinfo) that return basic JSON information if the server is up and running or an HTML body with error 404 otherwise

That part gets input parameters #!/bin/bash echo hello # turn off echo set +v # list all arguments echo "$@" >./log.txt #initialize variables ipadress="127.0.0.1" port="8080" expectedresult="Success" # initialize the options with their values while [ "$#" -gt 0 ]; do case "$1" in -ipadress) ipadress="$2"; shift 2;; -port) port="$2"; shift 2;; -expectedresult) expectedresult="$2"; shift 2;; --ipadress=*) ipadress="${1#*=}"; shift 1;; --port=*) port="${1#*=}"; shift 1;; --expectedresult=*) expectedresult="${1#*=}"; shift 1;; -*) echo "unhandled option: $1" >&2 ; shift 1;; --*) echo "unhandled option: $1" >&2 ; shift 1;; *) args+="$1"; shift 1;; esac done # Enumerating arguments but we don't use them in that script for arg do echo $arg >>./log.txt That part gets input parameters This is a sample and should not be taken as the right practice for such a script. Note: Xqual does not provide nor support test scripts

That part run the curl command and assert results # To get the value of a single parameter, just remember to include the `-` echo The value of ipadress is: $ipadress >>./log.txt echo The value of port is: $port >>./log.txt echo The value of expectedresult is: $expectedresult >>./log.txt curl http://$ipadress:$port/xstudio/api?command=getInfo >./curlresult.txt curlError=$? echo >>./log.txt echo Curl returned error $curlError >>./log.txt # assertion if string is found the server asnwers something good to te request grep "application_title" curlresult.txt >/dev/null grepError=$? echo gred returned error $grepError >>./log.txt cat ./curlresult.txt >>./log.txt rm ./curlresult.txt That part run the curl command and assert results This is a sample and should not be taken as the right practice for such a script … Note: Xqual does not provide nor support test scripts xstudio may have to be replaced by the name of the your server e;g; ‘xqual’, ‘cannes’ etc .

That part analyses return and exit accordingly # see if you got a success errorcode=0 if [ $grepError -eq 0 ] && [ $curlError -eq 0 ] then echo "[Success] Server answered" >> ./log.txt # if we expected a failure then this not good if [ "$expectedresult" = "Failure" ] echo "[Failure] we expected a $expectedresult" >>./log.txt errorcode=1 # otherwise this is as expected elif [ "$expectedresult" = "Success" ] echo "[Success] we expected a $expectedresult" >>./log.txt fi # you got a failure ... else echo "[Failure] Didn't get answer back" >>./log.txt errorcode=2 # handle errorcode exit $errorcode That part analyses return and exit accordingly This is a sample and should not be taken as the right practice for such a script … Note: Xqual does not provide nor support test scripts

The script fills the “log.txt “file Note that: The script fills the “log.txt “file This file will be parsed and analyzed by the “shell.jar” Launcher To know how the launcher runs the script and how it gets results back, you need to see the documentation of the launcher you use Here : http://www.xqual.com/documentation/launchers/shell.html Every Launcher act differently

“functional test on API yyy” A test that has been verified through on-the-spot execution can then be included into any campaign XStudio DB Campaign “functional test on API yyy” Testxxx You include this Testxxx as part of a campaign

To define the content (which tests are part of the campaign) you can: In the campaign tree , choose the folder in which you want to locate the campaign Then create a campaign To define the content (which tests are part of the campaign) you can: Select the tests one by one Select test based on a filter Select all test that are linked to a SUT … or link linked to a set of Requirements … or linked to a set of spec… This is not the purpose of this presentation

Then for a campaign, you create a session and, as for the on-the-spot Run, you need to provide : The configuration The SUT against which the session will run The agents that can execute that session

Summary: We reviewed How to link a test to launcher ( in this case a shell launcher) How to scan existing test How to create multiple configuration A sample of shell script (bash .sh) We recommend you to: Create your own shell Scan and import them into you DB Run them on the spot

End of presentation