What are the return codes of `juju run`?

I’m writing some tests to our charms using bats and one of our test cases rely on running some commands in the machines with juju run --unit foo/1 command.

I’m curious about the return of juju run. Does juju run return the code from the command it runs? If so, how do I know if a non-zero return is from an error in juju run or in my command?

If my command returns 7, does juju run return 7 as well?

If juju run returns -1, how do I know if this was an error in juju run instead of my command?

1 Like