|
1 |
| -## PCL Integration Tests Environment Setup |
| 1 | +## PCF Nozzle Integration Tests Environment Setup |
2 | 2 |
|
3 |
| -## Using remote environment |
| 3 | +#### Setup PCF Nozzle |
| 4 | + - Using remote nozzle environment |
4 | 5 |
|
| 6 | + Deploy nozzle to PCF env via `cf push` |
| 7 | + ``` |
| 8 | + cf login --skip-ssl-validation -a https://api.<your cf sys domain> -u <your cf user name> -p <your cf password> |
| 9 | + |
| 10 | + make deploy-nozzle |
| 11 | + ``` |
| 12 | + - Run nozzle binary locally |
| 13 | +
|
| 14 | + Create a `env.sh` file to export all configuration env variables locally. |
| 15 | + `````` |
| 16 | + #!/usr/bin/env bash |
| 17 | + |
| 18 | + export SKIP_SSL_VALIDATION_CF=true |
| 19 | + export SKIP_SSL_VALIDATION_SPLUNK=true |
| 20 | + export ADD_APP_INFO=true |
| 21 | + export API_ENDPOINT=<CF-ENDPOINT> |
| 22 | + export EVENTS=ValueMetric,CounterEvent,Error,LogMessage,HttpStartStop,ContainerMetric |
| 23 | + export SPLUNK_TOKEN=<HEC-TOKEN> |
| 24 | + export SPLUNK_HOST=<HEC-ENDPOINT> |
| 25 | + export SPLUNK_INDEX=<TARGET-SPLUNK-INDEX> |
| 26 | + export FIREHOSE_SUBSCRIPTION_ID=splunk-nozzle |
| 27 | + export FIREHOSE_KEEP_ALIVE=25s |
| 28 | + export CLIENT_ID=<PCF CLIENT ID> |
| 29 | + export CLIENT_SECRET=<PCF CLIENT SECRET> |
| 30 | + `````` |
| 31 | + Start nozzle binary |
| 32 | + ``` |
| 33 | + cf login --skip-ssl-validation -a https://api.<your cf sys domain> -u <your cf user name> -p <your cf password> |
| 34 | + |
| 35 | + source env.sh |
| 36 | + |
| 37 | + ./splunk-firehose-nozzle |
| 38 | + ``` |
| 39 | +#### Install python 3 |
| 40 | +
|
| 41 | + sudo apt-get install python3.7 |
| 42 | + sudo apt-get install python3-pip |
| 43 | + |
| 44 | +#### Install python virtualenv |
| 45 | +
|
| 46 | + pip3 install virtualenv |
| 47 | + virtualenv venv |
| 48 | + source venv/bin/activate |
| 49 | +
|
| 50 | +#### Install Dependencies |
| 51 | +
|
| 52 | + pip3 install -r requirements.txt |
| 53 | +
|
| 54 | +#### Run Automation tests |
| 55 | +
|
| 56 | + - Run all the test cases |
| 57 | + ``` |
| 58 | + pytest testing/integration/ |
| 59 | + ``` |
| 60 | +
|
| 61 | + - Run all the critical test cases tagged with Critical |
| 62 | + ``` |
| 63 | + pytest testing/integration -v -m Critical |
| 64 | + ``` |
| 65 | + |
| 66 | + - Run specific test case |
| 67 | + ``` |
| 68 | + pytest testing/integration/test_method.py::test_func |
| 69 | + ``` |
| 70 | + or |
| 71 | + ``` |
| 72 | + pytest testing/integration/test_method.py::TestClass::test_func |
| 73 | + ``` |
| 74 | + or (if test_func is unique) |
| 75 | + ``` |
| 76 | + pytest -k test_func |
| 77 | + ``` |
0 commit comments