# Installation ## Pre-requisites [Setup the pre-requisite](http://docs.automotivelinux.org/docs/devguides/en/dev/reference/host-configuration/docs/1_Prerequisites.html) then [install the Application Framework](http://docs.automotivelinux.org/docs/devguides/en/dev/reference/host-configuration/docs/2_AGL_Application_Framework.html) on your host. You will also need to install lua-devel >= 5.3 to be able to build the project. Fedora: ```bash dnf install lua-devel ``` OpenSuse: ```bash zypper install lua53-devel ``` Ubuntu (>= Xenial), Debian stable: ```bash apt-get install liblua5.3-dev ``` ## Grab source and build Download the **afb-test** binding source code using git: ```bash git clone --recurse-submodules https://github.com/iotbzh/afb-test cd afb-test mkdir build cd build cmake .. && make ``` ## Launch the example To launch the binding use the command-line provided at the end of the build. This will launch the test of an Helloworld binding example. The code of the test is available from the LUA file `conf.d/project/lua.d/helloworld.lua`. The example will run some basics tests on API verb calls and events received. ```lua function _callback(responseJ) _AFT.assertStrContains(responseJ.response, "Some String") end function _callbackError(responseJ) _AFT.assertStrContains(responseJ.request.info, "Ping Binder Daemon fails") end function _callbackEvent(eventName, eventData) _AFT.assertEquals(eventData, {data = { key = 'weird others data', another_key = 123.456 }}) end _AFT.addEventToMonitor("hello/anEvent") _AFT.addEventToMonitor("hello/anotherEvent", _callbackEvent) _AFT.addLogToMonitor("hello", "warning", "verbose called for My Warning message!") _AFT.testVerbStatusSuccess('testPingSuccess','hello', 'ping', {}) _AFT.testVerbResponseEquals('testPingSuccess','hello', 'ping', {}, "Some String") _AFT.testVerbResponseEquals('testPingSuccess','hello', 'ping', {}, "Unexpected String") _AFT.testVerbCb('testPingSuccess','hello', 'ping', {}, _callback) _AFT.testVerbStatusError('testPingError', 'hello', 'pingfail', {}) _AFT.testVerbResponseEqualsError('testPingError', 'hello', 'pingfail', {}, "Ping Binder Daemon fails") _AFT.testVerbResponseEqualsError('testPingError', 'hello', 'pingfail', {}, "Ping Binder Daemon succeed") _AFT.testVerbCbError('testPingError', 'hello', 'pingfail', {}, _callbackError) _AFT.testVerbStatusSuccess('testEventAdd', 'hello', 'eventadd', {tag = 'event', name = 'anEvent'}) _AFT.testVerbStatusSuccess('testEventSub', 'hello', 'eventsub', {tag = 'event'}) _AFT.testVerbStatusSuccess('testEventPush', 'hello', 'eventpush', {tag = 'event', data = { key = 'some data', another_key = 123}}) _AFT.testVerbStatusSuccess('testEventAdd', 'hello', 'eventadd', {tag = 'evt', name = 'anotherEvent'}) _AFT.testVerbStatusSuccess('testEventSub', 'hello', 'eventsub', {tag = 'evt'}) _AFT.testVerbStatusSuccess('testEventPush', 'hello', 'eventpush', {tag = 'evt', data = { key = 'weird others data', another_key = 123.456}}) _AFT.testVerbStatusSuccess('testGenerateWarning', 'hello', 'verbose', {level = 4, message = 'My Warning message!'}) _AFT.testEvtReceived("testEvent", "hello/anEvent") _AFT.testEvtReceived("testEventCb", "hello/anotherEvent") _AFT.testLogReceived("LogReceived", "verbose called for My Warning message!") _AFT.testCustom("mytest", function() _AFT.assertEquals(false, false) end) ``` > **NOTE**: I suggest you to take this lua file example to make your own test > then read the following the chapter if needed to write more complicated tests. ```bash $ afb-daemon --name afbd-test --port=1234 --workdir=package --ldpaths=/opt/AGL/lib64/afb:lib --token= --tracereq=common --verbose NOTICE: Can't connect supervision socket to @urn:AGL:afs:supervision:socket: Connection refused NOTICE: [API hello] hello binding comes to live NOTICE: [API ave] dynamic binding AVE(ave) comes to live NOTICE: [API hi] dynamic binding AVE(hi) comes to live NOTICE: [API salut] dynamic binding AVE(salut) comes to live NOTICE: [API lib/test-binding.so] Controller in afbBindingVdyn NOTICE: [API lib/test-binding.so] Controller API='test' info='Binding made to tests other bindings' NOTICE: API monitor started HOOK: [xreq-000001:monitor/set] BEGIN HOOK: [xreq-000001:monitor/set] json() -> { "verbosity": "debug" } HOOK: [xreq-000001:monitor/set] success(null, (null)) HOOK: [xreq-000001:monitor/set] END HOOK: [xreq-000002:monitor/trace] BEGIN HOOK: [xreq-000002:monitor/trace] json() -> { "add": { "event": "push_after" } } HOOK: [xreq-000002:monitor/trace] subscribe(monitor/trace:1) -> 0 HOOK: [xreq-000002:monitor/trace] success(null, (null)) HOOK: [xreq-000002:monitor/trace] END HOOK: [xreq-000003:monitor/set] BEGIN HOOK: [xreq-000003:monitor/set] json() -> { "verbosity": "debug" } HOOK: [xreq-000003:monitor/set] success(null, (null)) HOOK: [xreq-000003:monitor/set] END HOOK: [xreq-000004:monitor/trace] BEGIN HOOK: [xreq-000004:monitor/trace] json() -> { "add": { "event": "push_after" } } HOOK: [xreq-000004:monitor/trace] subscribe(monitor/trace:1) -> 0 HOOK: [xreq-000004:monitor/trace] success(null, (null)) HOOK: [xreq-000004:monitor/trace] END # XML output to var/jUnitResults.xml # Started on Thu Jun 14 18:12:33 2018 # Starting test: testPingSuccess INFO: API hello starting... NOTICE: [API hello] hello binding starting NOTICE: API hello started HOOK: [xreq-000005:hello/ping] BEGIN HOOK: [xreq-000005:hello/ping] json() -> null HOOK: [xreq-000005:hello/ping] success("Some String", Ping Binder Daemon tag=pingSample count=1 query=null) HOOK: [xreq-000005:hello/ping] END # Starting test: testPingSuccess HOOK: [xreq-000006:hello/ping] BEGIN HOOK: [xreq-000006:hello/ping] json() -> null HOOK: [xreq-000006:hello/ping] success("Some String", Ping Binder Daemon tag=pingSample count=2 query=null) HOOK: [xreq-000006:hello/ping] END # Starting test: testPingSuccess HOOK: [xreq-000007:hello/ping] BEGIN HOOK: [xreq-000007:hello/ping] json() -> null HOOK: [xreq-000007:hello/ping] success("Some String", Ping Binder Daemon tag=pingSample count=3 query=null) HOOK: [xreq-000007:hello/ping] END # Failure: var//aft.lua:127: expected: "Unexpected String" # actual: "Some String" # Starting test: testPingSuccess HOOK: [xreq-000008:hello/ping] BEGIN HOOK: [xreq-000008:hello/ping] json() -> null HOOK: [xreq-000008:hello/ping] success("Some String", Ping Binder Daemon tag=pingSample count=4 query=null) HOOK: [xreq-000008:hello/ping] END # Starting test: testPingError HOOK: [xreq-000009:hello/pingfail] BEGIN HOOK: [xreq-000009:hello/pingfail] fail(failed, Ping Binder Daemon fails) HOOK: [xreq-000009:hello/pingfail] END # Starting test: testPingError HOOK: [xreq-000010:hello/pingfail] BEGIN HOOK: [xreq-000010:hello/pingfail] fail(failed, Ping Binder Daemon fails) HOOK: [xreq-000010:hello/pingfail] END # Failure: var//aft.lua:145: Received the not expected value: "Ping Binder Daemon fails" # Starting test: testPingError HOOK: [xreq-000011:hello/pingfail] BEGIN HOOK: [xreq-000011:hello/pingfail] fail(failed, Ping Binder Daemon fails) HOOK: [xreq-000011:hello/pingfail] END # Starting test: testPingError HOOK: [xreq-000012:hello/pingfail] BEGIN HOOK: [xreq-000012:hello/pingfail] fail(failed, Ping Binder Daemon fails) HOOK: [xreq-000012:hello/pingfail] END # Starting test: testEventAdd HOOK: [xreq-000013:hello/eventadd] BEGIN HOOK: [xreq-000013:hello/eventadd] get(tag) -> { name: tag, value: event, path: (null) } HOOK: [xreq-000013:hello/eventadd] get(name) -> { name: name, value: anEvent, path: (null) } HOOK: [xreq-000013:hello/eventadd] success(null, (null)) HOOK: [xreq-000013:hello/eventadd] END # Starting test: testEventSub HOOK: [xreq-000014:hello/eventsub] BEGIN HOOK: [xreq-000014:hello/eventsub] get(tag) -> { name: tag, value: event, path: (null) } HOOK: [xreq-000014:hello/eventsub] subscribe(
## Introduction
The `meta-agl-demo` layer is the reference user interface layer for the DEMO
platform of Automotive Grade Linux (AGL).
The layer provides a reference platform and applications.
The BitBake target name for the DEMO platform is `agl-demo-platform`, which is
the full DEMO platform image.
## Layer Dependencies
This section describes dependencies for the `meta-agl-demo` layer.
Dependencies are grouped into base, hardware, and feature dependencies.
### Base Dependencies
The `meta-agl-demo` layer has the following base dependencies:
* Yocto Project Release:
- URI: git://git.yoctoproject.org/poky
- Branch: "dunfell"
- Tested Revision: See the [`default.xml`](https://github.com/leon-anavi/AGL-repo/blob/master/default.xml)
manifest file for the `AGL-repo` repository for revision
information.<br/><br/>
* AGL `meta-agl` Layer:
- URI: https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl
- Branch: "master"<br/><br/>
* OpenEmbedded `meta-openembedded` Layer:
- Branch: "thud"
- Tested Revision: See the [`default.xml`](https://github.com/leon-anavi/AGL-repo/blob/master/default.xml)
manifest file for the `AGL-repo` repository for revision
information.
Specifically, out of `meta-openembedded`, these sub-layers are used:
- `meta-oe`
- `meta-multimedia`
- `meta-networking`
- `meta-python`<br/><br/>
* Yocto Project `meta-qt5` Layer from the
[OpenEmbedded Layer Index](https://layers.openembedded.org/layerindex/branch/master/layers/):
- URI: https://github.com/meta-qt5/meta-qt5.git
- Branch: "dunfell"
- Tested Revision: See the [`default.xml`](https://github.com/leon-anavi/AGL-repo/blob/master/default.xml)
manifest file for the `AGL-repo` repository for revision
information.<br/><br/>
### Feature Dependencies
The `meta-agl-demo` layer has the following AGL
[feature](../getting_started/reference/getting-started/image-workflow-initialize-build-environment.html#agl-features)
dependencies:
* Yocto Project `meta-security` Layer:
- URI: https://git.yoctoproject.org/cgit/cgit.cgi/meta-security
- Branch: "master"
- Tested Revision: See the [`default.xml`](https://github.com/leon-anavi/AGL-repo/blob/master/default.xml)
manifest file for the `AGL-repo` repository for revision
information.<br/><br/>
* AGL's `meta-app-framework` Layer within the `meta-agl` Layer:
- URI: https://gerrit.automotivelinux.org/gerrit/gitweb?p=AGL/meta-agl.git
- Branch: "master"<br/><br/>
**The `agl-sota` Feature:**
* Here Technologies' `meta-updater` Layer:
- URI: https://github.com/advancedtelematic/meta-updater/
- Branch: "dunfell"<br/><br/>
* Here Technologies' `meta-updater-qemux86-64` Layer:
- URI: https://github.com/advancedtelematic/meta-updater-qemux86-64/
- Branch: "dunfell"<br/><br/>
* OpenEmbedded's `meta-openembedded` Layer:
- URI: https://github.com/openembedded/meta-openembedded
- Branch: "dunfell"
- Tested Revision: See the [`default.xml`](https://github.com/leon-anavi/AGL-repo/blob/master/default.xml)
manifest file for the `AGL-repo` repository for revision
information.
Specifically, out of `meta-openembedded`, these sub-layers are used:
- `meta-filesystems`
- `meta-oe`
- `meta-python`<br/><br/>
**The `agl-netboot` Feature:**
* AGL's `meta-netboot` Layer within the `meta-agl` Layer:
- URI: https://gerrit.automotivelinux.org/gerrit/gitweb?p=AGL/meta-agl.git
- Branch: "master"