Skip to content

Commit

Permalink
allow the driver to run in dummy mode (#382)
Browse files Browse the repository at this point in the history
The driver should fall back to dummy mode when dependencies are not
installed. This will be useful in situations where the driver deps are
not installed in client applications.

Driver tests have been moved into separate files allowing the tests to
be run / and rerun without conflict.

Signed-off-by: Kevin Carter <kecarter@redhat.com>
  • Loading branch information
Kevin Carter authored Jan 6, 2022
1 parent 97991fd commit bcaeed7
Show file tree
Hide file tree
Showing 7 changed files with 853 additions and 834 deletions.
323 changes: 323 additions & 0 deletions .github/workflows/pull-request-functional-driver-defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
name: Run pull-request functional workflows defaults
on: [pull_request]
jobs:
functional_defaults_check:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run install
run: sudo bash tools/dev-setup.sh /opt/directord python3 ${{ github.workspace }}
- name: Run server service install
run: |
sudo /opt/directord/bin/directord-server-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-server
- name: Run client service install
run: |
sudo /opt/directord/bin/directord-client-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-client
- name: Wait for client online
run: |
timeout 120 bash -c 'while ! sudo /opt/directord/bin/directord manage --list-nodes; do sleep 1; done'
- name: Execute functional check
run: |
cd /opt/directord/share/directord/orchestrations
sudo timeout 240 /opt/directord/bin/directord \
orchestrate \
functional-tests.yaml \
--poll \
--check
- name: Generate log details
run: |
sudo journalctl -u directord-client -n 2000 &> /tmp/directord-client.log || true
sudo journalctl -u directord-server -n 2000 &> /tmp/directord-server.log || true
sudo /opt/directord/bin/directord manage --list-nodes &> /tmp/directord-nodes.log || true
sudo /opt/directord/bin/directord manage --dump-cache &> /tmp/directord-cache.log || true
sudo /opt/directord/bin/directord manage --export-jobs /tmp/directord-jobs-export.log || true
sudo cp -R /etc/directord /tmp/
sudo find /tmp/directord -type d -exec chmod 0755 {} \;
sudo find /tmp/directord -type f -exec chmod 0644 {} \;
if: failure()
- name: Upload build Log artifacts on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: functional-test-logs
path: /tmp/directord*

functional_defaults_query_check:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run install
run: sudo bash tools/dev-setup.sh /opt/directord python3 ${{ github.workspace }}
- name: Run server service install
run: |
sudo /opt/directord/bin/directord-server-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-server
- name: Run client service install
run: |
sudo /opt/directord/bin/directord-client-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-client
- name: Wait for client online
run: |
timeout 120 bash -c 'while ! sudo /opt/directord/bin/directord manage --list-nodes; do sleep 1; done'
- name: Execute functional check
run: |
cd /opt/directord/share/directord/orchestrations
sudo timeout 240 /opt/directord/bin/directord \
orchestrate \
functional-tests-query.yaml \
--poll \
--check
- name: Generate log details
run: |
sudo journalctl -u directord-client -n 2000 &> /tmp/directord-client.log || true
sudo journalctl -u directord-server -n 2000 &> /tmp/directord-server.log || true
sudo /opt/directord/bin/directord manage --list-nodes &> /tmp/directord-nodes.log || true
sudo /opt/directord/bin/directord manage --dump-cache &> /tmp/directord-cache.log || true
sudo /opt/directord/bin/directord manage --export-jobs /tmp/directord-jobs-export.log || true
sudo cp -R /etc/directord /tmp/
sudo find /tmp/directord -type d -exec chmod 0755 {} \;
sudo find /tmp/directord -type f -exec chmod 0644 {} \;
if: failure()
- name: Upload build Log artifacts on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: functional-query-test-logs
path: /tmp/directord*

functional_defaults_queuesentinel_check:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run install
run: sudo bash tools/dev-setup.sh /opt/directord python3 ${{ github.workspace }}
- name: Run server service install
run: |
sudo /opt/directord/bin/directord-server-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-server
- name: Run client service install
run: |
sudo /opt/directord/bin/directord-client-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-client
- name: Wait for client online
run: |
timeout 120 bash -c 'while ! sudo /opt/directord/bin/directord manage --list-nodes; do sleep 1; done'
- name: Execute functional check
run: |
cd /opt/directord/share/directord/orchestrations
sudo /opt/directord/bin/directord orchestrate functional-tests-queue-sentinel.yaml
sudo timeout 240 /opt/directord/bin/directord exec --verb QUEUESENTINEL true \
--poll \
--check
- name: Generate log details
run: |
sudo journalctl -u directord-client -n 2000 &> /tmp/directord-client.log || true
sudo journalctl -u directord-server -n 2000 &> /tmp/directord-server.log || true
sudo /opt/directord/bin/directord manage --list-nodes &> /tmp/directord-nodes.log || true
sudo /opt/directord/bin/directord manage --dump-cache &> /tmp/directord-cache.log || true
sudo /opt/directord/bin/directord manage --export-jobs /tmp/directord-jobs-export.log || true
sudo cp -R /etc/directord /tmp/
sudo find /tmp/directord -type d -exec chmod 0755 {} \;
sudo find /tmp/directord -type f -exec chmod 0644 {} \;
if: failure()
- name: Upload build Log artifacts on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: functional-queuesentinel-test-logs
path: /tmp/directord*

functional_defaults_async_check:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run install
run: sudo bash tools/dev-setup.sh /opt/directord python3 ${{ github.workspace }}
- name: Run server service install
run: |
sudo /opt/directord/bin/directord-server-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-server
- name: Run client service install
run: |
sudo /opt/directord/bin/directord-client-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-client
- name: Wait for client online
run: |
timeout 120 bash -c 'while ! sudo /opt/directord/bin/directord manage --list-nodes; do sleep 1; done'
- name: Execute async-functional check
run: |
cd /opt/directord/share/directord/orchestrations
sudo timeout 240 /opt/directord/bin/directord \
orchestrate \
functional-tests-async.yaml \
--poll \
--check
- name: Execute functional async-race-condition check
run: |
cd /opt/directord/share/directord/orchestrations
sudo timeout 240 /opt/directord/bin/directord \
orchestrate \
functional-tests-async-race.yaml \
--poll \
--check
- name: Execute functional async-time check
run: |
cd /opt/directord/share/directord/orchestrations
sudo timeout 40 /opt/directord/bin/directord \
orchestrate \
functional-tests-async-time.yaml \
--poll \
--check
- name: Generate log details
run: |
sudo journalctl -u directord-client -n 2000 &> /tmp/directord-client.log || true
sudo journalctl -u directord-server -n 2000 &> /tmp/directord-server.log || true
sudo /opt/directord/bin/directord manage --list-nodes &> /tmp/directord-nodes.log || true
sudo /opt/directord/bin/directord manage --dump-cache &> /tmp/directord-cache.log || true
sudo /opt/directord/bin/directord manage --export-jobs /tmp/directord-jobs-export.log || true
sudo cp -R /etc/directord /tmp/
sudo find /tmp/directord -type d -exec chmod 0755 {} \;
sudo find /tmp/directord -type f -exec chmod 0644 {} \;
if: failure()
- name: Upload build Log artifacts on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: functional-async-test-logs
path: /tmp/directord*

functional_defaults_add_check:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run install
run: sudo bash tools/dev-setup.sh /opt/directord python3 ${{ github.workspace }}
- name: Run server service install
run: |
sudo /opt/directord/bin/directord-server-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-server
- name: Run client service install
run: |
sudo /opt/directord/bin/directord-client-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-client
- name: Wait for client online
run: |
timeout 120 bash -c 'while ! sudo /opt/directord/bin/directord manage --list-nodes; do sleep 1; done'
- name: Execute functional check
run: |
cd /opt/directord/share/directord/orchestrations
sudo timeout 240 /opt/directord/bin/directord \
orchestrate \
functional-tests-async-transfer.yaml \
--poll \
--check
- name: Generate log details
run: |
sudo journalctl -u directord-client -n 2000 &> /tmp/directord-client.log || true
sudo journalctl -u directord-server -n 2000 &> /tmp/directord-server.log || true
sudo /opt/directord/bin/directord manage --list-nodes &> /tmp/directord-nodes.log || true
sudo /opt/directord/bin/directord manage --dump-cache &> /tmp/directord-cache.log || true
sudo /opt/directord/bin/directord manage --export-jobs /tmp/directord-jobs-export.log || true
sudo cp -R /etc/directord /tmp/
sudo find /tmp/directord -type d -exec chmod 0755 {} \;
sudo find /tmp/directord -type f -exec chmod 0644 {} \;
if: failure()
- name: Upload build Log artifacts on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: functional-add-test-logs
path: /tmp/directord*

functional_defaults_realworld_check:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run install
run: sudo bash tools/dev-setup.sh /opt/directord python3 ${{ github.workspace }}
- name: Run server service install
run: |
sudo /opt/directord/bin/directord-server-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-server
- name: Run client service install
run: |
sudo /opt/directord/bin/directord-client-systemd
sudo systemctl daemon-reload
sudo systemctl restart directord-client
- name: Wait for client online
run: |
timeout 120 bash -c 'while ! sudo /opt/directord/bin/directord manage --list-nodes; do sleep 1; done'
- name: Execute functional check
run: |
cd /opt/directord/share/directord/orchestrations
sudo timeout 240 /opt/directord/bin/directord \
orchestrate \
{functional-tests-async-race.yaml,functional-tests-async-time.yaml,functional-tests-async.yaml,functional-tests-query.yaml,functional-tests-async-transfer.yaml} \
--poll \
--check
- name: Generate log details
run: |
sudo journalctl -u directord-client -n 2000 &> /tmp/directord-client.log || true
sudo journalctl -u directord-server -n 2000 &> /tmp/directord-server.log || true
sudo /opt/directord/bin/directord manage --list-nodes &> /tmp/directord-nodes.log || true
sudo /opt/directord/bin/directord manage --dump-cache &> /tmp/directord-cache.log || true
sudo /opt/directord/bin/directord manage --export-jobs /tmp/directord-jobs-export.log || true
sudo cp -R /etc/directord /tmp/
sudo find /tmp/directord -type d -exec chmod 0755 {} \;
sudo find /tmp/directord -type f -exec chmod 0644 {} \;
if: failure()
- name: Upload build Log artifacts on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: functional-realworld-test-logs
path: /tmp/directord*
Loading

0 comments on commit bcaeed7

Please sign in to comment.