saltstack / saltstack/salt

[E2E Test] Add E2E test for using orchestration and a reactor

Open
#64,692 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Tests
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Add E2E test for the following scenario:

  1. Add orchestration and normal sls state:

/srv/salt/orch.sls:

run_user_state:
  salt.state:
    - tgt: poc-minion 
    - sls:
      - user

orch1_complete:
  salt.runner:
    - name: event.send
    - tag: my_event/orch1/complete
    - data:
        foo: bar
    - require:
      - salt: run_user_state

/srv/salt/user.sls

testuser:
  user.present
  1. Add reactor Salt master configuration

/etc/salt/master.d/reactor.conf

reactor:
  - "my_event/orch1/complete":
    - /srv/salt/reactor.sls
  1. Add reactor sls file

/srv/salt/reactor.sls

add_file:
  local.state.single:
    - tgt: "*"
    - args:
        - fun: file.managed
        - name: /tmp/path
        - contents: "test content"

add_file2_initial:
  local.file.touch:
    - tgt: "*"
    - args:
      - name: "/tmp/path2"

add_file2:
  local.file.append:
    - tgt: "*"
    - args:
      - path: /tmp/path2
      - args: "test2 content"
  1. Run the orchestration file

salt-run state.orchestrate orch

  1. Confirm that both /tmp/path and /tmp/path2 files where created with the correct contents
(py-3.10)  ch3ll@megan-precision5550  ~/git/salt   add_pillar_docs  cat /tmp/path2 /tmp/path               
test2 content
test content

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the supplied orch.sls, user.sls, reactor.conf, and reactor.sls scenarios as test fixtures. Start by running salt-run state.orchestrate orch in an environment with the described master and minion setup, then verify that /tmp/path contains "test content" and /tmp/path2 contains "test2 content". Done means the E2E test reliably covers orchestration, event triggering, and both reactor actions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.