# meta-iotqa
Layer for IoT Reference OS Kit QA components.
This layer is originally from https://github.com/ostroproject/meta-iotqa

Setup environment
=================
1. Host: Ubuntu 14.04 is tested and recommended.

  Install expect:  ``$ sudo apt-get install expect``

2. Boot and install the image to target device

3. Target device should be remote accessible with ssh from Host machine

Run test
=========
1. Building testsuite and tests:

 - To get tests for an image, use ``-c do_test_iot_export`` when building the image:
    ``$ bitbake <image> -c do_test_iot_export``

 - To untar the tests and testsuite run:
    ``$ tar xvf iot-testsuite.tar.gz``
    ``$ tar xvf iot-testfiles.xxx.tar.gz -C iottest/``

2. Run automated test:
     ``$ cd iottest``

     ``$ python  runtest.py -f testplan/xxx.manifest -m  [ target machine ]  -t [ target IP ] -s [ host IP ]``

# meta-iotqa
Layer for IoT Reference OS Kit QA components.
This layer is originally from https://github.com/ostroproject/meta-iotqa

## Building tests with docker

Follow the guide on [building with docker](https://github.com/intel/intel-iot-refkit#building-with-docker) and after running `$ docker/local-build.sh` you should have the test files built.

## Building tests without docker

Follow the guide on [building without docker](https://github.com/intel/intel-iot-refkit#building-without-docker) and before building an image add 'INHERIT += "test-iot"' to local.conf:
```
echo 'INHERIT += "test-iot"' >> conf/local.conf
```
Then build the image with 'do_test_iot_export' task eg.:
```
bitbake refkit-image-common:do_test_iot_export
```

## Setting up environment for running tests

1. Host: Ubuntu 14.04 is tested and recommended. Install expect as some tests might require it: `$ sudo apt-get install expect`

2. Boot and install the image to target device

3. Target device should be remote accessible with ssh from Host machine

## Running tests

After building the tests you can find the test files from intel-iot-refkit/build/tmp-glibc/deploy/testsuite/refkit-image-<profile>/.
Extracting the the test files can be done with:
```
$ tar xvf iot-testsuite.tar.gz`
$ tar xvf iot-testfiles.xxx.tar.gz -C iottest/
```

Running the tests:
```
$ cd iottest
$ python runtest.py -f testplan/xxx.manifest -m [target machine] -t [target IP] -s [host IP]
```

For example:
```
$ python runtest.py -f testplan/image-testplan.manifest -m intel-corei7-64  -t 192.168.7.2 -s 192.168.7.1
```

Improve guide on building/running tests
meta-iotqa: Improve guide on building/running tests

Signed-off-by: Simo Kuusela <4755938158c3c622d3884e9a75ed20dc865bc695@intel.com>
