Skip to main content

satori test

Discord


What is Satori CI?

Satori allows you to assert how systems and software behave. Automatize software and system testing using three different approaches:

  • On demand: you need to execute the test one time (ie, Security Testing, Stress Testing, etc)
  • Scheduled: you need to know on a regular basis what is the status of something (ie, Monitoring live systems every five minutes, Auditing weekly/monthly/yearly systems, etc)
  • CI/CD: you need to execute it every time you are pushing new code (ie, Security Testing, System Testing, etc)

Setup Satori CLI

Three steps:

  1. Execute on your command line terminal:
pip3 install satori-ci
  1. With Satori CLI installed, now we need to get a Satori Token to use it:
  • Log in the Satori website using Github credentials: https://satori.ci/login
  • On the Satori website go to User Settings
  • Copy your User API Token
  1. Replace the string YOUR_TOKEN with your clipboard on the next command:
satori config token YOUR_TOKEN

Actions

You can take actions on:

  • run: whenever you are launching on demand scans for playbook files or directories
  • repo: whenever you are taking actions on repositories
  • monitor: visualize your scheduled playbooks
  • team: actions related to your team settings

Now, lets test software.

satori run

Consider the following example "Hello World" program written in Python:

print("Hello World")

If save that into a file named hello_world.py and we execute this program, we would see the following on the console:

foo@bar:~$ python hello_world.py
Hello World

How can you test aumatically that that piece of software behaves according to specification? You can write a Satori Playbook using a simple and practical notation:

foo@bar:~$ cat .satori.yml
test:
  assertStdoutEqual: "Hello World\n"
  python:
    - python hello_world.py

Lets test the code with the playbook

foo@bar:~$ satori run ./ --sync
Satori CI 1.2.3 - Automated Software Testing Platform
Uploading... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 331/331 bytes 0:00:00
UUID: AOQxDWDkXpZp
Report: https://satori.ci/report/AOQxDWDkXpZp
- Report status: Completed | Result: Pass | Elapsed time: 62.6s
  • test: test > python
  • asserts:
      ░ assert: assertStdoutEqual
      ░ status: Pass
      ░ expected: Hello World
      - - - - - - - - - - - - - - - - - - - -
  • testcases: 1
  • test_status: Pass
  • total_fails: 0
  - - - - - - - - - - - - - - - - - - - -

The code and the Satori playbook instructions were executed on a new Docker instance hosted by AWS. Satori asserts that this piece of software output "Hello World". You can assert several things:

  • assertStdout: True|False

Is output produced?

  • assertStdoutEqual: String*

Is the output equal to the String?

  • assertStdoutNotEquals: String

Is the output different than String?

  • assertStdoutContains: String

Does the output contains the String?

  • assertStdoutNotContains: String

Does the output not contain the String?

  • assertStdoutSHA256: SHA256Checksum

Is the output equal to this SHA256 hash?

  • assertStdoutRegex: Regex

Does the output matches your regexp?

  • assertStdoutNotRegex: Regex

Does the output not match your regexp?

The previos can also be applied to assertStderr. Finally, you can assert the return code of your the execution using assertReturnCode.

Please let us know if you need to assert something else that we is not covered by them.

Setup Satori CI Github App

We tested on demand. Now let's do it as part of your regular Github CI process.

  1. Go to https://github.com/apps/satorici

  2. Click on Install

  3. Select the repositories where you will be installing it or select all repositories

By default you can get notifications via email and Github issues. If you want to get notified in slack, discord or telegram go to https://satori.ci/settings/ to define their details.

If you want to detail in your playbook to be notified when the scans are ready, add the following to them:

settings:
  log|logOnFail|logOnPass: slack|email|issue|discord|telegram

For example:

settings:
  logOnFail: slack

test:
  assertStdoutEqual: Hello World
  python:
    - python hello_world.py

and put it on a file named .satori.yml inside your repository.

satori repo

You can check which repositories you connected with a playbook by running

foo@bar:~$ satori repo

You can scan all your commits from your repository to see if there were any discrepancies at some point:

foo@bar:~$ satori repo githubusername/repository scan -c 100 --sync

satori playbook

Are used to assert software behaviors, wether they are source code files or live systems. You can see a list of public playbooks by running

Public playbooks

They can be imported by playbooks that you have in your CI or on assets being Monitored.

foo@bar:~$ satori playbook --public
URI                          | Name
satori://code/trufflehog.yml | Trufflehog will search for secrets in your code
satori://code/semgrep.yml    | Static source code analysis with semgrep

...

You can check your private playbooks executed just by running satori playbook

Import Playbooks

Playbooks can import other local or remote playbooks. We keep at TBC a list of playbooks that can be referenced with the

import:
    - satori://code/trufflehog.yml
    - satori://code/semgrep.yml

test:
    assertStdoutEqual: Hello World
    python:
    - [ python hello_world.py ]

Private Playbooks

We will store a copy of the playbooks that you have executed and show them to you whenever you execute the command:

foo@bar:~$ satori playbooks private
Type    | URI                                                     | Name           | Imports
CI      | github://satorici/satori/.satori.yml                |                |
Monitor | github://satorici/playbooks/test/satori/monitor.yml     | Monitor Assets | monitorBlog.yml
Run     | github://satorici/playbooks/test/satori/monitorBlog.yml | Monitor Blog   |
...

Is there a playbook that you would like us to add? Drop us a line at support@satori.ci

satori monitor

Assert that your systems are running as expected by setting a schedule for your playbook. Playbooks that define a schedule can be monitored with:

satori monitor

For example, you can define schedule a crontab rate to a playbook just as in the following exmaple to verify the Hello World website from Satori every hour:

settings:
  - name: Monitor Blog
  - schedule: "0 * * * *"
  - logOnFail: slack

test:
  assertStdout: "Hello World"
  blog:
  - [ curl -s https://satori.ci/hello-world/ ]

Metadata

Release files for satori-ci 1.99.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for satori-ci 1.99.5
File Size Uploaded Provenance Actions
satori_ci-1.99.5.tar.gz 94.4 kB Without provenance Details for satori_ci-1.99.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for satori-ci 1.99.5
File Interpreter ABI Platform Actions
satori_ci-1.99.5-py3-none-any.whl Python 3 none any Details for satori_ci-1.99.5-py3-none-any.whl

Total release size: 204.5 kB

Release files / satori_ci-1.99.5.tar.gz

Download URL satori_ci-1.99.5.tar.gz
Size 94.4 kB
Tags Source
SHA-256 checksum
How to use checksums
92d047828fb000da128c47d98c3fad555af3529bd0591acd63667b5a19891184
BLAKE2b-256 checksum
How to use checksums
8f960962e91130549e089c2854eede54f372771b1e5d28359b33ebcd05e78b03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.29.5 CPython/3.12.3 Linux/7.0.0-1017-azure

Release files / satori_ci-1.99.5-py3-none-any.whl

Download URL satori_ci-1.99.5-py3-none-any.whl
Size 110.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7f3113bc4c599cccb9f0290e770be31e946c34d783fe573d57a744c2ce271c9
BLAKE2b-256 checksum
How to use checksums
a8b0e304adba0b4c7a00f286b1c7654ca887eacfca73fec884b5bc51dfd857d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.29.5 CPython/3.12.3 Linux/7.0.0-1017-azure

Security for satori-ci 1.99.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.99.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page