diff --git a/docs/PLAYBOOKS.md b/docs/PLAYBOOKS.md index 86e4e8776f310e3ea58321855a35c420563afaae..ddb5620f7f497a814eb3e07b943fdc633c42fd03 100644 --- a/docs/PLAYBOOKS.md +++ b/docs/PLAYBOOKS.md @@ -10,8 +10,11 @@ There are five main playbooks : - data_transfer.yml # retrieve results - test_meta.yml # test functions ``` + +All of them target the `sniffers` group by default. However, some tasks can be set to be run on the master device. ## First master-nodes connection: SSH setup -In order to ease configuring ssh keys and passwordless authentication, the playbook `ssh_setup.yml` (previously `playbook_SSH_keygen.yml`) has been re-written. +In order to ease configuring ssh keys and passwordless authentication, the playbook `ssh_setup.yml` (previously `playbook_SSH_keygen.yml`) has been re-written. +It will need to be ran with sudo, because it tries to install packages to master machine. - Asks for SSH password - Installs sshpass and keychain (master) (needs superuser powers) - Creates a ssh key (master) @@ -65,13 +68,14 @@ Multiple configuration scripts, here called microstasks, have been put into a si - The interval in seconds for channel hopping. Defaults to 0 (disabled) - The hashing function. Defaults to SHA256, can be MD5 and None - The fields to anonymize. All MACs and ssids is 15; not ssid is 14; nothing is 0. Defaults to 15 +- The frequency at which location should be polled. Defaults to 900s (15m) Then it translates the csv interfaces and channels into lists, and finds out the prefix to use for the gps file. It is {{ _pcap_name | replace('%post', '') }}-location-YYYYMMDD-ddmmss.gps it checks if the length of interfaces and channels is the same. -If they are, we set up a crontab to run the sniffer when planned, and a crontab for the location of the device. +If they are, we set up a crontab to run the sniffer when planned, and a crontab for saving the location of the device. **`stop_sens_sniffer.yml`** -This playbook interrupts any running `sniffer.py`, and cancels planned crontabs. +This playbook interrupts any running `sniffer.py`, and cancels planned related crontabs. ## Retrieving experiment data from nodes `data_transfer.yml` finds all .pcap and .gps files from our target folder for each nonde @@ -80,5 +84,37 @@ This playbook interrupts any running `sniffer.py`, and cancels planned crontabs. [TODO]: delete og files when success ## Testing devices and statuses -`test_meta.yml` runs all tests playbooks. -[TODO] detailler les tests +Tests are made in order to test current device config against whta is expected. + +All tests throwing an error will prevent further playbooks from running (if any). +The interruption will be done at the end of the playbook, so all checking tasks will be executed whatever happens. + +Here are the available test playbooks and their behaviour: +- `test_all.yml`: Run all test playbooks. + If you want to run a subset of them, open `test_all.yml` and comment out the playbooks you don't want to run by putting a `#` before the `- import_playbook:`. + +You could also just run playbooks one by one, manually, with the following playbooks: +- `test_time.yml`: Get and print the time difference between all hosts, taking whichever as a reference. + If any of them has >1s difference, throw an error +- `test_hostname.yml`: Check that hostnames on the remote sniffers are valid (i.e. looking like `ss?-s?`) + If any does not match, throw an error +- `test_config_files.yml`: Check local and remote config files existence and checksums (sha256) + Throw an error for the files that have issues +- `test_interfaces_status.yml`: Print interfaces names, driver and mode. + Then check that all interfaces are named wifiX (warn if not), Check that all sniffers have the same number of external adapters (throw if not) and check that they are in monitor mode (`unknown` mode) (throw if not) +- `test_packages.yml`: Check that required packages are installed across all nodes + Throw if not +- `test_systemctl_services.yml`: Check that systemd services are in an expected state + Throw if not +- `test_GPIO_GPS_PPS_status.yml`: Check that we get output from the GPS, and the PPS. + Throw if not. + + + + + +# Some more info +Test playbooks will not check : +- That the hosts file is up-to-date (contains our sniffers) +- That the gps is plugged into the pins, because checking that makes gathering info from the GPS impossible and requires a reboot +- That the network drivers repo and the mitik-sens repos are downloaded and up-to-date \ No newline at end of file diff --git a/playbooks/test_meta.yml b/playbooks/test_all.yml similarity index 100% rename from playbooks/test_meta.yml rename to playbooks/test_all.yml diff --git a/playbooks/test_interfaces_status.yml b/playbooks/test_interfaces_status.yml index 9b31f8016b661347800c51e0efe16d06961e2dc5..f11fc88569b900e1bd6aa0594e441edc26dff50f 100644 --- a/playbooks/test_interfaces_status.yml +++ b/playbooks/test_interfaces_status.yml @@ -31,7 +31,7 @@ msg: "{{ interfaces_unformated_list | map('join', ', ') }}" - name: Warn about wlan devices (should be wifi) ansible.builtin.debug: - msg: "device has interfaces named wlanX; this is unusual" + msg: "Warning!! device has interfaces named wlanX; this is unusual" when: interfaces_unformated_list | flatten | select('search', '^wlan.+') | length != 0 # Set the length of the first host's interface list