unittests/avocadoserver/models_unittest.py: add job and test activities tests

Signed-off-by: Cleber Rosa <crosa@redhat.com>
avocadoserver/models.py: make Test a standalone entity

With more data pointing to a test, it makes sense not to simply refer
to a test as a given test_tag inside a job, but as a standalone entity.

Other entitities, such as test activity and test data (logs, images, etc)
will relate to individual test instances (which will then have a tag and
be a part of a job).

Signed-off-by: Cleber Rosa <crosa@redhat.com>
serializers.py: reorganization

Signed-off-by: Cleber Rosa <crosa@redhat.com>
avocadoserver/settings.py: disable debug

The large debug messages are not really helping when the output is not
intended to be read by humans (we are a API/RPC server afterall).

Also, allow connection from any host. I don't think it's our task
to deal with controlling host access, at least for now.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
tests: implement /tests/ resource services

This will for now also be kept as a top level resource. Time will
tell if this resource (that by default lists all tests) will be
useful.

To get the tests from a particular job, the URI is going to be:

/jobs/<id>/tests/.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
avocadoserver/settings.py: enable only JSON parser

To avoid surprises, and to keep consistency with the default renderers
(only JSON), enable by default only the JSON parser.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Minor fixes for copyright information

Signed-off-by: Cleber Rosa <crosa@redhat.com>
reset-and-run.sh: use port 9405 by default

Signed-off-by: Cleber Rosa <crosa@redhat.com>
jobs API: allow to retrieve job either by numeric id or uniqueident

Numeric ID, aka PK, is the integer automatically assigned to the
underlying database record of a given model. For jobs, another way
to refer to them is to use their unique identifier, a uuid4 number
that is either explicitly set or automatically generated.

By using the API URI /jobs/<uniqueident/ it's possible to quickly
and effectively (resource wise) determine if a given job exists on
the server.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
API /jobs/<id>/tests: implement GET view

That lists tests only for job identified by <id>.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
API /jobs/<id>/tests: replace implementation of @link view for drf-nested-routers

Implementation using an extension package for django-rest-framework that provides
proper support for nesting resources.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
API /jobs/<id>/tests/ POST: add support for creating new tests

By POSTing into this URL a new test will be added to the chosen job.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
API /jobs/<id>/testcount and /jobs/<id>/passrate

Implement those two utility APIs for getting job summary information.

Warning: the actual passrate calculation is very simplistic and may
need to be revisited.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
README.rst: update documentation to include new APIs

Signed-off-by: Cleber Rosa <crosa@redhat.com>
API /jobs/<id>/activities/

Implement API for job activities. See README.rst for more info.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
API /jobs/<id>/tests/<id>/activities/

Implement API for test activities. See README.rst for more info.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
API /jobs/<id>/tests/<id>/data/

Implement API for test data. See README.rst for more info.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Inspekt appointed fixes

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Merge pull request #5 from avocado-framework/results

Add support for storing and querying test results