The test setup required for running the end to end test of bluetooth mapper requires two separate machines in bluetooth range. The paypal/gatt package used for bluetooth mapper makes use of hci interface for bluetooth communication. Out of two machines specified, one is used for running bluetooth mapper and other is used for running a test server which publishes data that the mapper use for processing. The test server created here is also using the paypal/gatt package.
Steps for running E2E tests
- Turn ON bluetooth service of both machines
- Run server on first machine. Follow steps given below for running the test server.
- For running mapper tests on second machine, clone kubeedge code and follow steps 4,5 and 6.
- Update “dockerhubusername” and “dockerhubpassword” in tests/e2e/scripts/fast_test.sh with your credentials.
- Compile bluetooth mapper e2e by executing the following command in $GOPATH/src/github.com/kubeedge/kubeedge.
bash -x tests/e2e/scripts/compile.sh bluetooth
- Run bluetooth mapper e2e by executing the following command in $GOPATH/src/github.com/kubeedge/kubeedge.
bash -x tests/e2e/scripts/execute.sh bluetooth
Test Server Creation
- Copy devices folder in tests/e2e/stubs and keep it in path TESTSERVER/src/github.com in first machine.
Update the following in devices/mockserver.go
- package devices -> package main
- import “github.com/kubeedge/kubeedge/tests/stubs/devices/services” to “github.com/devices/services”
Build the binary using
go build mockserver.go
Run the server using
sudo ./mockserver -logtostderr -duration=<specify duration for which test server should be running>
sudo is required for getting hci control of the machine.
This runs your test server which publishes data for the mapper to process.