-
Notifications
You must be signed in to change notification settings - Fork 729
Add workflow to run tests on real hardware #2545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a2fc441
tests: Use raw string for compiling regex
MaisenbacherD 6ab34a5
tests: fix nvme_attach_detach_ns_test
MaisenbacherD 5bf04ff
tests: Fix nvme_copy_test python traceback fails
MaisenbacherD a229526
tests: Fixup nvme_create_max_ns_test
MaisenbacherD 4104fd2
tests: Improve nvme_ctrl_reset_test
MaisenbacherD bb5862c
tests: Adjust ncap and nsze for nvme_format_test
MaisenbacherD 596845a
tests: Fix nvme_get_features_test
MaisenbacherD 4e64043
tests: Use correct flag in vendor specific id-ctrl
MaisenbacherD 81f98aa
tests: Fix nvme_smart_log_test
MaisenbacherD a752f3e
tests: Add feature check to nvme_compare_test
MaisenbacherD be6b8dc
tests: Fix nvme_get_lba_status_test and nvme_lba_status_log_test
MaisenbacherD ea72a95
tests: Create default ns on tearDown
MaisenbacherD c0c74bd
CI: Add workflow for running tests on real nvme device
MaisenbacherD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| --- | ||
| name: run-nightly-tests | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '0 01 * * *' | ||
|
|
||
| jobs: | ||
| nightly-tests: | ||
| runs-on: nvme-nvm | ||
| steps: | ||
| - name: Output kernel version | ||
| run: | | ||
| uname -a | ||
| - name: Clean up test device | ||
| run: | | ||
| #BDEV0 is an environment variable of the self-hosted runner instance | ||
| #that contains a valid nvme ctrl name which is capable of the nvm | ||
| #command set. | ||
| CONTROLLER=$(echo /dev/${BDEV0} | sed 's/n[0-9]*$//') | ||
| sudo nvme delete-ns $CONTROLLER -n 0xffffffff | ||
| sudo nvme format $CONTROLLER -n 0xffffffff -l 0 -f | ||
| SIZE=$(sudo nvme id-ctrl $CONTROLLER --output-format=json | jq -r '{tnvmcap} | .[]' | awk '{print $1/512}') | ||
| sudo nvme create-ns -s $SIZE -c $SIZE -f 0 -d 0 --csi=0 $CONTROLLER | ||
| sudo nvme attach-ns $CONTROLLER -n 1 -c 0 | ||
| - uses: actions/checkout@v4 | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install --no-install-recommends -y \ | ||
| meson gcc pkg-config git libjson-c-dev libssl-dev libkeyutils-dev \ | ||
| libdbus-1-dev libpython3-dev pipx python3-dev swig xz-utils | ||
| pipx ensurepath | ||
| sudo PIPX_BIN_DIR=/usr/local/bin pipx install nose2 | ||
| sudo PIPX_BIN_DIR=/usr/local/bin pipx install flake8 | ||
| sudo PIPX_BIN_DIR=/usr/local/bin pipx install mypy | ||
| sudo PIPX_BIN_DIR=/usr/local/bin pipx install autopep8 | ||
| sudo PIPX_BIN_DIR=/usr/local/bin pipx install isort | ||
| - name: Build and install nvme-cli | ||
| run: | | ||
| scripts/build.sh -b release -c gcc | ||
| sudo meson install -C .build-ci | ||
| sudo ldconfig /usr/local/lib64 | ||
| - name: Overwrite test config | ||
| run: | | ||
| CONTROLLER=$(echo /dev/${BDEV0} | sed 's/n[0-9]*$//') | ||
| cat > tests/config.json << EOF | ||
| { | ||
| "controller" : "$CONTROLLER", | ||
| "ns1": "/dev/${BDEV0}", | ||
| "log_dir": "tests/nvmetests/" | ||
| } | ||
| EOF | ||
| - name: Run on device tests | ||
| run: | | ||
| sudo nose2 --verbose --start-dir tests \ | ||
| nvme_attach_detach_ns_test \ | ||
| nvme_compare_test \ | ||
| nvme_copy_test \ | ||
| nvme_create_max_ns_test \ | ||
| nvme_ctrl_reset_test \ | ||
| nvme_dsm_test \ | ||
| nvme_error_log_test \ | ||
| nvme_flush_test \ | ||
| nvme_format_test \ | ||
| nvme_fw_log_test \ | ||
| nvme_get_features_test \ | ||
| nvme_get_lba_status_test \ | ||
| nvme_id_ctrl_test \ | ||
| nvme_id_ns_test \ | ||
| nvme_lba_status_log_test \ | ||
| nvme_read_write_test \ | ||
| nvme_smart_log_test \ | ||
| nvme_verify_test \ | ||
| nvme_writeuncor_test \ | ||
| nvme_writezeros_test | ||
| - name: Upload logs | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: logs files | ||
| path: | | ||
| ./tests/nvmetests/**/*.log | ||
| - name: Clean up test device | ||
| if: always() | ||
| run: | | ||
| CONTROLLER=$(echo /dev/${BDEV0} | sed 's/n[0-9]*$//') | ||
| sudo nvme delete-ns $CONTROLLER -n 0xffffffff | ||
| sudo nvme format $CONTROLLER -n 0xffffffff -l 0 -f | ||
| SIZE=$(sudo nvme id-ctrl $CONTROLLER --output-format=json | jq -r '{tnvmcap} | .[]' | awk '{print $1/512}') | ||
| sudo nvme create-ns -s $SIZE -c $SIZE -f 0 -d 0 --csi=0 $CONTROLLER | ||
| sudo nvme attach-ns $CONTROLLER -n 1 -c 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.