-
Notifications
You must be signed in to change notification settings - Fork 73
/
Makefile
108 lines (91 loc) · 2.58 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
test:
pytest --cov=. netutils_linux_*/
./tests/utils_runnable
./tests/rss-ladder-test
./tests/server-info-show
./tests/server-info-rate
./tests/link_rate_units.sh
env:
rm -rf env
virtualenv env && \
. env/bin/activate && \
pip install --upgrade -r requirements.txt && \
python setup.py install
help:
@echo " env create a development environment using virtualenv"
@echo " deps install dependencies"
@echo " clean remove unwanted stuff"
@echo " lint check style with flake8"
@echo " coverage run tests with code coverage"
@echo " test run tests"
# only for localhost MacOS testing.
test2:
. env2/bin/activate && \
./tests/rss-ladder-test && \
./tests/server-info-show && \
./tests/link_rate_units.sh
pytest netutils_linux_*/
env2:
rm -rf env2
virtualenv --python=python2 env2 && \
. env2/bin/activate && \
pip install --upgrade -r requirements.txt && \
python setup.py install
# only for localhost MacOS testing.
test3:
. env3/bin/activate && \
./tests/rss-ladder-test && \
./tests/server-info-show && \
./tests/link_rate_units.sh
pytest netutils_linux_*/
env3:
rm -rf env3
virtualenv --python=python3 env3 && \
. env3/bin/activate && \
pip install --upgrade -r requirements.txt && \
python setup.py install
clean:
rm -fr env
rm -fr build
rm -fr dist
find . -name '*.pyc' -exec rm -f {} \;
find . -name '*.pyo' -exec rm -f {} \;
find . -name '*~' -exec rm -f {} \;
rm -f *.rpm
lint:
./flake8.sh netutils_linux_monitoring netutils_linux_tuning netutils_linux_hardware
twine check dist/*
coverage:
nosetests --with-coverage --cover-package=twitter
build: clean
python setup.py sdist
python setup.py bdist_wheel
upload: test3 lint clean
python setup.py sdist
# python setup.py bdist_wheel upload
twine upload dist/*.tar.gz
mac_run: env
. env/bin/activate && \
network-top --random \
--softirqs-file=./tests/softirqs/i7/softirqs1 \
--softnet-stat-file=./tests/softnet_stat/softnet_stat1 \
--interrupts-file=./tests/interrupts/singlequeue_8cpu/interrupts_short \
--devices=eth1,eth2,eth3
mac_run_link_rate: env
. env/bin/activate && \
link-rate --random \
--devices=eth1,eth2,eth3
mac_run_irqtop: env
. env/bin/activate && \
irqtop --random \
--interrupts-file=./tests/interrupts/singlequeue_8cpu/interrupts_short
mac_run_softirq_top: env
. env/bin/activate && \
softirq-top --random \
--softirqs-file=./tests/softirqs/i7/softirqs1
mac_run_softnet_stat_top:
. env/bin/activate && \
softnet-stat-top --random \
--softnet-stat-file=./tests/softnet_stat/softnet_stat1
rpm_upload:
./scripts/packaging