Skip to content

Commit

Permalink
add husky test
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-dewar committed May 25, 2022
1 parent 518deea commit 6137fd8
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -35,3 +35,4 @@ project/*
html/*
jupyter-backup/*
test.ipynb
/tests/*.out
91 changes: 91 additions & 0 deletions tests/Test_Husky.ipynb
@@ -0,0 +1,91 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "2274bbaa",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "0666783d",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import chipwhisperer as cw\n",
"\n",
"scope = cw.scope()\n",
"os.environ[\"HUSKY_HW_LOC\"] = str(scope._getNAEUSB().hw_location())\n",
"scope.default_setup()\n",
"cw.program_target(scope, cw.programmers.STM32FProgrammer, \"../../hardware/victims/firmware/simpleserial-trace/simpleserial-trace-CW308_STM32F3.hex\")\n",
"scope.dis()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7f0e1273",
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"import pytest\n",
"retcode = pytest.main([\"-v\", \"-rs\", \"../../tests/test_husky.py\", \"-k\", \"not trace\"])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0a9c92e9",
"metadata": {},
"outputs": [],
"source": [
"assert retcode.value == 0, retcode"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "47c478d3",
"metadata": {},
"outputs": [],
"source": [
"retcode.name"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "653e0288",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
4 changes: 4 additions & 0 deletions tests/docker/tests.yaml
Expand Up @@ -150,6 +150,10 @@ tutorials:
configurations:
- ssver: SS_VER_2_1
ids: [6]
tests/Husky_Test.ipynb:
configurations:
- ssver: SS_VER_1_1
ids: [5]

# courses/fault101/SOLN_Fault 2_2B - Voltage Glitching with CWNano to Bypass Password.ipynb:
# configurations:
Expand Down

0 comments on commit 6137fd8

Please sign in to comment.