apiVersion: batch/v1
kind: Job
metadata:
  name: protocol-controller-tests-job
spec:
  template:
    metadata:
      labels:
        type: integration-tests
    spec:
      restartPolicy: Never
      containers:
      - name: protocol-controller-tests
        image: protocol-controller-tests
        command: ["python"]
        args: ["-m", "pytest", "-vvv", "-s", "-o", "log_cli=true", "-o", "log_cli_level=DEBUG", "plugins/cbsd_sas/tests/integration", "--junitxml=/backend/protocol_controller/test-results/test_report.xml"]
        env:
        - name: CC_CERT_PATH
          value: "/backend/configuration_controller/certs/device_c.cert"
        - name: CC_SSL_KEY_PATH
          value: "/backend/configuration_controller/certs/device_c.key"
        - name: SAS_CERT_PATH
          value: "/backend/configuration_controller/certs/ca.cert"
        - name: GRPC_SERVICE
          value: "domain-proxy-radio-controller"
        volumeMounts:
        - name: test-results
          mountPath: /backend/protocol_controller/test-results
        - name: certificates
          mountPath: /backend/protocol_controller/certs
          readOnly: true
      volumes:
      - name: certificates
        secret:
          secretName: certificates
      - name: test-results
        hostPath:
          path: /tmp/test-results-protocol-controller
          type: DirectoryOrCreate
  backoffLimit: 3
