docker + tests: Run tests using python3, refactor Dockerfile
authorDave Marchevsky <davemarchevsky@fb.com>
Mon, 20 Dec 2021 20:23:37 +0000 (15:23 -0500)
committeryonghong-song <ys114321@gmail.com>
Mon, 20 Dec 2021 22:49:45 +0000 (14:49 -0800)
commita86a02f5c1d39c44b071c8ba9891864bfe37f86c
tree284b1100a92f652122f58696473149afec210c98
parent629d40a34dd766ed1e962a6aff713a9c4e7e61bd
docker + tests: Run tests using python3, refactor Dockerfile

In #3707, I added ubuntu-20.04 to the list of OS's bcc-test uses to run
tests. I expected that this would result in the tests running on both
18.04 and 20.04. Unfortunately this change was effectively a no-op as
the tests are run in a Docker container and the os field in bcc-test.yml
dictates the type/version of the _host_ OS, not the container's OS.

So it's not necessary to run on both, just run on 20.04. It will be
necessary to modify Dockerfile.test to use both 18.04 and 20.04. To
prepare for this, move all python tests to use python3 interpreter, as
20.04 doesn't have python2 pip readily available.

Also, refactor Dockerfile.tests a bit so that it's possible to provide
ubuntu version and shortname as build input.

This commit does not result in the docker test container working/running
both 18.04 and 20.04, rather lays groundwork for future commits to do
so.

Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
45 files changed:
.github/workflows/bcc-test.yml
Dockerfile.tests
src/python/CMakeLists.txt
tests/python/test_array.py
tests/python/test_attach_perf_event.py
tests/python/test_bpf_log.py
tests/python/test_brb.py
tests/python/test_brb2.py
tests/python/test_call1.py
tests/python/test_clang.py
tests/python/test_debuginfo.py
tests/python/test_disassembler.py
tests/python/test_dump_func.py
tests/python/test_flags.py
tests/python/test_free_bcc_memory.py
tests/python/test_histogram.py
tests/python/test_license.py
tests/python/test_lpm_trie.py
tests/python/test_lru.py
tests/python/test_map_batch_ops.py
tests/python/test_map_in_map.py
tests/python/test_percpu.py
tests/python/test_perf_event.py
tests/python/test_probe_count.py
tests/python/test_queuestack.py
tests/python/test_ringbuf.py
tests/python/test_rlimit.py
tests/python/test_shared_table.py
tests/python/test_stackid.py
tests/python/test_stat1.py
tests/python/test_tools_memleak.py
tests/python/test_tools_smoke.py
tests/python/test_trace2.py
tests/python/test_trace3.py
tests/python/test_trace4.py
tests/python/test_trace_maxactive.py
tests/python/test_tracepoint.py
tests/python/test_uprobes.py
tests/python/test_uprobes2.py
tests/python/test_usdt.py
tests/python/test_usdt2.py
tests/python/test_usdt3.py
tests/python/test_utils.py
tests/python/test_xlate1.py
tests/wrapper.sh.in