Size: 5553
Comment:
|
Size: 5647
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 68: | Line 68: |
|| [[https://reviews.freebsd.org/D11036|D11036]] || Open || | || [[https://reviews.freebsd.org/D11036|D11036]] || [[https://github.com/freebsd/freebsd/commit/6beb3f15a2ac9db206be48be3b6874b7decf691f|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>)
Contents
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 under src/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 problematic in cases when direct testing of some newly installed or updated utility/library has to be performed. It makes testing changes to libraries and utilities difficult as one would like to perform tests (e.g. to ensure a proper build environment) before proceeding for installation.
The problem
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 will ease the process of writing 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.
NOTE: The major objective of this project is to add test coverage for all the base utilities in FreeBSD. Everything else are would-be-nice components which will be worked upon simultaneously during the duration but with a slightly lower priority.
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
(In progress)
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 >> ./functional_test <utility> --<option1> --<option2> ...
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 above mentioned 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)
- Set of test programs to verify basic functionality of all the base utilities in FreeBSD.
Deliverables
(To be updated)
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.
The Code
github/smoketestsuite - Contains a rough implementation sketch of the smoke-testing tool.
Differentials