Skip to content

Commit 713cc8c

Browse files
authoredApr 9, 2022
Minor cleanups in CI setup (secdev#3565)
* Add Gitlab-ci.yml * cleanup * remove gitlab-ci.yml file
1 parent cb53be1 commit 713cc8c

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed
 

‎.config/ci/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if [ "$OSTYPE" = "linux-gnu" ] || [ "$TRAVIS_OS_NAME" = "linux" ]
2828
then
2929
sudo apt-get update
3030
sudo apt-get -qy install tshark net-tools || exit 1
31-
sudo apt-get -qy install can-utils build-essential linux-headers-$(uname -r) linux-modules-extra-$(uname -r) || exit 1
31+
sudo apt-get -qy install can-utils || exit 1
3232

3333
# Make sure libpcap is installed
3434
if [ ! -z $SCAPY_USE_LIBPCAP ]

‎test/contrib/automotive/interface_mockup.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ def test_and_setup_socket_can(iface_name):
5757

5858

5959
if LINUX and _root and _not_pypy:
60-
test_and_setup_socket_can(iface0)
61-
test_and_setup_socket_can(iface1)
62-
log_runtime.debug("CAN should work now")
63-
_socket_can_support = True
60+
try:
61+
test_and_setup_socket_can(iface0)
62+
test_and_setup_socket_can(iface1)
63+
log_runtime.debug("CAN should work now")
64+
_socket_can_support = True
65+
except Exception as e:
66+
sys.__stderr__.write("ERROR %s!\n" % e)
6467

6568

6669
sys.__stderr__.write("SocketCAN support: %s\n" % _socket_can_support)
@@ -113,7 +116,7 @@ def cleanup_interfaces():
113116
114117
:return: True on success
115118
"""
116-
if LINUX and _not_pypy and _root:
119+
if _socket_can_support:
117120
if 0 != subprocess.call(["ip", "link", "delete", iface0]):
118121
raise Exception("%s could not be deleted" % iface0)
119122
if 0 != subprocess.call(["ip", "link", "delete", iface1]):
@@ -168,7 +171,7 @@ def exit_if_no_isotp_module():
168171
# ############################################################################
169172
# """ Evaluate if ISOTP kernel module is installed and available """
170173
# ############################################################################
171-
if LINUX and _root and six.PY3:
174+
if LINUX and _root and six.PY3 and _socket_can_support:
172175
p1 = subprocess.Popen(['lsmod'], stdout=subprocess.PIPE)
173176
p2 = subprocess.Popen(['grep', '^can_isotp'],
174177
stdout=subprocess.PIPE, stdin=p1.stdout)

‎test/contrib/isotp_packet.uts

+2
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ except Scapy_Exception:
407407
assert ex
408408

409409
= Fragment exception
410+
~ not_pypy
411+
410412
ex = False
411413
try:
412414
fragments = ISOTP(b"a" * (1 << 32)).fragment()

‎tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ whitelist_externals = sudo
5151
passenv = PATH PWD PROGRAMFILES WINDIR SYSTEMROOT
5252
deps = {[testenv]deps}
5353
commands =
54+
sudo apt-get -qy install build-essential linux-headers-$(uname -r) linux-modules-extra-$(uname -r)
5455
sudo -E modprobe can
5556
git clone --depth=1 https://github.com/linux-can/can-utils.git /tmp/can-utils
5657
bash -c "cd /tmp/can-utils; ./autogen.sh; ./configure; make; sudo make install"

0 commit comments

Comments
 (0)
Please sign in to comment.