Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37c2944

Browse files
committed
WIP
1 parent e7e1f49 commit 37c2944

File tree

5 files changed

+115
-24
lines changed

5 files changed

+115
-24
lines changed

.github/scripts/install-libkdumpfile.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#
99
sudo apt update
1010
sudo apt install autoconf automake liblzo2-dev libsnappy1v5 libtool pkg-config zlib1g-dev
11-
sudo apt install python3.8-dev python3.9-dev
1211

1312
git clone https://github.com/ptesarik/libkdumpfile.git
1413

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -eux
2+
3+
cat /etc/apt/sources.list
4+
5+
sudo apt-get clean
6+
sudo apt-get update
7+
8+
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
9+
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
10+
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
11+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C8CAB6595FDFF622
12+
sudo apt-get clean
13+
sudo apt-get update
14+
15+
sudo apt-get install -y linux-image-$(uname -r)-dbgsym
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash -eux
2+
3+
sudo apt update
4+
sudo apt install python3.$(python3 --version | cut -d . -f 2)-dev
5+
6+
#
7+
# Debug statements
8+
#
9+
echo $(which python3)

.github/workflows/main.yml

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,6 @@ on:
66

77
jobs:
88
#
9-
# Verify the build and installation of SDB.
10-
#
11-
install:
12-
runs-on: ubuntu-20.04
13-
strategy:
14-
matrix:
15-
python-version: [3.8, 3.9]
16-
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-python@v1
19-
with:
20-
python-version: ${{ matrix.python-version }}
21-
- run: python3 setup.py install
22-
#
23-
# The statement below is used for debugging the Github job.
24-
#
25-
- run: python3 --version
26-
#
279
# Verify "pylint" runs successfully.
2810
#
2911
# Note, we need to have "drgn" installed in order to run "pylint".
@@ -34,7 +16,7 @@ jobs:
3416
runs-on: ubuntu-20.04
3517
steps:
3618
- uses: actions/checkout@v2
37-
- uses: actions/setup-python@v1
19+
- uses: actions/setup-python@v4
3820
with:
3921
python-version: '3.8'
4022
- run: ./.github/scripts/install-drgn.sh
@@ -55,16 +37,17 @@ jobs:
5537
runs-on: ubuntu-20.04
5638
strategy:
5739
matrix:
58-
python-version: [3.8, 3.9]
40+
python-version: ['3.8', '3.9']
5941
dump: [dump.201912060006.tar.lzma, dump.202303131823.tar.gz]
6042
env:
6143
AWS_DEFAULT_REGION: 'us-west-2'
6244
steps:
6345
- uses: actions/checkout@v2
64-
- uses: actions/setup-python@v1
46+
- uses: actions/setup-python@v4
6547
with:
6648
python-version: ${{ matrix.python-version }}
6749
- run: python3 -m pip install aws python-config pytest pytest-cov
50+
- run: ./.github/scripts/install-python-dev.sh
6851
- run: ./.github/scripts/install-libkdumpfile.sh
6952
- run: ./.github/scripts/install-drgn.sh
7053
- run: ./.github/scripts/download-dump-from-s3.sh ${{ matrix.dump }}
@@ -73,13 +56,57 @@ jobs:
7356
with:
7457
token: ${{ secrets.CODECOV_TOKEN }}
7558
#
59+
# Verify common linux SDB commands can run on vanilla ubuntu kernels: 20.04
60+
#
61+
live_ubuntu_20_04:
62+
runs-on: ubuntu-20.04
63+
strategy:
64+
matrix:
65+
python-version: ['3.8', '3.9']
66+
env:
67+
AWS_DEFAULT_REGION: 'us-west-2'
68+
steps:
69+
- uses: actions/checkout@v2
70+
- uses: actions/setup-python@v4
71+
with:
72+
python-version: ${{ matrix.python-version }}
73+
- run: python3 -m pip install aws python-config pytest pytest-cov
74+
- run: ./.github/scripts/install-python-dev.sh
75+
- run: sudo ./.github/scripts/install-libkdumpfile.sh
76+
- run: sudo ./.github/scripts/install-drgn.sh
77+
- run: sudo ./.github/scripts/install-live-kernel-dbg.sh
78+
- run: sudo python3 ./setup.py install
79+
- run: sudo ./tests/scripts/test_live_kernel.sh
80+
#
81+
# Verify common linux SDB commands can run on vanilla ubuntu kernels: 22.04
82+
#
83+
live_ubuntu_22_04:
84+
runs-on: ubuntu-22.04
85+
strategy:
86+
matrix:
87+
python-version: ['3.10' , '3.11']
88+
env:
89+
AWS_DEFAULT_REGION: 'us-west-2'
90+
steps:
91+
- uses: actions/checkout@v2
92+
- uses: actions/setup-python@v4
93+
with:
94+
python-version: ${{ matrix.python-version }}
95+
- run: python3 -m pip install aws python-config pytest pytest-cov
96+
- run: ./.github/scripts/install-python-dev.sh
97+
- run: sudo ./.github/scripts/install-libkdumpfile.sh
98+
- run: sudo ./.github/scripts/install-drgn.sh
99+
- run: sudo ./.github/scripts/install-live-kernel-dbg.sh
100+
- run: sudo python3 ./setup.py install
101+
- run: sudo ./tests/scripts/test_live_kernel.sh
102+
#
76103
# Verify "yapf" runs successfully.
77104
#
78105
yapf:
79106
runs-on: ubuntu-20.04
80107
steps:
81108
- uses: actions/checkout@v2
82-
- uses: actions/setup-python@v1
109+
- uses: actions/setup-python@v4
83110
with:
84111
python-version: '3.8'
85112
- run: python3 -m pip install yapf
@@ -104,7 +131,7 @@ jobs:
104131
runs-on: ubuntu-20.04
105132
steps:
106133
- uses: actions/checkout@v2
107-
- uses: actions/setup-python@v1
134+
- uses: actions/setup-python@v4
108135
with:
109136
python-version: '3.8'
110137
- run: ./.github/scripts/install-drgn.sh

tests/scripts/test_live_kernel.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash -eu
2+
3+
scmds=(
4+
# Test `stacks`
5+
"stacks"
6+
7+
# Test `dmesg`
8+
# ====
9+
# Commented out until we fix:
10+
# https://github.com/delphix/sdb/issues/336
11+
# ====
12+
# "dmesg"
13+
14+
# Test `lxlist`
15+
"addr modules | lxlist module list | member name"
16+
17+
# Test `slabs` and `percpu`
18+
"slabs | filter \"obj.name == 'kmalloc-8'\" | member cpu_slab | percpu 0 1"
19+
20+
# Test `pid`
21+
"pid 1"
22+
23+
# Test `find_task`
24+
"find_task 1 2"
25+
26+
# Test `threads`
27+
"threads"
28+
29+
# Test `walk` and `slub_cache` walker
30+
"slabs | filter \"obj.name == 'TCP'\" | walk"
31+
32+
# Test `rbtree` walker
33+
"addr vmap_area_root | rbtree vmap_area rb_node"
34+
35+
# Test `fget`
36+
"find_task 1 | fget 1 4"
37+
)
38+
39+
for ((i = 0; i < ${#scmds[@]}; i++)); do
40+
sudo /usr/local/bin/sdb -e "${scmds[$i]}"
41+
done

0 commit comments

Comments
 (0)