Smoke testing of all base utilities


Overview

Smoke testing is a set of light tests which are done for checking basic functionalities of a software to ascertain if the crucial functions work correctly.
FreeBSD currently has a set of tests which are run using the kyua framework. These tests need to be first installed individually before they can be used for testing. This proves to be problematic in cases when direct testing of some newly installed or updated utility has to be performed. It makes testing changes to utilities and libraries difficult as one would like to perform tests (e.g. to ensure a proper build environment) before proceeding for installation.

Project Description

This project aims to develop a test infrastructure and automation tool along with basic tests to verify if all the base utilities in FreeBSD are linked properly. The testing framework is supposed to ease the process of writing "trivial" test cases which will be run in a completely automated and developer friendly manner without need for any prior installation. Once integrated, the tool will also facilitate further development of tests.

Implementation Details

The following steps will be performed in order to understand the problem at hand and the approaches which can be used -

Test Plan

The file functional_test.c is a simple test file which checks whether the ls utility is properly linked by running trivial commands. The options supported by ls are stored in short_options[] and long_options[] present in functional_test.h.

The smoke tests can be run using the following commands -

>> make
>> make test

It should be noted that finally the tests will be automated with appropriately passed options. The above commands will not have to be run for testing individual programs. The test file uses getopt() and getopt_long() for testing the validity of the passed options. If a valid option is passed, the command <utility> --<option(i)> is executed. In case the command fails to execute for a valid option, this will imply that the utility under test is not properly linked.

Populating short_options[] and long_options[]

short_options[] and long_options[] need to be initially populated with a few supported options for all the base utilities. This can be done by using either one or both of the following available approaches -

An automation script will be written which will populate short_options[] and long_options[] by following the above mentioned approaches and will generate relevant test files. The initial version of the generated test scripts will only test trivial functionalities.

{*} More details regarding automated generation of test scripts available here. Comments and suggestions are most welcome!

Although the test plan does not check the entire state of application under test, it suffices for the initial purposes of smoke testing.

Expected Results

(To be updated)

Milestones

Week

Duration

Description

Status

Start of Coding

{*}

1

May 30

Start of coding.

(./)

Add kyua based tests

{*}

1

May 30 - June 5

Start adding kyua based tests to utilities without test coverage

(./)

2

June 6 - June 12

Table design adapted from NonBSMtoBSMConversionTools#Milestones

Deliverables

Deliverables for first evaluation

(To be updated)

Weekly Reports

Week

Report

1

2017-June/001060

2

2017-June/001064

The Code

github/smoketestsuite - Contains a rough implementation sketch of an in-progress smoke-testing tool.

Differentials

Week

Differential

Status

1

D11020

Merged (./)

D11036

Merged (./)

2

D11084

Merged (./)

D11158

Open