##Fabric CA FVT tests for Continuous Integration
###Building the test image
The tests that will run are in
$GOPATH/src/github.com/hyperledger/fabric-ca/scripts/fvt
From ${GOPATH}/src/github.com/hyperledger/fabric-ca
, issue
make docker-fvt
to generate the docker test image.
You can verify the successful build of the test images by issuing
docker images
and look for the hyperledger/fabric-ca-fvt
image in the output.
To remove build artifacts of the docker fvt test image, issue
make docker-clean
###Running the fvt tests
Once the test image is successfully built, from ${GOPATH}/src/github.com/hyperledger/fabric-ca
, issue
docker run -v $PWD:/opt/gopath/src/github.com/hyperledger/fabric-ca hyperledger/fabric-ca-fvt
By default, the resulting container will run make fvt-tests
in the environment provided by the hyperledger/fabric-ca-fvt docker image. Output will go to the associated terminal.
###Interactively interfacing with the test container
To start a command-line instance of the test container without automatically running the tests, issue
docker run -v $PWD:/opt/gopath/src/github.com/hyperledger/fabric-ca -ti hyperledger/fabric-ca-fvt bash
Since the source code is mounted from your host, you can make any changes you want, then manually issue make fvt-tests
from inside the container.
###Running continuous integration tests
To simulate a continuous integration test run, issue:
make ci-tests
This will build a docker-fvt test image and run all of the currently defined unit tests, as well as all fvt tests.
###Creating tests
You may add additional tests (essentially any scripts or executables, in any language, that generates a return code and follows the naming convention *test.sh
) by placing them in the $GOPATH/src/github.com/hyperledger/fabric-ca/scripts/fvt
directory. You may invoke them directly within an interactive test container, or rely on the image's default command to succesively run all of the tests in the `$GOPATH/src/github.com/hyperledger/fabric-ca/scripts/fvt`` directory. Note that each test in the fvt directory will be run twice: once using TLS and once without using TLS. Consequently, the tests should be written to run in either environment.
This work is licensed under a Creative Commons Attribution 4.0 International License.
s