Differences between revisions 37 and 38
Revision 37 as of 2017-07-12T19:17:13+0000
Size: 8971
Editor: ShivanshRai
Comment: Minor fixes and updates
Revision 38 as of 2017-07-12T19:37:00+0000
Size: 8971
Editor: ShivanshRai
Comment:
Deletions are marked like this. Additions are marked like this.
Line 106: Line 106:
||<|2> 4 ||<|1> [[https://reviews.freebsd.org/D11315|D11315]] ||<|1> [[https://github.com/freebsd/freebsd/commit/b19d13f1dc59db41237950efb6c4210828af3cde|Merged]] (./) ||
||<|1> [[https://reviews.freebsd.org/D11318|D11318]] ||<|1> Open ||
||<|2> 4 ||<|1> [[https://reviews.freebsd.org/D11315|D11315]] ||<|1> Open ||
||<|1> [[https://reviews.freebsd.org/D11318|D11318
]] ||<|1> [[https://github.com/freebsd/freebsd/commit/b19d13f1dc59db41237950efb6c4210828af3cde|Merged]] (./) ||

Smoke testing of all base utilities

  • Student: Shivansh Rai (<shivansh@freebsd.org>)

  • Mentors:
    • Alan Somers (<asomers@freebsd.org>)

    • Brooks Davis (<brooks@freebsd.org>)

    • Ngie Cooper (<ngie@freebsd.org>)


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 -

  • Note how testing has been traditionally done in FreeBSD.
  • Study the kyua framework and the approaches currently being used for testing.

  • Study the current problems faced as a developer or tester when writing new test cases, and the problems faced as a release engineer or tester when executing existing test cases.

Test Plan

{*} The test plan for the project has been completely revamped. This wiki will be updated soon, meanwhile, the current implementation is available here.

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

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 -

  • Parse man pages for each utility to get the supported options.
  • Pass an unsupported option to the utility. This might generate a usage message which can then be parsed. The unsupported option will be chosen experimentally.

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.

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

  • Set of test programs to verify basic functionality of all the base utilities in FreeBSD.
  • An automated tooling to generate test scripts which confirm minimal set of functionalities of a utility to check whether it is properly linked.

(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

3

June 13 - June 19

Update smoke testing tool.

(./)

Fix a bug in the implementation of ln(1).

4

June 20 - June 26

Add functionality to generate trivial tests.

(./)

First evaluations

{*}

Table design adapted from NonBSMtoBSMConversionTools#Milestones

Deliverables

Deliverables for first evaluation

  • Add kyua based test programs for a subset of base utilities which are currently without any test coverage. The maximum number of utilities possible in the duration will be covered.

  • Prepare a basic design of the automation tool. Cover generation of a limited number of test scripts.

(To be updated)

Weekly Reports

Week

Report

1

2017-June/001060

2

2017-June/001064

3

2017-June/001070

4

2017-July/001079

5

2017-July/001086

Bugs reported

PR Number

Fix

219943

D11167

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

Merged (./)

3

D11159

Merged (./)

D11167

Merged [1] [2] (./)

4

D11315

Open

D11318

Merged (./)

5

D11529

Merged (./)


SummerOfCode2017/SmokeTestingOfBaseUtilities (last edited 2021-04-26T04:41:59+0000 by JethroNederhof)