Runtime Root feature Jason Kenny
Why do this! Make ATS easier to use Make ATS easier to package Current logic is difficult to follow and not consistent between different tools Current TS_ROOT logic does not work correctly for all tools Make ATS easier to package Can define relocatable packages types ATS will not have to define the install location at compiler time. The packaging system can define this as it should Make it easier to Test Current TS_ROOT logic requires us: three directories that need to have chown set to nobody 11 PROXY_CONFIG_XXX values that have to be set Copy/Setup of 160 – 245 files
What is wrong with TS_ROOT TS_ROOT is based on replacing a compile “package install root” location Setting up all the needed paths and file is not clearly documented and difficult to get correct Can not easily modify subdirectory location Layouts for many system have data location that are absolute paths that are defined without $PREFIX variable There are currently two paths for how a directory is found: Layout class: Gets compile time locations Modifies the value with TS_ROOT Default config values for records.config Get compile time locations Does not modify with TS_ROOT
What is the Run Root Feature Allow ATS to detect/define layout at run time. Clean up the logic in the ATS on how it can discover where to find the data files Provide a command line tools to help manage creation of new sandbox roots
Run time logic Everything goes through Layout class Layout is defined by a YAML file Load logic: Command line option --run-root Environment variable TS_RUNROOT TS_ROOT Environment Variable Look in current directory and look up N (default 2) directories for Yaml File Look in executable directory and look up N directories for Yaml File Compiler defaults in layout class
runroot_path.yaml example (current) prefix: /Users/jkenny/ats/mysandbox/ exec_prefix: /Users/jkenny/ats/mysandbox/ includedir: /Users/jkenny/ats/mysandbox/include localstatedir: /Users/jkenny/ats/mysandbox/var bindir: /Users/jkenny/ats/mysandbox/bin logdir: /Users/jkenny/ats/mysandbox/var/log/trafficserver mandir: /Users/jkenny/ats/mysandbox/share/man sbindir: /Users/jkenny/ats/mysandbox/bin sysconfdir: /Users/jkenny/ats/mysandbox/etc/trafficserver datadir: /Users/jkenny/ats/mysandbox/share/trafficserver libexecdir: /Users/jkenny/ats/mysandbox/libexec/trafficserver libdir: /Users/jkenny/ats/mysandbox/lib runtimedir: /Users/jkenny/ats/mysandbox/var/trafficserver infodir: /Users/jkenny/ats/mysandbox/info cachedir: /Users/jkenny/ats/mysandbox/var/trafficserver
Addition to traffic_layout (WIP) Usage: traffic_layout [--SWITCH [ARG]] switch______type__default___description -l, --layout tog false Show the layout (this is the default with no options given) -f, --features tog false Show the compiled features -j, --json tog false Produce output in JSON format (when supported) -i, --init Initialize the ts_runroot sandbox (details in traffic_layout --init -h) -r, --remove remove the ts_runroot sandbox (details in traffic_layout --remove -h) --force force flag for init (details in traffic_layout --force -h) -h, --help Print usage information -V, --version Print version string --run-root using TS_RUNROOT as sandbox
What is next Support relative paths in yaml file Add verify logic to check that sandbox is good Create sandbox based on values in a yaml file Better name for yaml file?
Quick State of Testing Update! Jason Kenny
Unit Testing We are using Catch now!! Features https://github.com/philsquared/Catch Features Not painful to write tests (some say pleasant) Easy to partition test grouping Easy to filter which test to run Clean reporting on error and what is wrong
Quick Example TEST_CASE( "vectors can be sized and resized", "[vector]" ) { std::vector<int> v( 5 ); REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 5 ); SECTION( "resizing bigger changes size and capacity" ) { v.resize( 10 ); REQUIRE( v.size() == 10 ); REQUIRE( v.capacity() >= 10 ); } SECTION( "resizing smaller changes size but not capacity" ) { v.resize( 0 ); REQUIRE( v.size() == 0 );
Plans with Catch Move all unit tests to use Catch Move regression tests that should be unit test to Catch
Autest (Some Highlight) Added a list command ie: autest list [-f filter] [--json] Added a When.FileModified(file) to delay start of a process Add Conditions: IsElevated – are we running elevated RunCommand – run some command, check return code CheckOutput – run a command, provide callback to stdout/err output EnsureVersion – run a command, check for a version pattern or given callback.
AuTest Extensions( Quick summary) Add some new conditions: PluginExists – tests that plugin exists HasATSFeature – Test that ATS was built with a given feature HasCurlFeature – Test that Curl has a needed feature ( such as H2 support) Adding in MakeDNServer(…) Still work in progress Fixes to MakeATSProcess() Will now work with build layouts with absolute paths Added prepare_plugin() Fixes to Microserver Lots of new tests have been added Thanks you to all that have add tests
What we need to get added (please help) Clients/Server that create error states on purpose Better H2 clients QUIK client, server Derek has added tcp_client.py Send raw data over socket and dumps raw data it receives
Thank You Questions?