From Fedora Project Wiki

(Created page with "{{QA/Test_Case |description= Command-line interface |setup= # Ensure that jenkins-cli package is installed |actions= # run "jenkins-cli -s http://localhost:8080/ help" ## you...")
 
No edit summary
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description= Command-line interface
|description=Try to interact with Jenkins from command-line.


|setup=
|setup=
# Ensure that jenkins-cli package is installed
# Ensure that the Jenkins is up and running
|actions=
|actions=
# run "jenkins-cli -s http://localhost:8080/ help"
# try to run: <code>jenkins-cli -s http://localhost:8080/ help</code>
## you should see list of all available commands
#* you should see list of all available commands
# run "jenkins-cli -s http://localhost:8080/ list-jobs"
# try to run: <code>jenkins-cli -s http://localhost:8080/ list-jobs</code>
## you should see list of all configured projects:
#* you should see a list of all projects:
<pre>
<pre>
project1
project1
</pre>
</pre>
# run "jenkins-cli -s http://localhost:8080/ build project1 -s -v"
# try to run: <code>jenkins-cli -s http://localhost:8080/ build project1 -s -v</code>
## this should start build of "project1" and you should see console output from the build:
#* this should fire a new build of "project1":
<pre>
<pre>
Started project1 #2
Started project1 #2
Line 24: Line 24:
Completed project1 #2 : SUCCESS
Completed project1 #2 : SUCCESS
</pre>
</pre>
# run "jenkins-cli -s http://localhost:8080/ groovysh"
# try to run <code>jenkins-cli -s http://localhost:8080/ groovysh</code>
## you should see Groovy shell prompt:
#* you should see a Groovy shell prompt:
<pre>
<pre>
Groovy Shell (1.8.9, JVM: 1.8.0_11)
Groovy Shell (1.8.9, JVM: 1.8.0_11)
Line 32: Line 32:
groovy:000>
groovy:000>
</pre>
</pre>
# try to run some Groovy code, for example '"uname -a".execute().text'
# try to run some Groovy code, for example: <code>uname -a".execute().text</code>
# type "quit" to quit the Groovy shell
# type "quit" to quit the Groovy shell
|results=
|results=
# there should be no failures or stacktraces printed on stdout/stderr
# there should be no failures or stacktraces printed on stdout/stderr
}}
}}

Revision as of 07:05, 3 September 2014

Description

Try to interact with Jenkins from command-line.

Setup

  1. Ensure that the Jenkins is up and running

How to test

  1. try to run: jenkins-cli -s http://localhost:8080/ help
    • you should see list of all available commands
  2. try to run: jenkins-cli -s http://localhost:8080/ list-jobs
    • you should see a list of all projects:
project1
  1. try to run: jenkins-cli -s http://localhost:8080/ build project1 -s -v
    • this should fire a new build of "project1":
Started project1 #2
Started by command line by anonymous
Building in workspace /var/lib/jenkins/jobs/project1/workspace
[workspace] $ /bin/sh -xe /tmp/hudson7729477737891392405.sh
+ echo 'Build Successful!'
Build Successful!
Finished: SUCCESS
Completed project1 #2 : SUCCESS
  1. try to run jenkins-cli -s http://localhost:8080/ groovysh
    • you should see a Groovy shell prompt:
Groovy Shell (1.8.9, JVM: 1.8.0_11)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------
groovy:000>
  1. try to run some Groovy code, for example: uname -a".execute().text
  2. type "quit" to quit the Groovy shell

Expected Results

  1. there should be no failures or stacktraces printed on stdout/stderr