QA:Testcase VirtSandbox ExitStatus

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
 
Line 2: Line 2:
 
|description=This test aims to verify that the exit status from sandboxed commands is correctly propagated to the host
 
|description=This test aims to verify that the exit status from sandboxed commands is correctly propagated to the host
 
|setup=
 
|setup=
Pull in the libvirt-sandbox package itself
+
Follow the [[QA:Testcase_VirtSandbox_CommonSetup | VirtSandbox common setup]]
  # yum install libvirt-sandbox
+
If testing as root with LXC:
+
  # yum install libvirt-daemon-lxc
+
  # export URI=lxc:///
+
Else if testing as non-root with QEMU
+
  # yum install libvirt-daemon-kvm
+
  # export URI=qemu:///session
+
 
|actions=
 
|actions=
 
# Run a command with "normal" exit status
 
# Run a command with "normal" exit status

Latest revision as of 12:59, 13 April 2012

Contents

Description

This test aims to verify that the exit status from sandboxed commands is correctly propagated to the host

Setup

Follow the VirtSandbox common setup

How to test

  1. Run a command with "normal" exit status
    # /bin/true
    # echo $?
  2. Run a command with "normal" exit status in a sandbox
    # virt-sandbox -c $URI /bin/true
    # echo $?
  3. Run a command with "error" exit status
    # /bin/false
    #echo $?
  4. Run a command with "error" exit status in a sandbox
    # virt-sandbox -c $URI /bin/false
    # echo $?
  5. Run a command with a custom exit status
    # /bin/sh "exit 4"
    # echo $?
  6. Run a command with a custom exit status in a sandbox
    # virt-sandbox -c $URI -- /bin/sh -c "exit 4"
    # echo $?

Expected Results

  1. 0
  2. 0
  3. 1
  4. 1
  5. 4
  6. 4