---
setup:

  - do:
      snapshot.create_repository:
        repository: test_repo1
        body:
          type: url
          settings:
            url: "http://snapshot.test1"

  - do:
      snapshot.create_repository:
        repository: test_repo2
        body:
          type: url
          settings:
            url: "http://snapshot.test2"

---
"Get all repositories":
  - do:
      snapshot.get_repository: {}

  - is_true: test_repo1
  - is_true: test_repo2

---
"Get repository by name":
  - do:
      snapshot.get_repository:
        repository: test_repo1

  - is_true: test_repo1
  - is_false: test_repo2

---
"Get missing repository by name":
  - do:
      snapshot.get_repository:
        repository: test_repo2

---
"Get all repositories with local flag":
  - do:
      snapshot.get_repository:
        local: true

  - is_true: test_repo1
  - is_true: test_repo2

---
"Verify created repository":
  - do:
      snapshot.verify_repository:
        repository: test_repo2

  - is_true: nodes