summaryrefslogtreecommitdiff
path: root/automated/linux/nginx-server/odp-dpdk.sh
AgeCommit message (Collapse)Author
2017-04-19nginx-server: use configuration files and callbaksJosep Puigdemont
NGiNX can be installed in different places, and can be implemented using different IP stacks (Linux IP stack, OFP, ANS...). The nginx-server.sh script was meant to be used independently of he NGiNX version in use. Due to this it contains several initialization and configuration functions for each of the currently supported implementations. This could grow a bit too large for one single file, so we've opted for creating files with a set of required functions for each implementation. The file is sourced and it should define some functions used for the tests. The name of the file should be that of the CONFIG_TYPE defined for the test definition, plus the .sh suffix. The functions required to be implemented in the files are: - do_configure_system(): used to initialize the tests. Here any configuration required for the test, like NIC configuration, kernel module loading, etc, should be done. It is called once before any test starts. - do_start_nginx(): this function is used to start NGiNX. - do_stop_nginx(): this function is used to stop NGiNX. It may be called even if NGiNX is not running. - do_write_nginx_config(): this function is called before starting NGiNX, and it is meant to write a proper nginx.conf file for the current number of cores. - do_pre_test_cb(): this function is called before starting NGiNX, it can be used for anything deemed appropriate. - do_post_test_cb(): this function is called right after the test has finished, and before NGiNX is stopped. It can be used for anything deemed appropriate. All functions are called with the following parameters in this order: - cores: number of cores of the current test. For configure_sytem, this is the total number of physical cores available. - interface: this is the interface that NGiNX is expected to use. - IP: the IP that the web server is expected to use. The return value of the functions is not checked. Change-Id: I0321697509f9ac628e705c69285a7478dd993ace Signed-off-by: Josep Puigdemont <josep.puigdemont@linaro.org>