json_tests.py: Add unit tests for json backend

Refactor run.py a little to allow testing the Backend.initialize() call.

This adds tests for the output of the json piglit format. This currently
has 4 failing tests exposing two separate bugs:
1) the logger verbosity level is not stored and thus cannot be used by
resume
2) lspci, uname, and glxinfo are not written into the root of the json
output.

This also adds a unit test utility function for skipping unit tests when
the OS is not the required OS.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
framework: fix glxinfo, uname, and lspci in json output

Move the environment information back into the root of the json output
dictionary.

Also modifies two tests. One is removed because it is basically a
duplicate of the tests added in the last patch, the other is simplified
to be more robust.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
run.py: store log_level (verbosity) for resume

This allows resume to use the same level of verbosity as the initial
run.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
results_v0_tests.py: Use TestrunResult.load instead of load_results

framework.results.load_results calls update_results() internally. This
means that as soon as a second method is added that updates results to
version 2 then the tests will start failing.

v2: - add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
json_.py: Bump results version to 2

This corrects in a permanent and automatic way the changes in the
results that were fixed in the previous patch.

v2: - add this patch
v3: - Only add each element if it exists
    - Put the tests in their own module
v4: - actually check that test module into git...

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>