Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
55 changes: 31 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# VARIABLES {{{1

LATEST_VERSION = 1.1.3
MININET = sudo mn
MININET = mn

PYTHON = sudo python
PYTHON = python
PYTHON_OPTS =

# regex testMatch: (?:^|[b_.-])[Tt]est)
Expand All @@ -16,51 +16,58 @@ PYTHON_OPTS =
# TODO: add testing conditionals for verbosity, doctest plugin and coverage plugin
# http://web.mit.edu/gnu/doc/html/make_7.html

# NOTE: sudo because of mininet
TESTER = sudo nosetests
TESTER = nosetests
TESTER_TRAVIS = nosetests
TESTER_OPTS = -s -v --exe --rednose
TESTER_OPTS_COV_HTML = $(TESTER_OPTS) --with-coverage --cover-html

UPLOADER=twine
# }}}

.PHONY: tests tests-travis clean
.PHONY: checkroot tests tests-travis clean


checkroot:
@if ! [ "$(shell id -u)" = 0 ]; then \
echo "You are not root, run this target as root please"; \
exit 1; \
fi


# TOY {{{1

toy:
toy: checkroot
cd examples/toy; $(PYTHON) $(PYTHON_OPTS) run.py; cd ../..

toy-init:
toy-init: checkroot
cd examples/toy; $(PYTHON) $(PYTHON_OPTS) init.py; cd ../..

test-toy:
test-toy: checkroot
cd examples/toy; $(TESTER) $(TESTER_OPTS) tests.py; cd ../..

# TODO
test-toy-cover:
test-toy-cover: checkroot
cd examples/toy; $(TESTER) $(TESTER_OPTS_COV_HTML) tests.py; cd ../..

# }}}

# SWAT-S1 {{{1

swat-s1-init:
swat-s1-init: checkroot
cd examples/swat-s1; $(PYTHON) $(PYTHON_OPTS) init.py; cd ../..

swat-s1:
swat-s1: checkroot
cd examples/swat-s1; $(PYTHON) $(PYTHON_OPTS) run.py; cd ../..

test-swat-s1:
test-swat-s1: checkroot
cd examples/swat-s1; $(TESTER) $(TESTER_OPTS) tests.py; cd ../..

# }}}

# TESTS {{{1

# ALL {{{2
tests:
tests: checkroot
$(TESTER) $(TESTER_OPTS) tests

# }}}
Expand Down Expand Up @@ -101,7 +108,7 @@ test-device:
# }}}

# TRAVIS {{{2
tests-travis:
tests-travis: checkroot
$(TESTER_TRAVIS) $(TESTER_OPTS) tests/protocols_tests.py
$(TESTER_TRAVIS) $(TESTER_OPTS) tests/devices_tests.py
$(TESTER_TRAVIS) $(TESTER_OPTS) tests/states_tests.py
Expand All @@ -120,26 +127,26 @@ tests-travis:
# CLEAN {{{1
clean: clean-cover clean-pyc clean-logs

clean-simulation:
sudo pkill -f -u root "python -m cpppo.server.enip"
sudo mn -c
clean-simulation: checkroot
pkill -f -u root "python -m cpppo.server.enip"
mn -c

clean-cover:
clean-cover: checkroot
rm -f minicps/*,cover
rm -f tests/*,cover

clean-pyc:
clean-pyc: checkroot
rm -f minicps/*.pyc
rm -f tests/*.pyc

clean-logs:
clean-logs: checkroot
rm -f logs/*.log

clean-cpppo:
sudo pkill -f -u root "python -m cpppo.server.enip"
clean-cpppo: checkroot
pkill -f -u root "python -m cpppo.server.enip"

clean-mininet:
sudo mn -c
clean-mininet: checkroot
mn -c

# }}}

Expand Down
42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "minicps"
version = "1.1.4"
description = "MiniCPS: a framework for Cyber-Physical Systems real-time simulation, built on top of mininet."
readme = ""
authors = [
{ name = "Daniele Antonioli", email = "[email protected]" },
]
license = "MIT"
keywords = ["simulation", "cyber-physical systems", "security", "real-time", "mininet"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Topic :: Education",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Security",
]

dependencies = [
"cryptography",
"pyasn1",
"pymodbus",
"cpppo",
"pandas",
]

[project.urls]
Homepage = "https://github.com/scy-phy/minicps"

[tool.setuptools]
packages = ["minicps"]
56 changes: 0 additions & 56 deletions setup.py

This file was deleted.