Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
68103f5
test
Jonas-Harrison-ICS Jul 15, 2024
7e723d0
removed space
Jonas-Harrison-ICS Jul 15, 2024
97d0994
testing with created linux runner
Jonas-Harrison-ICS Aug 8, 2024
07209ba
pt2
Jonas-Harrison-ICS Aug 8, 2024
7ca5751
pt3
Jonas-Harrison-ICS Aug 8, 2024
ae10535
pt3
Jonas-Harrison-ICS Aug 8, 2024
cc092ac
test removing actions/checkout@v4
Jonas-Harrison-ICS Aug 9, 2024
5795f26
python3
Jonas-Harrison-ICS Aug 9, 2024
abbd0dc
print directory path
Jonas-Harrison-ICS Aug 9, 2024
15a9fd9
commented out install
Jonas-Harrison-ICS Aug 9, 2024
e7d7fd5
again
Jonas-Harrison-ICS Aug 9, 2024
f166aea
again 2
Jonas-Harrison-ICS Aug 9, 2024
8a6130e
again 3
Jonas-Harrison-ICS Aug 9, 2024
7edc656
again 4
Jonas-Harrison-ICS Aug 9, 2024
3975eb0
again 5
Jonas-Harrison-ICS Aug 9, 2024
a3e9468
added pip install -r requirements.txt
Jonas-Harrison-ICS Aug 9, 2024
65683c0
removed unit tests to test requirements.txt
Jonas-Harrison-ICS Aug 9, 2024
d45db8a
uncommented code
Jonas-Harrison-ICS Aug 9, 2024
f7bc0b2
new echo
Jonas-Harrison-ICS Aug 9, 2024
3f52499
python install
Jonas-Harrison-ICS Aug 12, 2024
76ffc35
gmake
Jonas-Harrison-ICS Aug 14, 2024
4442708
--disable-dependency-tracking
Jonas-Harrison-ICS Aug 14, 2024
3fbf65d
make
Jonas-Harrison-ICS Aug 14, 2024
0559483
removed or in assertion for test_transmit
Jonas-Harrison-ICS Aug 23, 2024
3fc71bd
added or
Jonas-Harrison-ICS Aug 23, 2024
8ac2a87
swapped
Jonas-Harrison-ICS Aug 23, 2024
81e4a57
sudo
Jonas-Harrison-ICS Aug 26, 2024
1e1d546
sudo pt2
Jonas-Harrison-ICS Aug 26, 2024
9982a70
reverted
Jonas-Harrison-ICS Aug 26, 2024
4d6a072
slumber
Jonas-Harrison-ICS Aug 26, 2024
e7b5636
removed find_device_type
Jonas-Harrison-ICS Aug 26, 2024
57b8714
added Moon2 settings class
ncejkaICS Aug 29, 2024
aa23614
added Aws' device.py settings handling; commented out is for debuggin…
ncejkaICS Aug 29, 2024
a16ccbf
WIP - settings verification test
ncejkaICS Sep 3, 2024
0e60573
cleaned up + fixed
ncejkaICS Sep 3, 2024
1e7c10a
added to runner readme; improved settings test
ncejkaICS Sep 3, 2024
096c8f0
added moon2s and correct device num to open close test
ncejkaICS Sep 3, 2024
bcde6d0
major restructuring of runner tests; added rough outline for more tests
ncejkaICS Sep 3, 2024
4697c87
WIP figuring out format, testing methods
ncejkaICS Sep 4, 2024
590d968
added firmware testing
ncejkaICS Sep 4, 2024
89e5a8e
more firmware info testing, some cleanup
ncejkaICS Sep 4, 2024
969e81d
new tests; more dll tests; cleanup
ncejkaICS Sep 4, 2024
1cdcf67
WIP coremini testing
ncejkaICS Sep 4, 2024
e36f192
coremini read/write signals testing; more test structuring
ncejkaICS Sep 4, 2024
cbd7a86
fixes + cleanup for open/close test, added auto close testing
ncejkaICS Sep 4, 2024
84a80cc
WIP better opening/closing testing
ncejkaICS Sep 5, 2024
ae20167
more open+close testing; more fixes coming
ncejkaICS Sep 6, 2024
55203b5
open+close testing fully working, better and faster
ncejkaICS Sep 6, 2024
bff5dcf
more open+close testing
ncejkaICS Sep 6, 2024
b83fc3f
coremini fully working with vcan42
ncejkaICS Sep 6, 2024
eae9e77
fully working hscan1/2 testing with vcan42, fire2, fire3
ncejkaICS Sep 7, 2024
6361040
hscan test cleanup
ncejkaICS Sep 7, 2024
4726417
spy message config testing; tweaks; WIP rtc testing
ncejkaICS Sep 8, 2024
68a241a
added timestamp checking to hscan test; WIP bad msg testing
ncejkaICS Sep 8, 2024
5b4ce55
WIP hscan network failure testing
ncejkaICS Sep 9, 2024
688d892
removed broken bad mag can network test; tweaks
ncejkaICS Sep 10, 2024
7258d3d
fully working LIN testing; readme update
ncejkaICS Sep 10, 2024
82a369a
WIP partially working ethernet testing
ncejkaICS Sep 10, 2024
f21175e
fully working ethernet testing; WIP fire3 tx ethernet test
ncejkaICS Sep 10, 2024
02a412d
fully working fire2 <-> fire3 ethernet testing
ncejkaICS Sep 11, 2024
245fd16
fully working moon2 ethernet (RJ45<->T1) testing
ncejkaICS Sep 11, 2024
bb0bc7f
ruff format
ncejkaICS Sep 11, 2024
7deb5d7
test ci runner
ncejkaICS Sep 16, 2024
158cd6e
run tests on push only (stops 2 sets on push+pull_request)
ncejkaICS Sep 16, 2024
1ca6a83
updated readme with moon2 adapter settings
ncejkaICS Sep 16, 2024
d74d962
checkpoint small changes
ncejkaICS Oct 31, 2024
5fde085
test commit for runner
ncejkaICS Oct 31, 2024
f7c51c0
tweaked _check_devices()
ncejkaICS Nov 1, 2024
d51d628
updated open close tests with fixes and new filter test
ncejkaICS Nov 5, 2024
da38688
Merge pull request #2 from ncejkaICS/unit_tests
Jonas-Harrison-ICS Nov 5, 2024
9f8cda3
working python_ics functions
Jonas-Harrison-ICS Dec 4, 2024
6c7d9c9
commented out dll change code
Jonas-Harrison-ICS Dec 5, 2024
efdd9ed
test
Jonas-Harrison-ICS Dec 5, 2024
baf4fae
commented out test_get_all_chip_versions
Jonas-Harrison-ICS Dec 5, 2024
58c201a
removed base class in test accessory features
Jonas-Harrison-ICS Dec 5, 2024
aabcc1d
commented dll code
Jonas-Harrison-ICS Dec 5, 2024
e42bc92
removed code in test_get_all_chip_versions
Jonas-Harrison-ICS Dec 5, 2024
2b279be
commented code get_all_chip_versions
Jonas-Harrison-ICS Dec 5, 2024
f33961c
sleep
Jonas-Harrison-ICS Dec 5, 2024
ba693ce
yml update
Jonas-Harrison-ICS Dec 5, 2024
89ffb83
removed code from yml
Jonas-Harrison-ICS Dec 5, 2024
5010592
yml update pytest pytest-xdist
Jonas-Harrison-ICS Dec 5, 2024
6fa6c02
Signed-off-by: Jonas Harrison <[email protected]>
Jonas-Harrison-ICS Dec 5, 2024
1e21a1f
yml update
Jonas-Harrison-ICS Dec 5, 2024
1214d63
yml update
Jonas-Harrison-ICS Dec 5, 2024
d1f8df2
added try except in test_get_gptp_status
Jonas-Harrison-ICS Dec 5, 2024
df00d2b
removed try except
Jonas-Harrison-ICS Dec 9, 2024
3d16946
yml update
Jonas-Harrison-ICS Dec 9, 2024
b36336b
yml update 2
Jonas-Harrison-ICS Dec 9, 2024
6121ca8
yml update 3
Jonas-Harrison-ICS Dec 9, 2024
7bc6dd7
isolated macos tests
Jonas-Harrison-ICS Dec 9, 2024
1f66b14
macOS
Jonas-Harrison-ICS Dec 9, 2024
6791ba9
testing windows
Jonas-Harrison-ICS Dec 9, 2024
e36724f
imported faulthandler
Jonas-Harrison-ICS Dec 9, 2024
2b7c02e
Update tests.yml
Jonas-Harrison-ICS Dec 10, 2024
2bbcae0
yml update
Jonas-Harrison-ICS Dec 10, 2024
f2b6806
yml update 2
Jonas-Harrison-ICS Dec 10, 2024
0843eb8
yml update
Jonas-Harrison-ICS Dec 10, 2024
82c0cac
windows yml test
Jonas-Harrison-ICS Dec 11, 2024
9e809ae
windows yml
Jonas-Harrison-ICS Dec 11, 2024
77e9102
arch change
Jonas-Harrison-ICS Dec 16, 2024
1b19ce4
revert change in setup.py
Jonas-Harrison-ICS Dec 17, 2024
92acdb6
archflags change
Jonas-Harrison-ICS Dec 17, 2024
05830c4
update again
Jonas-Harrison-ICS Dec 17, 2024
793f6c0
-arch arm64
Jonas-Harrison-ICS Dec 17, 2024
ebba2ec
ARCHFLAGS change
Jonas-Harrison-ICS Dec 17, 2024
07e8200
update to build_libicsneo.py
Jonas-Harrison-ICS Dec 19, 2024
47b6e2f
platform name
Jonas-Harrison-ICS Dec 19, 2024
8745bcc
platform is
Jonas-Harrison-ICS Dec 19, 2024
34d6dc1
disabled subprocess.check_output code in _build_libusb
Jonas-Harrison-ICS Dec 19, 2024
d6a6eb7
result
Jonas-Harrison-ICS Dec 19, 2024
662bc6d
run
Jonas-Harrison-ICS Dec 19, 2024
e21bdda
subprocess.run
Jonas-Harrison-ICS Dec 19, 2024
758d5c0
more subprocess.run
Jonas-Harrison-ICS Dec 19, 2024
1873668
modified unreachable code in build_libicsneo.py
Jonas-Harrison-ICS Jan 2, 2025
50a877b
cc
Jonas-Harrison-ICS Jan 2, 2025
51a444a
removed -arch x86_64 (temp)
Jonas-Harrison-ICS Jan 2, 2025
3247ca8
-arch arm64, commented libusb
Jonas-Harrison-ICS Jan 3, 2025
ec5ab17
test
Jonas-Harrison-ICS Jan 3, 2025
5db09f5
uncommented code
Jonas-Harrison-ICS Jan 3, 2025
c77abbb
test
Jonas-Harrison-ICS Jan 3, 2025
f3b55c1
test
Jonas-Harrison-ICS Jan 3, 2025
3923a6c
LDFLAGS
Jonas-Harrison-ICS Jan 3, 2025
e1452bd
os.system('echo $CFLAGS')
Jonas-Harrison-ICS Jan 3, 2025
5876f1d
os.environ.update(env)
Jonas-Harrison-ICS Jan 3, 2025
8bf24a7
print("CFLAGS:", env["CFLAGS"])
Jonas-Harrison-ICS Jan 3, 2025
d2c917a
removed -arch x86_64 temp
Jonas-Harrison-ICS Jan 3, 2025
7d19fc9
arm64
Jonas-Harrison-ICS Jan 6, 2025
bde86ee
removed line in yml
Jonas-Harrison-ICS Jan 7, 2025
2c137a9
removed line causing yml error
Jonas-Harrison-ICS Jan 7, 2025
939a979
test
Jonas-Harrison-ICS Jan 8, 2025
c9e5ff3
test
Jonas-Harrison-ICS Jan 8, 2025
3507998
ics.close_device(device)
Jonas-Harrison-ICS Jan 9, 2025
ce4ea03
test suite
Jonas-Harrison-ICS Jan 9, 2025
530c176
ics.close_device(device)
Jonas-Harrison-ICS Jan 9, 2025
f1bca44
commented line in test_set_bit_rate
Jonas-Harrison-ICS Jan 9, 2025
5fa4c30
setup and teardown
Jonas-Harrison-ICS Jan 9, 2025
6f473ad
moved suite definition outside test class
Jonas-Harrison-ICS Jan 10, 2025
be80b0a
unittest.main()
Jonas-Harrison-ICS Jan 10, 2025
e0fb230
Signed-off-by: Jonas Harrison <[email protected]>
Jonas-Harrison-ICS Jan 10, 2025
92037da
moved suite outside test class
Jonas-Harrison-ICS Jan 10, 2025
72f373a
ics.close_device(self.device)
Jonas-Harrison-ICS Jan 10, 2025
b1be6c3
Signed-off-by: Jonas Harrison <[email protected]>
Jonas-Harrison-ICS Jan 10, 2025
57f29a7
commented @classmethod out in setup
Jonas-Harrison-ICS Jan 10, 2025
a3b8332
setUp()
Jonas-Harrison-ICS Jan 10, 2025
129642d
setUp with test suite
Jonas-Harrison-ICS Jan 10, 2025
4dc2efc
time.sleep(6) in setUp
Jonas-Harrison-ICS Jan 10, 2025
c30714e
commented safe boot mode
Jonas-Harrison-ICS Jan 10, 2025
9f5c4f0
commented ics functions that fail (temp)
Jonas-Harrison-ICS Jan 10, 2025
edc2323
devices
Jonas-Harrison-ICS Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 90 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,104 @@
name: Run Unit Tests
on:
push:
branches:
-'arm/**'
pull_request:
branches:
-'arm/**'

