File: update-bpf.sh

package info (click to toggle)
ceccomp 4.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,604 kB
  • sloc: ansic: 6,470; python: 1,039; makefile: 248; sh: 145
file content (35 lines) | stat: -rwxr-xr-x 668 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

override_bpf()
{
    ./build/ceccomp asm -c always -f raw $1 > $2 2>&1
}

# for txt in test/text/*; do
#     bpf=${txt/text/bpf}
#     bpf=${bpf}.bpf
#     override_bpf $txt $bpf
# done

override_text()
{
    ./build/ceccomp disasm -c always $1 > $2 2>&1
}

for bpf in test/bpf/*; do
    txt=${bpf%.bpf}
    txt=${txt/bpf/text}
    override_text $bpf $txt
done

override_emu()
{
    ./build/ceccomp emu -c always $1 $2 1 2 3 4 5 6 > $3 2>&1
}

for text in test/text/*; do
    emu_result=${text/text/emu_result}
    override_emu $text open $emu_result.open
    override_emu $text pipe $emu_result.pipe
    override_emu $text accept $emu_result.accept
done