metadata:
  name: telepathy-ring-automated
  format: "Apertis Test Definition 1.0"
  image-type: SDK
  image-arch: amd64
  type: functional
  exec-type: automated
  priority: medium
  maintainer: "Apertis Project"
  description: "Support making and receiving phone calls in Telepathy. This test
                is different from the manual one in that it tests with a phone
                simulator, for being able to stress test the functionality
                automatically. It uses a remote phone simulator instance when it
                is available, otherwise, it will automatically run a local
                phonesim instance and use that for the test instead."

  expected:
    - "The output should be similar to this:"
    - |
        >telepathy-ring-automated: PASSED

install:
  deps:
    - telepathy-ring
    - telepathy-phoenix
    - telepathy-mission-control-5
    - ofono-tests
    - apertis-tests-apparmor-report
    - ofono-phonesim
  git-repos:
    - url: https://gitlab.apertis.org/infrastructure/apertis-tests.git
      branch: master

run:
  steps:
    - "# Enter test directory:"
    - cd apertis-tests
    - "# Execute the following commands:"
    - echo -n | sudo tee /var/log/audit/audit.log
    - common/run-test-in-systemd --user=user sdk/telepathy-ring-automated.sh
    - sudo cat /var/log/audit/audit.log | aa_log_extract_tokens.pl PERMITTING REJECTING

parse:
  fixupdict:
    FAILED: fail
    PASSED: pass
    FAIL: fail
    PASS: pass
    SKIP: skip
    UNKNOWN: unknown
  pattern: '^(?P<test_case_id>[a-zA-Z0-9_\-\./]+):\s*(?P<result>PASSED|PASS|pass|FAILED|FAIL|fail|SKIP|skip|UNKNOWN|unknown)$'