on: push
# on:
# push:
# branches:
# -'arm/**'
# pull_request:
# branches:
# -'arm/**'

jobs:
test_arm64:
if: github.repository == 'intrepidcs/python_ics'
name: Linux ARM64 unit tests
runs-on: [ self-hosted, Linux, ARM64, Hardware ]
# test_arm64:
# if: github.repository == 'Jonas-Harrison-ICS/python_ics'
# name: Linux ARM64 unit tests
# runs-on: [ self-hosted, Linux, ARM64, Hardware ]
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# fetch-depth: 0
# # needed for history/tags##

# - name: Setup Python
# run: |
# python3 -m venv .venv
# source .venv/bin/activate
# python3 -m pip install --upgrade pip
# echo "----------------------------------------------"
# pip install -r requirements.txt
# pwd
# echo "----------------------------------------------"
# python setup.py build -g
# python setup.py install --force
# # pip install .

# - name: Run unit tests
# run: |
# source .venv/bin/activate
# sudo setcap cap_net_admin,cap_net_raw+ep $(realpath $(which python3))
# python3 -m unittest discover -s tests.runner --verbose
# pytest -n auto

test_macos:
if: github.repository == 'Jonas-Harrison-ICS/python_ics'
name: MAC-OS ARM64 unit tests
runs-on: [ self-hosted, macOS, ARM64, Hardware ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # needed for history/tags
submodules: recursive
fetch-depth: 0
# needed for history/tags##

- name: Setup Python
run: |
python -m venv .venv
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install .
python3 -m pip install --upgrade pip
echo "----------------------------------------------"
pip install -r requirements.txt
pwd
echo "----------------------------------------------"
python setup.py build -g
python setup.py install --force
# pip install .

- name: Run unit tests
run: |
source .venv/bin/activate
sudo setcap cap_net_admin,cap_net_raw+ep $(realpath $(which python))
python -m unittest discover -s tests.runner --verbose
python3 -m unittest discover -s tests.runner --verbose
pytest -n auto

test_windows:
if: github.repository == 'Jonas-Harrison-ICS/python_ics'
name: Windows unit tests
runs-on: [ self-hosted, Windows, x64, Hardware ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# needed for history/tags##

- name: Setup Python
run: |
python -m venv .venv
.venv\Scripts\Activate.ps1
Write-Output "---------------------------------------------- VIRTUAL ENV CREATED"
python -m pip install --upgrade pip
Write-Output "---------------------------------------------- PIP INSTALLED"
pip install -r requirements.txt
pwd
Write-Output "---------------------------------------------- INSTALLED REQUIREMENTS.TXT"
python setup.py build -g
Write-Output "---------------------------------------------- PYTHON SETUP BUILT"
python setup.py install --force
Write-Output "---------------------------------------------- PYTHON SETUP INSTALLED"
# pip install .
- name: Run unit tests
run: |
.venv\Scripts\Activate.ps1
python -m unittest discover -s tests.runner --verbose
pytest -n auto
46 changes: 31 additions & 15 deletions build_libicsneo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import platform
import subprocess
import multiprocessing
import os
Expand Down Expand Up @@ -50,33 +51,48 @@ def checkout():
def _build_libusb():
os.makedirs(LIBUSB_BUILD, exist_ok=True)
env = os.environ.copy()
if sys.platform == "darwin":
env["CFLAGS"] = "-arch x86_64 -arch arm64 -mmacosx-version-min=10.13"
env["CXXFLAGS"] = "-arch x86_64 -arch arm64 -mmacosx-version-min=10.13"
if "DARWIN" in platform.system().upper():
env["CFLAGS"] = "-arch arm64 -mmacosx-version-min=10.13"
env["CXXFLAGS"] = "-arch arm64 -mmacosx-version-min=10.13"
env["LDFLAGS"] = "-arch arm64 -mmacosx-version-min=10.13"

# os.environ.update(env)

# os.system('echo $CFLAGS')
# os.system('echo $CXXFLAGS')
# os.system('echo $LDFLAGS')

print("CFLAGS:", env["CFLAGS"])
print("CXXFLAGS:", env["CXXFLAGS"])
print("LDFLAGS:", env["LDFLAGS"])
else:
env["CFLAGS"] = "-fPIC"
env["CXXFLAGS"] = "-fPIC"
subprocess.check_output([
result = subprocess.run([
f"{LIBUSB_SOURCE}/configure",
"--disable-shared",
"--enable-static",
"--disable-dependency-tracking",
f"--prefix={LIBUSB_INSTALL}",
"--disable-udev"
], cwd=LIBUSB_BUILD, env=env)

subprocess.check_output(["make", "-j" + CPUS], cwd=LIBUSB_BUILD)
subprocess.check_output(["make", "install"], cwd=LIBUSB_BUILD)
print("stdout:", result.stdout)
print("stderr:", result.stderr)

subprocess.run(["make", "-j" + CPUS], cwd=LIBUSB_BUILD)
subprocess.run(["make", "install"], cwd=LIBUSB_BUILD)

def _build_libpcap():
os.makedirs(LIBPCAP_BUILD, exist_ok=True)
env = os.environ.copy()
if sys.platform == "darwin":
env["CFLAGS"] = "-arch x86_64 -arch arm64 -mmacosx-version-min=10.13"
env["CXXFLAGS"] = "-arch x86_64 -arch arm64 -mmacosx-version-min=10.13"
if "DARWIN" in platform.system().upper():
env["CFLAGS"] = "-arch arm64 -mmacosx-version-min=10.13"
env["CXXFLAGS"] = "-arch arm64 -mmacosx-version-min=10.13"
else:
env["CFLAGS"] = "-fPIC"
env["CXXFLAGS"] = "-fPIC"
subprocess.check_output([
subprocess.run([
f"{LIBPCAP_SOURCE}/configure",
"--disable-shared",
"--disable-usb",
Expand All @@ -93,8 +109,8 @@ def _build_libpcap():
f"--prefix={LIBPCAP_INSTALL}",
], cwd=LIBPCAP_BUILD, env=env)

subprocess.check_output(["make", "-j" + CPUS], cwd=LIBPCAP_BUILD)
subprocess.check_output(["make", "install"], cwd=LIBPCAP_BUILD)
subprocess.run(["make", "-j" + CPUS], cwd=LIBPCAP_BUILD)
subprocess.run(["make", "install"], cwd=LIBPCAP_BUILD)

def _build_libicsneo_linux():
print("Cleaning libicsneo...")
Expand All @@ -119,11 +135,11 @@ def _build_libicsneo_linux():
)

def _build_libicsneo_macos():
subprocess.check_output(
subprocess.run(
[
"cmake",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64",
"-DCMAKE_OSX_ARCHITECTURES=arm64;arm64",
"-DLIBICSNEO_BUILD_ICSNEOLEGACY=ON",
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13",
f"-DCMAKE_PREFIX_PATH={LIBUSB_INSTALL};{LIBPCAP_INSTALL}",
Expand All @@ -132,7 +148,7 @@ def _build_libicsneo_macos():
]
)

subprocess.check_output(
subprocess.run(
["cmake", "--build", LIBICSNEO_BUILD, "--target", "icsneolegacy", "--parallel", CPUS]
)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_ics_extension_compiler_arguments() -> List[str]:
compile_args = GCC_COMPILE_ARGS
elif "DARWIN" in platform.system().upper():
# Mac doesn't respect the compiler args, but will append with ARCHFLAGS environment variable
os.environ["ARCHFLAGS"] += " -std=c++17"
os.environ["ARCHFLAGS"] = os.environ.get("ARCHFLAGS", "") + " -std=c++17"
compile_args = []
else:
compile_args = []
Expand Down
35 changes: 31 additions & 4 deletions tests/runner/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,39 @@ Runner tests

This directory is specifically for testing against hardware attached to the runner.

Each runner consists of the following hardware:

Each runner consists of the following ICS hardware:
- neoVI FIRE3
- neoVI FIRE2
- ValueCAN4-2


- RAD-Moon2
- RAD-Moon2

Runner platforms:
- Windows 10
- MacOS (something? M1)
- Linux (Debian)
- Linux ARM (Raspberry PI)

Hardware setup:
PC -> USB -> NIC -> ETH -> Fire3 -> CAN1/2 network v v
-> LIN network | | V
-> ETH network | | | V
-> Fire2 -> CAN1/2 network v | ^ | |
-> LIN network | | ^ |
-> ETH network | | ^
-> VCAN42 -> CAN1/2 network ^ ^
-> NIC -> ETH -> Moon2 -> 100/1000BASE-T1 network v
-> NIC -> ETH -> Moon2 -> 100/1000BASE-T1 network ^

Software setup:
- Both Moon2 USB NIC adapter properties must be set:
- "ASIX USB to Gigabit Ethernet Family Adapter" -> "Ethernet" (windows 10)
- "ASIX USB to Gigabit Ethernet Family Adapter #2" -> "Ethernet 2" (windows 10)
- IPV6 disabled
- IPV4 IP address: 192.168.69.10, 192.168.69.11
- IPV4 subnet mask: 255.255.255.0

Hardware / software testing:
- Run all python ics functions on all hardware
- Verify all networks, transmit, recieve, message functions
- Verify all example scripts are fully working
Loading