Skip to content
Snippets Groups Projects
Commit 2c16a337 authored by ale's avatar ale
Browse files

Write instructions on using the playbooks for testing

parent c6d29919
No related branches found
No related tags found
1 merge request!1V2
...@@ -8,3 +8,43 @@ $ vagrant up ...@@ -8,3 +8,43 @@ $ vagrant up
$ export ANSIBLE_HOST_KEY_CHECKING=False $ export ANSIBLE_HOST_KEY_CHECKING=False
$ ansible-playbook -i hosts.ini site.yml $ ansible-playbook -i hosts.ini site.yml
``` ```
This will start a 3-node autoradio cluster, with IPs
10.236.82.10-12. The cluster will be using autoradio packages from the
default Debian repository.
## Testing with local autoradio builds
If the *source_repository_path* Ansible variable is defined to point
at the autoradio source repository, the playbook will install
locally-built autoradio binaries. This can be very useful to quickly
test local uncommitted changes:
```shell
$ ansible-playbook -i hosts.ini \
-e source_repository_path=$HOME/go/src/git.autistici.org/ale/autoradio \
site.yml
```
## Test stream
The *test-source.yml* Ansible playbook can be used to quickly setup a
stream and an associated source for testing purposes. Use the
*stream_name* Ansible variable to set the name of the stream to be
created:
```shell
$ ansible-playbook -i hosts.ini \
-e stream_name=/test.ogg \
test-source.yml
```
Then it's easy to create test loads with, e.g., autoradio's
*radiobench* utility:
```shell
$ go run git.autistici.org/ale/autoradio/cmd/radiobench \
-n 100 http://10.236.82.10/test.ogg
```
will start 100 listeners on the stream just created above.
#!/bin/bash
#
# Create a test stream and run a source that connects to it.
#
stream_name=/test-$RANDOM.ogg
echo "creating stream ${stream_name}..."
create_output=$(vagrant ssh host1 -c "sudo radioctl create-mount ${stream_name}" | tr -d '\r')
username=$(echo "${create_output}" | awk -F= '$1 == "username" {print $2}')
password=$(echo "${create_output}" | awk -F= '$1 == "password" {print $2}')
echo "username: '$username'"
echo "password: '$password'"
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment