From Fedora Project Wiki

No edit summary
No edit summary
Line 6: Line 6:
# ssh into an instance.
# ssh into an instance.
# Next check whether the image is Base or Atomic.
# Next check whether the image is Base or Atomic.
# If Base image install Docker.
# If Atomic image check for Docker.
To check whether image is Base or Atomic:


   $ stat /run/ostree-booted
   $ stat /run/ostree-booted
   $ echo $?
   $ echo $?
 
 
For Base image:
3. If Base image install Docker and then check for Docker.


   $ dnf -y install docker
   $ dnf -y install docker
   $ rpm -q docker
   $ rpm -q docker


For Atomic image:
4. If Atomic image check for Docker.


   $ rpm -q docker
   $ rpm -q docker
Line 32: Line 28:
   1
   1


This means the image is Base image.
'''Exit code is 1; this means the image is Base image.'''


Step #3 should install Docker.
3. Step #3 should install Docker on Base image and return the Docker build on next step.


If Step #2 returns Atomic image, Like:
If Step #2 returns Atomic image, Like:
Line 42: Line 38:
   0
   0


This means the image is Atomic.
'''Exit code is 0; this means the image is Atomic image.
'''


Step #4 will return the Docker build.
4. Step #4 will return the Docker build for Atomic image.


|optional=Check for Docker info.
|optional=Check for Docker info.

Revision as of 02:40, 6 May 2016

Description

This test case is to make sure if Docker is installed. It first checks the image. If the image is Base image it installs Docker. If the image is Atomic image it checks whether Docker is installed there or not.

Setup

Test this on both Base and Atomic image.

How to test

Be as specific as required for the target audience.

  1. ssh into an instance.
  2. Next check whether the image is Base or Atomic.
 $ stat /run/ostree-booted
 $ echo $?

3. If Base image install Docker and then check for Docker.

 $ dnf -y install docker
 $ rpm -q docker

4. If Atomic image check for Docker.

 $ rpm -q docker

Expected Results

The following must be true to consider this a successful test run.

  1. Step #1 You should be able to login to the instance.
  2. Step #2 You will be able to see whether the image is Base or Atomic.
 $ stat /run/ostree-booted
 $ echo $?
 1

Exit code is 1; this means the image is Base image.

3. Step #3 should install Docker on Base image and return the Docker build on next step.

If Step #2 returns Atomic image, Like:

 $ stat /run/ostree-booted
 $ echo $?
 0

Exit code is 0; this means the image is Atomic image.

4. Step #4 will return the Docker build for Atomic image.

Optional

Check for Docker info.

 $ docker info