diff --git a/cmd/tnlsnap/main.go b/cmd/tnlsnap/main.go new file mode 100644 index 000000000..9cd363c88 --- /dev/null +++ b/cmd/tnlsnap/main.go @@ -0,0 +1,200 @@ +// Command tnlsnap records the tnlsys snapshot (internal/tnlsys) of one +// `ip` run: the tunnel ioctls it makes, traced under ptrace with their +// exact input and output; the tun properties of every device in +// /sys/class/net; and, when ip would walk /proc itself (-details on +// tuntap, or on a -batch), the /dev/net/tun descriptors there. Any other +// walk would only record other processes' tun descriptors, which vary. +// +// tnlsnap -- -j tunnel show +// +// runs `ip -j tunnel show`, the `ip` first on PATH. It runs nothing but +// `ip`: it is a root ptrace tool in the capture guest, and its arguments +// come from a rows file. +// +// It prints the snapshot as JSON on stdout; the traced run's own stdout, +// stderr and exit status go into it rather than through. A capture row +// runs it as a readback beside the `ip` it captures, and goip replays the +// row with GOIP_TNLSYS naming the result. It exits 1 when the trace or a +// walk fails, and 2 on bad usage. +package main + +import ( + "errors" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "strings" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" +) + +func main() { + os.Exit(run(os.Args[1:], os.Stdout, os.Stderr)) +} + +func run(args []string, stdout, stderr io.Writer) int { + if len(args) < 2 || args[0] != "--" { + fmt.Fprintln(stderr, "usage: tnlsnap -- IP-ARG...") + return 2 + } + b, err := snapshotIP(args[1:]) + if err != nil { + fmt.Fprintf(stderr, "tnlsnap: %v\n", err) + return 1 + } + if _, err := stdout.Write(b); err != nil { + fmt.Fprintf(stderr, "tnlsnap: %v\n", err) + return 1 + } + return 0 +} + +// liveSys is the kernel, sysfs and /proc snapshotIP asks: the host's, +// unless a test points the roots at a fake tree (the nix test sandbox has +// no /sys/class/net). +var liveSys = tnlsys.Live{} + +// snapshotIP records `ip ARGS`. The program is fixed, ip as PATH +// resolves it, and the arguments reach it as its argv, never a shell. +func snapshotIP(args []string) ([]byte, error) { + path, err := exec.LookPath("ip") + if err != nil { + return nil, err + } + // ip reads its stdin for `-batch -`: a readback's `< b.txt` reaches it. + cmd := &exec.Cmd{Path: path, Args: append([]string{"ip"}, args...), Stdin: os.Stdin} + return snapshot(cmd, liveSys, walksProc(args)) +} + +// walksProc is whether ip, given args, runs show_processes: it sets +// show_details, and its object is tuntap, or a -batch file's lines may name +// it. It mirrors ip.c's option loop (ipOpts, first match wins, a second +// leading '-' dropped) and do_cmd's object table (ipObjects). +func walksProc(args []string) bool { + details, batch := false, false + for i := 0; i < len(args); i++ { + opt := args[i] + if opt == "--" { + i++ + return details && (batch || (i < len(args) && tuntapObject(args[i]))) + } + if !strings.HasPrefix(opt, "-") { + return details && (batch || tuntapObject(opt)) + } + if strings.HasPrefix(opt, "--") { + opt = opt[1:] + } + o, ok := ipOpt(opt) + if !ok { + return false // ip exits: unknown option + } + switch o.name { + case "-details": + details = true + case "-batch": + batch = true + } + if o.value { + i++ + } + } + return details && batch +} + +// ipOption is one of ip.c's options. +type ipOption struct { + name string + exact bool // strcmp, not matches + value bool // takes the next word +} + +var ipOpts = []ipOption{ + {"-loops", false, true}, {"-family", false, true}, + {"-4", true, false}, {"-6", true, false}, {"-0", true, false}, {"-M", true, false}, {"-B", true, false}, + {"-human-readable", false, false}, {"-iec", false, false}, {"-stats", false, false}, + {"-statistics", false, false}, {"-details", false, false}, {"-resolve", false, false}, + {"-oneline", false, false}, {"-timestamp", false, false}, {"-tshort", false, false}, + {"-Version", false, false}, {"-force", false, false}, {"-batch", false, true}, + {"-brief", false, false}, {"-json", false, false}, {"-pretty", false, false}, + {"-rcvbuf", false, true}, {"-color", false, false}, {"-help", false, false}, + {"-netns", false, true}, {"-Numeric", false, false}, {"-all", false, false}, + {"-echo", true, false}, +} + +// ipOpt is the first of ip.c's options that opt selects. +func ipOpt(opt string) (ipOption, bool) { + for _, o := range ipOpts { + if o.exact && opt == o.name || !o.exact && matches(opt, o.name) { + return o, true + } + // matches_color: -c, -col, -color, each with an optional =WHEN. + if o.name == "-color" { + if w, _, _ := strings.Cut(opt, "="); len(w) >= 2 && matches(w, "-color") { + return o, true + } + } + } + return ipOption{}, false +} + +// ipObjects is the part of do_cmd's table, in order, that can claim a word +// before tuntap does: a word matching tuntap or tap starts with t, and no +// earlier entry starts with t. +var ipObjects = []string{"tunnel", "tunl", "tuntap", "tap"} + +// tuntapObject is whether do_cmd runs do_iptuntap for word. +func tuntapObject(word string) bool { + for _, c := range ipObjects { + if matches(word, c) { + return c == "tuntap" || c == "tap" + } + } + return false +} + +// matches is iproute2's matches(): whether prefix begins word. An empty +// prefix matches nothing. +func matches(prefix, word string) bool { + return prefix != "" && strings.HasPrefix(word, prefix) +} + +// snapshot traces cmd and records the props, and the /proc walk if walk. +func snapshot(cmd *exec.Cmd, live tnlsys.Live, walk bool) ([]byte, error) { + r, recs, err := tnlsys.Trace(cmd) + if err != nil { + return nil, err + } + s := tnlsys.Snapshot{Ioctls: recs, Run: r} + devs, err := netDevs(live) + if err != nil { + return nil, err + } + s.RecordProps(live, devs) + if walk { + fds, err := live.TunFDs() + if err != nil { + return nil, err + } + s.Fds = &fds + } + return s.Marshal() +} + +// netDevs lists /sys/class/net. +func netDevs(live tnlsys.Live) ([]string, error) { + root := live.SysRoot + if root == "" { + root = "/sys" + } + ents, err := os.ReadDir(filepath.Join(root, "class", "net")) + if err != nil { + return nil, errors.Join(errors.New("listing devices"), err) + } + devs := make([]string, 0, len(ents)) + for _, e := range ents { + devs = append(devs, e.Name()) + } + return devs, nil +} diff --git a/cmd/tnlsnap/main_test.go b/cmd/tnlsnap/main_test.go new file mode 100644 index 000000000..52b5a4340 --- /dev/null +++ b/cmd/tnlsnap/main_test.go @@ -0,0 +1,200 @@ +package main + +import ( + "bytes" + "fmt" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" +) + +const helperEnv = "TNLSNAP_HELPER" + +func TestMain(m *testing.M) { + if os.Getenv(helperEnv) == "1" { + fmt.Print("helper out") + os.Exit(4) + } + os.Exit(m.Run()) +} + +// self is the test binary re-run as the helper TestMain turns it into. +func self() *exec.Cmd { + return &exec.Cmd{Path: os.Args[0], Args: []string{os.Args[0], "-test.run=^$"}} +} + +func TestRunUsage(t *testing.T) { + tests := []struct { + description string + args []string + wantRC int + wantErr string + }{ + {"negative: no arguments", nil, 2, "usage: tnlsnap -- IP-ARG..."}, + {"negative: arguments without --", []string{"tunnel", "show"}, 2, "usage"}, + {"boundary: -- with no ip arguments", []string{"--"}, 2, "usage"}, + {"negative: no ip on PATH", []string{"--", "tunnel"}, 1, "tnlsnap: exec: \"ip\""}, + } + t.Setenv("PATH", t.TempDir()) + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + var out, errb bytes.Buffer + if rc := run(tc.args, &out, &errb); rc != tc.wantRC { + t.Errorf("rc = %d, want %d", rc, tc.wantRC) + } + if !strings.Contains(errb.String(), tc.wantErr) || out.Len() != 0 { + t.Errorf("stderr = %q, stdout = %q", errb.String(), out.String()) + } + }) + } +} + +func TestSnapshot(t *testing.T) { + t.Setenv(helperEnv, "1") + sys, proc := t.TempDir(), t.TempDir() + for name, v := range map[string]string{ + "devices/virtual/net/tap0/tun_flags": "0x1002\n", + "devices/virtual/net/tap0/owner": "-1\n", + "devices/virtual/net/tap0/group": "100\n", + "devices/virtual/net/d0/ifindex": "2\n", + "class/net/bonding_masters": "\n", + } { + p := filepath.Join(sys, name) + if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(p, []byte(v), 0o600); err != nil { + t.Fatal(err) + } + } + for _, d := range []string{"tap0", "d0"} { + if err := os.Symlink("../../devices/virtual/net/"+d, filepath.Join(sys, "class/net", d)); err != nil { + t.Fatal(err) + } + } + b, err := snapshot(self(), tnlsys.Live{SysRoot: sys, ProcRoot: proc}, true) + if err != nil { + t.Fatal(err) + } + noWalk, err := snapshot(self(), tnlsys.Live{SysRoot: sys, ProcRoot: proc}, false) + if err != nil { + t.Fatal(err) + } + nw, err := tnlsys.Parse(noWalk) + if err != nil { + t.Fatal(err) + } + s, err := tnlsys.Parse(b) + if err != nil { + t.Fatal(err) + } + fds, fdErr := s.TunFDs() + tests := []struct { + description string + got, want any + }{ + {"positive: the traced run's status", s.Run.RC, 4}, + {"positive: the traced run's stdout is kept, not passed through", s.Run.Stdout, "helper out"}, + {"positive: tap0's three props", len(s.Props), 3}, + {"positive: group read", s.Props[2].Value, "100\n"}, + {"negative: no ioctls from a command that makes none", len(s.Ioctls), 0}, + {"corner: d0 and bonding_masters are not tun devices", s.Props[0].Dev, "tap0"}, + {"boundary: an empty /proc is a recorded empty walk", fmt.Sprint(len(fds), fdErr), "0 "}, + {"corner: no walk asked, none recorded", nw.Fds == nil, true}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if tc.got != tc.want { + t.Errorf("got %v, want %v", tc.got, tc.want) + } + }) + } + t.Run("negative: a missing sysfs is an error", func(t *testing.T) { + if _, err := snapshot(self(), tnlsys.Live{SysRoot: filepath.Join(sys, "nope"), ProcRoot: proc}, true); err == nil { + t.Error("no error") + } + }) +} + +func TestRunIP(t *testing.T) { + bin := t.TempDir() + if err := os.Symlink(os.Args[0], filepath.Join(bin, "ip")); err != nil { + t.Fatal(err) + } + t.Setenv("PATH", bin) + t.Setenv(helperEnv, "1") + // An empty sysfs: the host's need not exist (the nix sandbox has none). + sys := t.TempDir() + if err := os.MkdirAll(filepath.Join(sys, "class", "net"), 0o755); err != nil { + t.Fatal(err) + } + saved := liveSys + liveSys = tnlsys.Live{SysRoot: sys, ProcRoot: t.TempDir()} + t.Cleanup(func() { liveSys = saved }) + var out, errb bytes.Buffer + rc := run([]string{"--", "-j", "tunnel", "show"}, &out, &errb) + s, err := tnlsys.Parse(out.Bytes()) + if err != nil { + t.Fatalf("rc %d, stderr %q: %v", rc, errb.String(), err) + } + tests := []struct { + description string + got, want any + }{ + {"positive: tnlsnap exits 0 whatever ip exits", rc, 0}, + {"positive: ip's status is recorded", s.Run.RC, 4}, + {"positive: argv is ip and the arguments", fmt.Sprint(s.Run.Argv), "[ip -j tunnel show]"}, + {"negative: nothing on stderr", errb.String(), ""}, + {"corner: no -d, no /proc walk", s.Fds == nil, true}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if tc.got != tc.want { + t.Errorf("got %v, want %v", tc.got, tc.want) + } + }) + } +} + +// TestWalksProc pins when tnlsnap records the /proc walk: when ip would +// run show_processes. +func TestWalksProc(t *testing.T) { + tests := []struct { + description string + args []string + expected bool + }{ + {"positive: -d tuntap", []string{"-d", "tuntap", "show"}, true}, + {"positive: -details after -j, tap", []string{"-j", "-details", "tap"}, true}, + {"positive: --det", []string{"--det", "tuntap"}, true}, + {"positive: -d on a batch, whose lines may be tuntap", []string{"-d", "-batch", "b.txt"}, true}, + {"positive: tunt is tuntap", []string{"-d", "tunt"}, true}, + {"negative: no -d", []string{"-j", "tuntap", "show"}, false}, + {"negative: -d tunnel", []string{"-d", "tunnel", "show"}, false}, + {"negative: tun is tunnel, first in the table", []string{"-d", "tun"}, false}, + {"negative: t is tunnel", []string{"-d", "t"}, false}, + {"negative: -d after the object is an argument", []string{"tuntap", "show", "-d"}, false}, + {"negative: a batch without -d", []string{"-batch", "-"}, false}, + {"negative: an unknown option, ip exits", []string{"-d", "-bogus", "tuntap"}, false}, + {"negative: -detailsx is no option", []string{"-detailsx", "tuntap"}, false}, + {"boundary: no arguments", nil, false}, + {"boundary: -d and nothing else", []string{"-d"}, false}, + {"corner: -netns takes a value", []string{"-d", "-netns", "tuntap", "link"}, false}, + {"corner: -n is -netns", []string{"-d", "-n", "x", "tap"}, true}, + {"corner: -- ends the options", []string{"-d", "--", "tuntap"}, true}, + {"corner: -color=never", []string{"-color=never", "-d", "tuntap"}, true}, + {"corner: -de is a prefix of -details", []string{"-de", "tuntap"}, true}, + {"corner: -d is -details, not -Version or -force", []string{"-d", "tap"}, true}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := walksProc(tc.args); got != tc.expected { + t.Errorf("walksProc(%q) = %t, want %t", tc.args, got, tc.expected) + } + }) + } +} diff --git a/docs/netlink/goip-tunnel-status.md b/docs/netlink/goip-tunnel-status.md new file mode 100644 index 000000000..e569a11de --- /dev/null +++ b/docs/netlink/goip-tunnel-status.md @@ -0,0 +1,110 @@ +# goip tunnel, tunl6 and tuntap: implementation status + +**Last updated:** 2026-11-23 + +**Summary:** +- The design is in [goip-tunnel.md](goip-tunnel.md); this document tracks progress against it. This increment + numbers its evidence from **V001 / DOC001**. +- **8S (the sidecar): done.** +- **8C (the captures): done.** 217 rows, `ws/tunnel` (171) and `ws/tuntap` (46), each with a tnlsys sidecar. Two batches + on one boot agree byte for byte, except the holder pids of the eight `-d` rows with holders (V002). + - `internal/tnlsys` answers the ioctl, sysfs and `/proc` questions, live or from a JSON snapshot. + - `tnlsnap` records a snapshot by running the real `ip` under ptrace, keyed by each ioctl's exact input bytes. + - goip has its `GOIP_TNLSYS` seam (V001). +- **8P (the parsers): done.** Every one of the corpus's 958 tunnel answers decodes, and the 554 with a matching link + in the row's dump agree with its `IFLA_IPTUN_*`/`IFLA_GRE_*`/`IFLA_VTI_*` (V003). +- **8R (the clone): done.** goip runs `ip tunnel`, `ip -6 tunnel`, `ip tunl` and `ip tuntap|tap`. All 195 replayable + corpus rows (157 tunnel, 38 tuntap) match `ip`'s stdout and exit status byte for byte, `-d` pids included. The 22 + rows left out are 12 batches, 2 `-p` rows and 8 writes (V004). +- **8B (the bug hunt): done.** [upstream/iproute2-tunnel-tuntap.md](upstream/iproute2-tunnel-tuntap.md) records 23 + iproute2 findings and 2 kernel notes. It is not submitted to netdev. The worst are a stack overflow that upstream + fixed after 7.3.0 (T19), a double `fclose` in `read_prop` (T23) and an uninitialized `encaplimit` byte (T20) + (DOC001). +- **8L (the live diff): done.** On the workbench VM (kernel 7.3.1, iproute2 7.2.0), goip and `ip` ran the same 195 + read commands over the 8C fixtures, live, and agreed on stdout and exit status in all 195, `-d` holder pids + included (V005). + +## Contents + +- [Update rules](#update-rules) +- [Task checklist](#task-checklist) +- [Verification ledger](#verification-ledger) +- [Decision log](#decision-log) + +## Update rules + +- A state is one of `not started`, `in progress`, `blocked`, `done` or `deferred`. No percentages. +- A task is `done` only when its gates have passed and its evidence is in the [ledger](#verification-ledger). +- Evidence IDs (`V###` for code and VM runs, `DOC###` for docs) are immutable and append-only. +- Task IDs are never renumbered. + +## Task checklist + +| Done | Task | Work | State | Evidence | +|---|---|---|---|---| +| [x] | 8S | `internal/tnlsys`, `cmd/tnlsnap`, goip `runCtx.sys` | done | V001 | +| [x] | 8C | `matrix_tunnel.go`, `matrix_tuntap.go`, two batches | done | V002 | +| [x] | 8P | `xtcpnl_tunnel_parm.go` + table tests + fuzz + O-check | done | V003 | +| [x] | 8R | goip `obj_tunnel.go`, `obj_tuntap.go`; corpus replay | done | V004 | +| [x] | 8B | `upstream/iproute2-tunnel-tuntap.md` | done | DOC001 | +| [x] | 8L | live diff | done | V005 | + +## Verification ledger + +| ID | Task | Evidence | +|---|---|---| +| V001 | 8S | **Package `internal/tnlsys`:** `Sys` (`Ioctl`, `ReadProp`, `TunFDs`) and the three request constants; the struct sizes 52/76/16/24, `IfName` (cut like `strlcpy`) and `ArgSize`. `Live` makes a raw `SYS_IOCTL` with a 64-byte `0xA5` spill window, reads sysfs under an `os.Root` at `/sys` (so the `class/net` symlinks resolve inside it), and walks `/proc` unsorted, self excluded. `Snapshot` matches each ioctl on family, request, name and input bytes. A miss is `ErrNotRecorded`. `Parse` refuses unknown fields, bad hex, unknown requests, negative errnos and out longer than in. `Trace` (linux/amd64) is a ptrace tracer that follows threads; other arches get a stub. **Tool:** `cmd/tnlsnap` (nix package `tnlsnap` in `nix/binaries.nix`): `tnlsnap -- ARGS` traces `ip ARGS` and prints the snapshot (traced ioctls, the tun devices' props, the tun descriptor walk, and the run's argv, rc, stdout and stderr). It runs nothing but `ip` as PATH resolves it, since it is a root ptrace tool fed from a rows file; `Trace` takes an `*exec.Cmd` and runs the ptrace work on a goroutine that keeps its thread locked until it exits. **goip:** `runCtx.sys` comes from `openSys`: `GOIP_TNLSYS`, else an empty snapshot under `GOIP_REPLAY`, else `Live`. **Tests:** `TestTnlsys`, 12 rows. Positive: a JSON round trip; a fallback device answering per input; the same device with zero input; spill returned; a 16-router PRL. Negative: recorded ENODEV; unrecorded input; unknown device. Boundary: empty snapshot; an argument 1 byte short. Corner: v4 and v6 under one name; a 17-byte name cut to 15. `TestSnapshotProps` 5 rows, `TestSnapshotTunFDs` 3, `TestParseRefuses` 8, `TestIfNameAndArgSize` 10, `TestLoad` 3 and `TestSocketError` 3. `TestLiveIoctl`, 5 rows, unprivileged: ENODEV; a write request refused; an empty argument and one over 64 KiB refused; family 9999 failing at `socket(2)` as `SocketError`. `TestSpillOf` 4. `TestLiveReadProp`, 7 rows over a fake sysfs, including a slash or `..` in the device and a symlink out of the root. `TestLiveTunFDs`, 6 rows over a fake `/proc`: comm present or missing; `12x` scanning as pid 12, as sscanf's `%d` does; `2a` reading fdinfo 2; self, `self`, non-tun links and a missing fdinfo skipped. `TestTrace`, 10 rows, unprivileged: the test binary re-run as a helper makes `SIOCGETTUNNEL` on `lo` (EOPNOTSUPP) and `SIOCGET6RD` on `nosuch0` (ENODEV), and the tracer records both with family, name and input, plus the helper's rc 3, stdout and stderr. `cmd/tnlsnap`: `TestRunUsage` 4 rows (no ip on PATH among them); `TestSnapshot` 8, over a fake sysfs and `/proc`, with `bonding_masters` and a non-tun `d0` skipped; `TestRunIP` 5, a fake `ip` on PATH (the test binary) recorded with its rc 4 and argv. `internal/goip` `TestOpenSys`, 6 rows. **Manual:** in `unshare -rn` on the host, with an ipip `t1`, `tnlsnap -- ip tunnel show` recorded `SIOCGETTUNNEL` for `tunl0` and `t1` (zero input, 52-byte outputs naming each). Coverage: tnlsys 82.3%, tnlsnap 87.2%. Gates: `go test -race ./internal/tnlsys/ ./cmd/tnlsnap/ ./internal/goip/`, vet (amd64 and arm64), gofmt, golangci-lint (comprehensive) 0 issues on the three packages, `CGO_ENABLED=0 go build ./...`. | +| V002 | 8C | **Spaces** (`tools/nlcapgen`, registered in `main.go`): `tunnel`, 171 rows (72 commands plain and `-j`, 27 negatives), modules ipip/ip_gre/sit/ip_vti/ip6_tunnel/ip6_gre/ip6_vti. Fixtures: `tnl4` (ipip1, ipip2, gre1-3 with keys/seq/csum and a multicast remote, sit1, sit2, isa1 and isan with routers, vti1, d0), `prl16` (isa16 with 16 routers), `tnl6` (ip6t1, ip6t2, ip6g1, vti61, gre6x), `ext` (ipip external, gretap, erspan, ip6gretap). `tuntap`, 46 rows (20 commands plain and `-j`, 6 negatives), module tun. Fixtures: `tun` (tap0 user 1000 group 100 one_queue, tun1 multi_queue vnet_hdr, tap2 pi), `proc` (a python `TUNSETIFF` holder on tap0, two on tun1), `xns` (a tap0 holder in another namespace). Every row has the readback `{tnlsys, "tnlsnap -- ARGS"}`. A `-d` tuntap row is serial and first kills the holders earlier rows left, since `/proc` is shared. **Rows:** `nix/microvms/workbench/{tunnel,tuntap}.rows.jsonl`. **Corpus:** `pkg/xtcpnl/testdata/7_3_1/ws/{tunnel,tuntap}`, kernel 7.3.1, iproute2 7.2.0; `TestWsCorpusRows` holds all 217. **Batches:** two on one boot, all 217 rows OK both times. stdout, stderr, rc and sidecar are identical in 209 rows, and in the other 8 (`-d` with holders, plain and `-j`) but for the holder pids. In every sidecar the traced run's stdout, stderr and rc equal the captured `ip`'s. The only spill is gre6x's, 24 bytes (76 − 52, T19). The only ioctl failures are `SIOCGET6RD` EINVAL (no 6rd in the guest kernel, K1, which ip skips) and `SIOCGETTUNNEL` ENODEV in the two named-path negatives. **Recorder fixes the batches found** (V001's tnlsnap): (1) the spill kept `ip`'s own stack past the kernel's write, so the tracer now fills the window with `0xA5` at entry, cuts the spill at the last changed byte and restores the rest; (2) the `/proc` walk ran for every row and recorded other rows' holders, so it now runs only when `ip` would walk (`walksProc`, which mirrors `ip.c`'s option loop and `do_cmd`'s object order). After the guest runs, the holders are killed and the tunnel and tun modules unloaded (tunnel6 stays: xfrm6_tunnel holds it). **Tests:** `TestTunnelSpace`, 24 rows (positive: v4 and v6 lists, v6 named, a gre name, `-j -s`; negative: gre9 rc 1, keys without a mode, an unknown mode 255, `get_addr32` 1, `dev nosuch` kernel ENODEV, `tunnel add` 1, v6 named ENODEV; boundary: fallback devices only, ttl 300, 16 routers, a 21-bit flowlabel; corner: mode any, gre6x, encaplimit 300, `tunl`, batch any-sticks, v6 named then the list on stdin, external kinds). `TestTuntapSpace`, 13 rows, plus serial exactly for the 10 `-d` rows, each with the kill first. Both check determinism, the modules, the readback, writes only in negatives, and the `-j` twins. `TestDetailWords` 6. tnlsnap: `TestWalksProc` 21; `TestSnapshot` gains "no walk asked, none recorded". tnlsys: `TestSpillOf` 6 rows for the cut. **Correction to V001:** its goip gate was not met. `TestGoipImportSetIsHermetic` failed on the new `internal/tnlsys` import, which is now in goip's allowed set and pinned closure, with its reason. Coverage: tnlsys 83.2%, tnlsnap 93.1%. Gates: `go test -race ./internal/tnlsys/ ./cmd/tnlsnap/ ./tools/nlcapgen/ ./internal/goip/ ./pkg/xtcpnl/`, vet (amd64 and arm64), gofmt, golangci-lint (comprehensive) 0 issues. | +| V003 | 8P | **File `pkg/xtcpnl/xtcpnl_tunnel_parm.go`:** `ParseIPTunnelParm` (52 B: name, link, i/o_flags be16, i/o_key be32, the iphdr's tos/frag_off/ttl/protocol/saddr/daddr), `ParseIP6TnlParm2` (76 B: proto, encap_limit, hop_limit, flowinfo be32, flags u32 with the kernel's CAP bits, laddr/raddr, the gre flags and keys), `ParseTunnelPRL` (whole 16-byte entries; the header entry's `datalen` kept), `ParseTunnel6RD` (24 B) and `ParseSysfsLong`, which is `read_prop`'s check: the first line of at most 79 bytes, the newline cut, `strtol` base 0 consuming it all, ERANGE refused. Lengths are exact, with the C sizes as constants. A name with no NUL in its 16 bytes is kept whole and marked unterminated. VTI_ISVTI and SIT_ISATAP are kept raw (0x0100 in host order). The plan's `ParseTunFlags` became `ParseSysfsLong`, since `owner` and `group` go through the same `read_prop`. **Tests:** `TestParseTunnelParm`, 17 rows. Positive: corpus gre1 (`0xb000` both ways, keys 5, proto 47, ttl 32), vti1 (`0x2100`/`0x2000`, keys 7/8), isa1 (proto 41, isatap flag), isa1's PRL (16 entries, header datalen 32, `prl-default` on .10), ip6t1 (flags 0x30043, encaplimit 4), ip6g1, a hand-made 6rd. Negative: four wrong lengths. Boundary: an all-zero parm; a 16-byte name with no NUL; an empty PRL. Corner: isa16's PRL (15 routers, .25 down to .11, T8); gre6x's 76-byte answer read as a 52-byte parm (T19: `proto 0 0.0.0.1>32.1.13.184`); link −1. `TestParseSysfsLong` 19 rows (positive: hex `tun_flags`, owner −1, group 100, no newline; negative: empty, a newline only, a word, a trailing space, `0x` alone, `08`; boundary: `LONG_MAX`, `LONG_MIN`, one past either refused as out of range; corner: octal, a leading space and sign, only the first line, a NUL ending the string, `fgets` keeping 79 bytes so an 80th junk byte is never seen). **O-check** `TestWsTunnelParmAgreesWithLinkDump`: over every `ws/tunnel` and `ws/tuntap` sidecar, all 958 successful `SIOCGETTUNNEL` answers decode, and the 554 whose device is in the row's link dump agree field by field with `ParseNewLink`'s info data across all seven kinds (ipip, gre, sit, vti, ip6tnl, ip6gre, vti6), 0 diffs; 36 PRL answers decode; there are no 6rd answers (K1). **Fuzz** `FuzzParseIPTunnelParm`, `FuzzParseIP6TnlParm2`, `FuzzParseSysfsLong`, seeded from the corpus, 30 s each, no failures. **Benchmarks** (ns/op): IPTunnelParm 67, IP6TnlParm2 64, PRL 342, SysfsLong 51. Coverage of the new file: every function 100% but `digitVal` 80%. Gates: `go test -race ./pkg/xtcpnl/`, vet, gofmt -s, golangci-lint (comprehensive) 0 issues. | +| V004 | 8R | **goip:** `obj_tunnel.go` is `do_iptunnel`: the `mode` pre-scan that sends an IPv6 mode to `do_ip6tunnel` whatever `-4` said (T10), the family check, and the verbs by prefix. `parse_args` covers `set_tunnel_proto`'s exit, the keys through `tnl_parse_key`, the seq and csum words, `get_addr32`, the TTL invarg with its `\n` (T11), the tos `strsep` (what follows a slash after a value is dropped), and name, help and duparg2. After the loop: the protocol a name prefix implies, the key check (T6), `dev` through `ll_name_to_index`, a multicast remote's keys and source check, and isatap. Then `tnl_defname`'s named path, one `SIOCGETTUNNEL` with the parsed struct, printed as text even under `-j` (no `new_json_obj`). Otherwise `do_tunnels_list`: the family's 32-byte link dump, the ARPHRD filter, the zeroed v4 input, a refused ioctl's line and skip (T3), `ip_tunnel_parm_match`, and print, followed by `-s`'s bare stats and a bare newline, under `-j` too (T1). A printed tunnel with no stats under `-s` ends the dump, rc 1 (T2). `obj_tunnel6.go` is `ip6tunnel.c`: its `parse_args`, where `encaplimit`'s check never fires (T20; the uninitialized byte is 0, as the corpus shows), and `do_show`. The named path prints no final newline (T9); `-s` takes the list. The list's input carries p1's name, the ifindex and the ARPHRD's protocol; then `ip6_tnl_parm_match`. `obj_tuntap.go` is `do_iptuntap`: show ignores its arguments (T13). It sends the `IFLA_INFO_KIND "tun"` dump and keeps ARPHRD NONE or ETHER links of kind tun (T17). `read_prop` prints its four messages and `Failed to parse` before skipping (T14 is wrong: the skip is not silent). Under `-d`, `show_processes` runs its fscanf scan over each descriptor's fdinfo, with `get_task_name`'s comm or ``. **Printers** (`render/tunnel.go`): `PrintTunnelV4` (PRL entries 1 to 15, `dev`, `ttl inherit` as text only, tos with `inherit/`, `nopmtudisc`, 6rd), `PrintTunnelV6`, `printGreFlags` (JSON array, or bare `_SL_` lines), `TunnelStats` (`%lld` through `cint.LongLong`) and `PrintTuntap` (the flag words in `print_flags`' order, other bits as `%#llx`, user and group as `%ld` text over u64 JSON). `Printer.Raw` writes in both modes. **Ioctls** go through `runCtx.sys`. A kernel errno is `ip`'s line: `get tunnel "X" failed`, or `tnl_gen_ioctl`'s `%s: ioctl %x failed` (6rd's EINVAL silent). A `SocketError` gives `create socket failed`. A replay gap is an error, exit 2. **Wiring:** `tunnel` and `tunl` (replacing the wrong `tunl6` row), `tuntap` and `tap` get runs and verb chains, with `outputModes` (for `-o`) and `wideStats` (`-s -s` is `-s` here). They are `noShow`: Show's context has no tnlsys and tuntap ignores selectors. `ErrTunnelUsage` exits 255 and `ErrTunnelRefused` exits 1. A replay's link-name miss (`service.IsLinkNotFound`) is the kernel's ENODEV, so `dev nosuch` is nodev, rc 1. **xtcpnl:** `IPTunnelParm.Marshal`, `IP6TnlParm2.Marshal`, `TunnelPRLRequest` and `SysfsPropLine`, which `ParseSysfsLong` now uses. **cint:** `LongLong` and `U64Bits`. **Moved, not changed:** `tnlParseKey`, `rtnlDsfieldA2N` and `cStrerror` from `goip_write` files to untagged ones, and twelve keyword constants to `keywords.go`, so the read build has them and lint finds no repeated literal. **Tests:** `TestWsTunnelReplay` runs each row through goip's own `run`, with its tnlsnap run's `netlink_route_tnlsys.pcap` as `GOIP_REPLAY` and `tnlsys.out` as `GOIP_TNLSYS`. stdout and rc must equal that run's, and for non-`-d` rows also the row's own `ip.out`. All 195 pass; the skip counts are pinned. `TestGoipTunnelUnit`, 32 rows over a fake dump and a fake `Sys`. Positive: gre key and flag line, `-j` ipip, isatap pr and pdr in text and JSON, sit 6rd, v6 named, tos `inherit/`, `-s`. Negative: a list ioctl refusal, the named refusal (rc 1), keys, mode bogus, two modes, add, duparg2, broadcast, a replay gap (2), a socket failure, PRL and 6rd errnos, an unknown verb, `-0`. Boundary: no tunnels in text and `-j`, `-s` with no stats (T2), ttl 300, a 21-bit flowlabel, help. Corner: mode any, vti, `-j` named as text, `-o`, `-j -s` (T1). `TestGoipTunnelIoctlInputs`, 7 rows: the zeroed v4 list input, the v6 list input, the named struct, iseq/ocsum, the PRL request, the isatap prefix and the tos slash. `TestGoipTuntapUnit`, 18 rows: flags, user and group in text and `-j`; `-d` and `-j -d` holders; fopen, not-a-number, empty and ERANGE messages; unknown command; add; no devices; help; T13; pi/filter/hex bits; `-o -d` (T16); ARPHRD and kind filters. `TestFdinfoIffs` 7, `TestTaskName` 6, `TestTnlTOS` 7, `TestTunnelParmMarshal` 8 (every corpus input rebuilds from its parse), `TestSysfsPropLine` 6, `TestLongLong` 5. `TestVerbChains` has tunnel's and tuntap's transcriptions. The dispatch and resolve tests that used tunnel or tuntap as the unimplemented object now pin `tunt`, `tunl6` (unknown) and tunnel's `prl` verb. **Mutants** (each under `systemd-run --user --scope -p MemoryMax=6G`, `go test -timeout=180s`), all 10 killed: T9's newline added, mode any kept on v4, a 17-entry PRL request, `ttl inherit` in JSON, a list ioctl refusal aborting, tuntap honouring arguments, processes separated, remote `any` in JSON, the ARPHRD filter widened to ETHER, the named path through the list. **Coverage:** obj_tunnel.go 88.0%, obj_tunnel6.go 83.3%, obj_tuntap.go 91.3%, render/tunnel.go 96.4%. **Gates:** `go test -race ./internal/goip/... ./pkg/xtcpnl/ ./pkg/cint/ ./internal/tnlsys/ ./cmd/tnlsnap/ ./tools/nlcapgen/`, and `./internal/goip/` again with `-tags goip_write`. Also `CGO_ENABLED=0 go build ./...`, vet (amd64, and arm64 without cgo), gofmt -s, and golangci-lint at all three tiers: 0 issues on the touched packages, as at HEAD. The nix checks `lint-baseline`, `kernel-citation-audit` and `netlink-audit` pass at the commit. netlink-audit first found unguarded slice expressions in the new encoders, which are now append-style, and in 8P's `parseTunnelName`, which now checks its length. **Correction to V003:** its gates had not run netlink-audit. | + +| DOC001 | 8B | **Doc** `docs/netlink/upstream/iproute2-tunnel-tuntap.md`, marked "Not submitted to netdev". Line numbers are v7.2.0; the HEAD check is the local `87cb3f41` (v7.3.0-47), which for the five files matches the GitHub mirror's `main` (`gh api .../commits?path=`). **Confirmed from the corpus** (15): T1 (`-j -s`, pw-010), T5 (ec-022, ec-026, ng-001; exit 1, not the plan's 255), T6 (ng-002), T7 (pw-003, pw-064), T8 (ec-038), T9 (ec-044, with ec-072 showing a batch line running on), T10 (ec-036), T11 (ng-006), T12 (refined: ec-049 shows `mode ip6ip6` listing `ip6_vti0`, because the match ignores `VTI_ISVTI`), T13 (tuntap/ec-013), T15 (ec-015), T16 (ec-016), T19 (ec-065), T20 (ec-063), T22 (ec-018). **Confirmed latent**, with unit rows (8): T2, T3, T4 (source only), T14 (amended: the drop is not silent), T17, and the new T23 (`read_prop`'s double `fclose`, utils.c:83 and :100), T24 (the ERANGE line has no newline and `errno` is not cleared) and T25 (`tos 0x10/junk` drops the junk). **At HEAD:** T19's overflow is fixed by `614e7481` (2026-10-20), not in v7.3.0, and its garbage line remains. Every other finding is still present; T11's text is also in link_gre.c and link_iptnl.c, and T20's test in link_ip6tnl.c. **Kernel:** K1 (no 6rd in the guest config) and K2 (a netlink-made isatap reports protocol 0). **Dropped:** T21 (ec-071: `ip_batch_cmd` resets the family; nlcapgen's comment and `TestTunnelSpace`'s row description corrected), the `show ""` lead (`matches("")` never matches), and T18 (never written). No new bug class: T23 is C8, T25 is C9. | +| V005 | 8L | **Live diff** on the shared workbench VM (kernel 7.3.1, `ip` 7.2.0; no reboot, nothing else running there). A script generated from `nix/microvms/workbench/{tunnel,tuntap}.rows.jsonl` builds each 8C fixture (`bare`, `tnl4`, `prl16`, `tnl6`, `ext`, `tun`, `proc`, `xns`) in its own named netns, `gt8l--`. It runs the rows' own pre steps through `ip netns exec`, so `/sys/class/net` is the namespace's, and the `proc` and `xns` holders are real `TUNSETIFF` processes. Then it runs every read command of that fixture under `ip` and under goip (a `CGO_ENABLED=0` build of d858b7ace) and compares stdout byte for byte, and the exit status. The commands are all 195 non-batch, non-`-p`, non-write rows. Both tools read the same kernel, sysfs and `/proc` moments apart, so the `-d` pids compare exactly. **Result:** 195 of 195 identical, no fixture step failed. **Cleanup:** the namespaces were deleted and the holders killed. The tunnel and tun modules were unloaded again, as 8C had left them: a first run hit a quoting bug in the generated script, so its loads weren't counted as the script's own and were unloaded by hand. The scratch files were removed. `nix build .#goip` (the `goip_write` package) builds at d858b7ace. | +| V006 | pre-push | **Correction to V001.** The nix `test-go-race` check failed in `cmd/tnlsnap` `TestRunIP`: it ran `snapshotIP` against the host's `/sys/class/net`, which the nix sandbox does not have (`open /sys/class/net: no such file or directory`). `snapshotIP` now asks a package-level `liveSys`, the host's by default. `TestRunIP` points it at an empty fake sysfs and `/proc`, the seam pattern of goip's `netnsRunDir`. The full `go test ./...` passed before the fix. Gates: `go test -race ./cmd/tnlsnap/`, golangci-lint (comprehensive) 0 issues, and nix `test-go-race` at the commit. | +| V007 | pre-push | **Correction to V001.** Re-running the full `go test ./...` after V006 failed `cmd/tnlsnap` `TestRunIP` with `tnlsys: trace: regs: no such process`. Under load it failed 77 of 800 runs. The tracer treated ESRCH from `PTRACE_GETREGS` as fatal. ptrace(2) says a tracee can vanish at any stop, as a thread of the multithreaded Go helper does when its sibling's `exit_group` kills it between the wait and the request. The tracer now drops such a thread (`threadGone`) and keeps waiting; the thread's exit, if any, comes later from Wait4. `TestThreadGone` pins the rule: 6 rows. Gates: the same stress run passes 800 of 800, plus the full `go test ./...`, golangci-lint (comprehensive) and nix `test-go-race` at the commit. | + +## Decision log + +- **2026-11-23: record by tracing `ip`, not by asking every question (8S, a change from the plan).** + - The plan's `Record(sys, links)` would have asked each tunnel with a zeroed argument. But the kernel answers a + fallback device per the input (`ip_tunnel_ctl` looks up the tunnel the passed parm describes). And + `ip -6 tunnel show` fills the input with the ifindex and filter name, and the named path with the parsed + arguments. + - So tnlsnap runs `ip` itself under ptrace and records each ioctl with its exact input, and the snapshot matches on + it. A question goip asks that `ip` did not ask is `ErrNotRecorded` (a replay error), not the plan's `ENODEV`. A + wrong goip input therefore fails loudly instead of replaying another answer. + - The plan's `TestLiveSys` (root only) became the unprivileged `TestTrace` and `TestLiveIoctl`, plus the manual + user-namespace run in V001. 8C and 8L exercise the rest in the VM. +- **2026-11-23: the spill window (8S).** + - A v4 `ip tunnel show NAME` on an ip6gre device passes 52 bytes, and the kernel writes 76 (lead T19). `Live` and + `Trace` therefore watch 64 bytes past every argument. + - `Live` does so for memory safety too: a Go slice the kernel overruns would corrupt the heap. +- **2026-11-23: 8C fixture choices.** + - isatap tunnels come from `ip tunnel add mode isatap`. One made over netlink (`ip link add ... isatap`) reports + protocol 0, so `ip` never reads its routers (K2). `isan` keeps one such tunnel to pin that. + - No 6rd rows: the guest kernel has no `CONFIG_IPV6_SIT_6RD`, so `ip tunnel 6rd` is EINVAL and every + `SIOCGET6RD` fails, which `ip` skips silently (K1). + - No `tnlnofb` fixture: `net.core.fb_tunnels_only_for_init_net` is one setting for the whole guest, and the + workbench VM is shared, so setting it would change every other session's new namespaces. `show gre9` (ENODEV on + the named path) covers the failed ioctl instead. + - `-d` tuntap rows are serial and kill earlier holders first. `show_processes` walks the shared `/proc`, so a + parallel row's holder, or one exiting mid-walk, would otherwise show up. +- **2026-11-23: the recorder records only what `ip` asks (8C, a change to 8S's tnlsnap).** + - Spill: the window past an argument is filled with `0xA5` at entry and cut at the last changed byte at exit, as + `Live` does. The bytes after the cut go back to the tracee. A kernel reply ending in `0xA5` bytes would be cut + short; no request here does that. + - The `/proc` walk is recorded only when `ip` would make it. goip asks `TunFDs` only under `-d tuntap`, so a + replay of any other row never meets a missing walk. +- **2026-11-23: what the corpus replay leaves out (8R).** + - Batch rows (12): goip refuses `-batch`. `ip -batch` keeps one process's link cache, dsfield table and socket + across lines, which a line-by-line replay would not be. + - `-p` rows (2): goip implements `-pretty` for no object. + - Write rows (8): `tunnel add/prl/6rd` and `tuntap add/del` are refused with `ErrNotImplemented`, exit 1. `ip` exits + 255 for some argument errors first (`prl` with no device, `tuntap add mode bogus`). Mirroring write parsers up to + the ioctl is out of scope. +- **2026-11-23: `tunnel` and `tuntap` are command-line only (8R).** They are `noShow`, like the genl objects. + `Show`'s context (the HTTP paths) opens no tnlsys, and `tuntap show` ignores every selector (T13), so a write verb + after show could not be refused there. +- **2026-11-23: the uninitialized `encaplimit` byte (8R, T20).** `get_u8` failing leaves `uval` unset, and `ip` + passes it on. The corpus row `encaplimit 300` matches every tunnel, which is what 0 does, so goip uses 0. Lead T20 + in 8B records the read of an uninitialized variable. diff --git a/docs/netlink/goip-tunnel.md b/docs/netlink/goip-tunnel.md new file mode 100644 index 000000000..5ad16c1c5 --- /dev/null +++ b/docs/netlink/goip-tunnel.md @@ -0,0 +1,120 @@ +# goip `ip tunnel`, `ip -6 tunnel` and `ip tuntap`: design + +**Status:** increment 8, in progress. Progress is tracked in [goip-tunnel-status.md](goip-tunnel-status.md). +Findings will go in `upstream/iproute2-tunnel-tuntap.md` (8B; not submitted to netdev). + +## Contents + +- [Scope](#scope) +- [Why netlink is not enough](#why-netlink-is-not-enough) +- [The sidecar: internal/tnlsys](#the-sidecar-internaltnlsys) +- [Recording: tnlsnap](#recording-tnlsnap) +- [Replay in goip](#replay-in-goip) +- [Tasks](#tasks) + +## Scope + +**In:** +- `ip [-4|-6] tunnel [show|list|lst] [filters]` and its `tunl` alias. (The plan said `tunl6`, after goip's old + object table. iproute2 7.2.0's `ip.c` has `tunl` and no `tunl6`, so 8R replaced the row.) +- `ip tuntap|tap [show|list|lst]`. +- The options `-j -s -d -o`. `-p` (pretty JSON) is out: goip implements it for no object. + +goip must reproduce iproute2 7.2.0's stdout, stderr and exit status byte for byte. + +**Out:** the writes (`tunnel add/change/del/prl/6rd`, `tuntap add/del`) are ioctl or `TUNSETIFF` writes. goip refuses +them with `ErrNotImplemented`. + +## Why netlink is not enough + +`ip tunnel show` (`ip/tunnel.c` `do_tunnels_list`) dumps the links over rtnetlink. Then, for each link whose ARPHRD +matches the family, it asks the device with `SIOCGETTUNNEL`. The ioctl passes a `struct ip_tunnel_parm` (52 bytes) or +`struct ip6_tnl_parm2` (76 bytes) through `ifr_data`. An isatap tunnel adds `SIOCGETPRL` and a sit tunnel adds +`SIOCGET6RD`. With a mode, or a name starting with `gre`, `ipip`, `sit`, `isatap` or `vti`, it skips the dump and +asks the named device, or the mode's fallback device. + +`ip tuntap show` dumps links of kind `tun`. For each one it reads `/sys/class/net/DEV/{tun_flags,owner,group}`. Under +`-d` it walks `/proc/[0-9]*/fd/[0-9]*` for descriptors linked to `/dev/net/tun`, then reads their `fdinfo` and the +process's `comm`. + +None of that is netlink, so nlmon does not see it. strace shows the ioctl but not the struct behind `ifr_data`. + +**The answer depends on the question.** For a fallback device (`tunl0`, `gre0`, `sit0`, `ip_vti0`, `ip6tnl0`, +`ip6gre0`), the kernel looks up the tunnel the passed parameters describe and returns that tunnel's parameters, or the +fallback's own: +- `net/ipv4/ip_tunnel.c` `ip_tunnel_ctl`, `case SIOCGETTUNNEL`; +- `net/ipv6/ip6_tunnel.c` `ip6_tnl_siocdevprivate`; +- `net/ipv6/ip6_gre.c` `ip6gre_tunnel_siocdevprivate`. + +`ip -6 tunnel show` also fills each input itself (`ip6_tnl_parm_initialize`), with the link's ifindex and the filter +name. A snapshot keyed by device name alone would answer the wrong question. + +## The sidecar: internal/tnlsys + +`tnlsys.Sys` is the seam: + +```go +Ioctl(family int, req uint32, name string, arg []byte) (spill []byte, err error) +ReadProp(dev, prop string) (string, error) +TunFDs() ([]TunFD, error) +``` + +- **`Live`** asks the kernel: + - It makes a raw `SYS_IOCTL` on a fresh `SOCK_DGRAM` socket of the family, as `tnl_get_ioctl` does. The ifreq is + laid out as in `pkg/linkmonitor`. + - The kernel writes into a copy of the argument that is `SpillWindow` bytes longer, filled with `0xA5`. A reply + larger than the argument therefore lands in memory Live owns, and comes back as `spill` instead of corrupting the + heap. ip6gre copies 76 bytes whatever it was given. + - sysfs and procfs are read under `os.Root`. + - The `/proc` walk keeps directory order, as glob's `GLOB_NOSORT` does, and skips the caller's own pid. +- **`Snapshot`** answers from a JSON sidecar. Each ioctl is keyed by family, request, name (cut as `strlcpy` cuts it) + and the exact input bytes. + - A recorded failure comes back as its errno. + - A question the recording never saw is `ErrNotRecorded`, a replay error. It is never `ENODEV`, because a real + `ENODEV` is recorded as such. + +## Recording: tnlsnap + +`tnlsnap -- ip ARGS...` (`cmd/tnlsnap`, nix package `tnlsnap`) does three things: +1. It runs the real `ip` under ptrace (`tnlsys.Trace`, linux/amd64). At each `ioctl` entry for the three requests, it + reads the ifreq, then the argument plus `SpillWindow` bytes, and fills the bytes past the argument with `0xA5`, as + `Live` does. At the exit, it reads the window again: + - the spill is the window up to its last byte that is not `0xA5`, which is what the kernel wrote; + - the tracee gets its own bytes back after that. + + Without the fill, the spill would include whatever `ip` kept on its stack past the argument, which varies from run + to run. + - The family comes from the `socket(2)` that made the descriptor. + - A `SIOCGETPRL` argument is sized from its own `datalen`. + - Threads are followed (`PTRACE_O_TRACECLONE`), so a multithreaded test helper records as `ip` does. +2. It records `tun_flags`, `owner` and `group` of every tun device in `/sys/class/net`. +3. When `ip` would walk `/proc` itself, it records the `/dev/net/tun` descriptor walk. That is when `-details` is set + and the object is `tuntap` (or the run is a `-batch`, whose lines may name it). tnlsnap mirrors `ip.c`'s option loop + and `do_cmd`'s object order to decide. Any other walk would only record other rows' holder processes, which `ip` + never asks about and which vary between runs. + +It prints the snapshot as JSON. The traced run's own stdout, stderr and status go into the snapshot's `run`, so a +capture can check that the recorded run matched the captured one. + +A capture row runs it as a readback, `{name: "tnlsys", cmd: "tnlsnap -- "}`. The readback goes to +the row's `tnlsys.out`. + +## Replay in goip + +`runCtx.sys` comes from `openSys` (`internal/goip/goip.go`): +- `GOIP_TNLSYS=` loads a snapshot. +- `GOIP_REPLAY` without it gives an empty snapshot, so a replay never asks the host's kernel. +- Otherwise the kernel is asked live. + +It is an environment variable, as `GOIP_REPLAY` is, so goip's argv stays ip's. + +## Tasks + +| Task | Work | +|---|---| +| 8S | `internal/tnlsys`, `cmd/tnlsnap`, goip's `runCtx.sys` | +| 8C | capture spaces `tunnel` and `tuntap` (`tools/nlcapgen`), with the `tnlsys` readback | +| 8P | `pkg/xtcpnl/xtcpnl_tunnel_parm.go`: the parm, PRL and 6rd structs, and `tun_flags` | +| 8R | goip `obj_tunnel.go`, `obj_tuntap.go`; corpus replay with the sidecar | +| 8B | the bug hunt: `upstream/iproute2-tunnel-tuntap.md` | +| 8L | live diff on the workbench VM | diff --git a/docs/netlink/upstream/iproute2-tunnel-tuntap.md b/docs/netlink/upstream/iproute2-tunnel-tuntap.md new file mode 100644 index 000000000..8c056f982 --- /dev/null +++ b/docs/netlink/upstream/iproute2-tunnel-tuntap.md @@ -0,0 +1,274 @@ +# iproute2 `ip tunnel` and `ip tuntap` bugs: a stack overflow, a double fclose, text inside JSON, an uninitialized byte, and filters that match the wrong tunnels + +**Status (2026-11-23, increment 8):** + +- **Not submitted to netdev.** These are drafts for the user's review, recorded here only, like the other write-ups in + this directory. No patch, no PR, no sign-off. +- **Source:** + - Line numbers are iproute2 **v7.2.0** (`ip/iptunnel.c`, `ip/ip6tunnel.c`, `ip/tunnel.c`, `ip/iptuntap.c`, + `lib/utils.c`), the version the corpus was captured with. + - "At HEAD" means the local `~/Downloads/iproute2` at `87cb3f41` (`v7.3.0-47`, 2026-11-18). For these five files + that is the same as the GitHub mirror's `main` (checked with `gh api repos/iproute2/iproute2/commits?path=...`). +- **How they were found:** in increment 8 ([goip-tunnel.md](../goip-tunnel.md)). + - The plan's bug-class sweep ([bug-classes.md](bug-classes.md)) listed leads T1–T17. + - The captures (8C, V002) added T19–T22, and the clone (8R, V004) the rest. + - `goip` replays all 195 replayable corpus rows byte for byte, so every captured finding below is reproduced by an + independent implementation, not just read from the source. +- **Corpus:** `pkg/xtcpnl/testdata/7_3_1/ws/tunnel/` (171 rows) and `ws/tuntap/` (46), kernel 7.3.1. Each row has a + `tnlsys.out` sidecar recording every ioctl `ip` made, sysfs read and `/proc` walk. +- **Reachability:** + - In the corpus: T1, T5, T6, T7, T8, T9, T10, T11, T12, T13, T15, T16, T19, T20 and T22. + - Latent, with unit rows in `internal/goip/obj_tunnel_test.go` / `obj_tuntap_test.go`: T2, T3, T4, T14, T17, T23, + T24 and T25. They need a failure the kernel does not produce on request. + - K1 and K2 are kernel or kernel-config notes. + - Dropped: T18 (never written), T21, and the `show ""` lead. + +## Contents + +- [Summary](#summary) +- [T19. `ip tunnel show gre*` on an ip6gre device overflows `ip`'s stack (fixed after 7.3.0)](#t19-ip-tunnel-show-gre-on-an-ip6gre-device-overflows-ips-stack-fixed-after-730) +- [T14, T23, T24. `read_prop`: a double `fclose`, messages that are not silent, a missing newline](#t14-t23-t24-read_prop-a-double-fclose-messages-that-are-not-silent-a-missing-newline) +- [T20. `encaplimit` reads an uninitialized byte](#t20-encaplimit-reads-an-uninitialized-byte) +- [T1, T2. `-s` stats are bare `printf`, inside `-j`](#t1-t2--s-stats-are-bare-printf-inside--j) +- [T7, T9. JSON and newline inconsistencies between the paths](#t7-t9-json-and-newline-inconsistencies-between-the-paths) +- [T5, T6, T10, T12. What `show` actually lists](#t5-t6-t10-t12-what-show-actually-lists) +- [T8. A 16th isatap router is silently dropped](#t8-a-16th-isatap-router-is-silently-dropped) +- [T3. A refused `SIOCGETTUNNEL` in the list is a stderr line and exit 0](#t3-a-refused-siocgettunnel-in-the-list-is-a-stderr-line-and-exit-0) +- [T4, T11. Messages with a newline too many](#t4-t11-messages-with-a-newline-too-many) +- [T25. `tos 0x10/junk` drops the junk silently](#t25-tos-0x10junk-drops-the-junk-silently) +- [T13, T15, T16, T17, T22. `ip tuntap show`](#t13-t15-t16-t17-t22-ip-tuntap-show) +- [K1, K2. Kernel notes](#k1-k2-kernel-notes) +- [Dropped leads](#dropped-leads) + +## Summary + +| ID | File:line (v7.2.0) | Class | Finding | Pinned by | At HEAD | goip | +|---|---|---|---|---|---|---| +| T19 | iptunnel.c:415, 432 | C11 | `show NAME` with a `gre`/`ipip`/`sit`/`vti` prefix on an ip6gre device: the kernel writes a 76-byte `ip6_tnl_parm2` into a 52-byte stack struct | tunnel/ec-065 | fixed by `614e7481` (2026-10-20), not in v7.3.0 | prints the 52 bytes as `ip` does | +| T23 | utils.c:83, 100 | C8 | `read_prop` calls `fclose(fp)` twice on the not-a-number and ERANGE paths | unit | present | n/a (prints the messages) | +| T14 | utils.c:66-101 | C8 | a failed sysfs read is not silent: four messages, then `Failed to parse` | unit | present | same messages | +| T24 | utils.c:92-93 | C10 | the ERANGE message has no newline; `errno` is not cleared before `strtol` | unit | present | same text | +| T20 | ip6tunnel.c:184 | C9 | `get_u8(...) < -1` never fires; a bad `encaplimit` passes an uninitialized byte | tunnel/ec-063 | present (also link_ip6tnl.c:198) | uses 0, the corpus's value | +| T1 | tunnel.c:336-346, 410-412 | C5 | `-s` stats and the per-tunnel newline are bare `printf`/`fputc`, inside a `-j` document | tunnel/pw-010 | present | same bytes | +| T2 | tunnel.c:407-408 | C8 | a printed tunnel with no stats under `-s` ends the dump: "Dump terminated", exit 1 | unit | present | same | +| T7 | iptunnel.c:305-333, 344-366; ip6tunnel.c:81 | C7 | vti prints `ip/ip`; `ttl inherit`/`tos inherit` absent from JSON; repeated `pr`/`pdr` keys; remote `any` vs `0.0.0.0`; `dev` vs `link`; `"flags":[]` for gre only | tunnel/pw-003, pw-064 | present | same | +| T9 | ip6tunnel.c:363 | C5 | `ip -6 tunnel show NAME` prints no final newline; in a batch the next line runs on | tunnel/ec-044, ec-072 | present | same | +| T5 | iptunnel.c:252-264, 415-437 | C14 | `show mode X` or a `gre*`/`ipip*`/`sit*`/`isatap*`/`vti*` name takes the single-device path, not the list | tunnel/ec-022, ec-026, ng-001 | present | same | +| T6 | iptunnel.c:213-218 | C9 | `show key 5` is refused unless a gre or vti mode is given, and a mode skips the list the key would filter | tunnel/ng-002 | present | same | +| T10 | iptunnel.c:550-558 | C9 | the `mode` pre-scan: `ip -4 tunnel show mode any` is `ip -6 tunnel show` | tunnel/ec-036 | present | same | +| T12 | ip6tunnel.c:317-336 | C14 | `mode ip6ip6` lists vti6 devices and `mode vti6` lists ip6ip6 ones: the match ignores `VTI_ISVTI`; a proto-0 device matches every mode | tunnel/ec-049 | present | same | +| T8 | iptunnel.c:319-333 | C11 | `SIOCGETPRL` into a fixed 16-entry buffer, entry 0 the header: at most 15 routers print | tunnel/ec-038 | present | same | +| T3 | tunnel.c:397-398 | C8 | a refused `SIOCGETTUNNEL` in the list prints `get tunnel "X" failed` and skips the device, exit 0 | unit | present | same | +| T4 | tunnel.c:421; iptuntap.c:434 | C10 | `perror("Cannot send dump request\n")`: perror's `: strerror` lands on a line of its own | source | present | n/a | +| T11 | iptunnel.c:143 | C10 | `invarg("invalid TTL\n")`: invarg adds its own newline | tunnel/ng-006 | present (also link_gre.c:276, link_iptnl.c:220) | same | +| T25 | iptunnel.c:149-164 | C9 | `tos 0x10/junk` sets 0x10 and ignores `/junk` | unit | present | same | +| T13 | iptuntap.c:461 | C9 | `tuntap show` ignores every argument | tuntap/ec-013 | present | same | +| T15 | iptuntap.c:313-326 | C10 | `-d`: processes run together, `name(pid)name(pid)` | tuntap/ec-015 | present | same | +| T16 | iptuntap.c:420-426 | C5 | `-o -d`: `_SL_` before "Attached", a hard `\n` after the device | tuntap/ec-016 | present | same | +| T17 | iptuntap.c:368, 374-380 | C14 | only `ARPHRD_NONE`/`ETHER` pass, and `RTM_DELLINK` is accepted in a dump | unit | present | same | +| T22 | iptuntap.c:310-315 | C14 | `-d` matches a holder by device *name*: a process holding another namespace's `tap0` is listed under this one's | tuntap/ec-018 | present | same | + +## T19. `ip tunnel show gre*` on an ip6gre device overflows `ip`'s stack (fixed after 7.3.0) + +`do_show` (iptunnel.c:415-437) parses the arguments into a stack `struct ip_tunnel_parm p` (52 bytes). A name +starting `gre` sets `IPPROTO_GRE` (iptunnel.c:197), so `tnl_defname` returns `gre0` and the named path asks the +device directly: `tnl_get_ioctl(p.name, &p)`. The kernel answers `SIOCGETTUNNEL` from the *device's* driver. For an +ip6gre device that is `ip6gre_tunnel_siocdevprivate`, which copies a whole `struct ip6_tnl_parm2` (76 bytes) to +`ifr_data`. That writes 24 bytes past `p` on `ip`'s stack. + +- **Row:** tunnel/ec-065, `ip tunnel show gre6x` (an ip6gre device named `gre6x`). The sidecar records the kernel's + 24-byte spill past the 52-byte argument (`tnlsys.out`, the only spill in the corpus). `ip` then prints the IPv6 + struct read as an IPv4 one: `gre6x: any/ip remote 32.1.13.184 local 0.0.0.1 ttl inherit tos inherit nopmtudisc + ikey 0`. Here 32.1.13.184 is `2001:0db8`, and the GRE_KEY bit comes from the IPv6 flags word. +- **At HEAD:** `614e7481` ("iptunnel: use worst case buffer for tunnel ioctls", 2026-10-20) passes a + `union { ip_tunnel_parm; ip6_tnl_parm2 }` on all three ioctl paths, so the overflow is gone. It is after v7.3.0, so + no release has it yet. +- **Left after the fix:** the garbage line. `ip tunnel show gre6x` still prints an ip6gre tunnel decoded as a v4 + one, exit 0. The name-prefix heuristic picks the v4 struct for a device whose type it never checked. A fix would + look up the device's ARPHRD (or `IFLA_INFO_KIND`), as the list path does, before choosing the struct. + +## T14, T23, T24. `read_prop`: a double `fclose`, messages that are not silent, a missing newline + +`ip tuntap show` reads `/sys/class/net/DEV/{tun_flags,owner,group}` with `read_prop` (lib/utils.c:52-102): + +```c + nl = strchr(buf, '\n'); + if (nl) + *nl = '\0'; + + fclose(fp); /* :83 */ + result = strtol(buf, &endp, 0); + + if (*endp || buf == endp) { + fprintf(stderr, "value \"%s\" in file %s is not a number\n", buf, fname); + goto out; + } + + if ((result == LONG_MAX || result == LONG_MIN) && errno == ERANGE) { + fprintf(stderr, "strtol %s: %s", fname, strerror(errno)); /* :93, no \n */ + goto out; + } + ... +out: + fclose(fp); /* :100 */ + fprintf(stderr, "Failed to parse %s\n", fname); + return -1; +``` + +- **T23 (double fclose):** both the not-a-number and the ERANGE paths reach `out:` after the `fclose` at :83. Calling + `fclose` on a closed `FILE *` is undefined behaviour. glibc usually tolerates it, but a stream freed by the first + call can be reused by another `fopen` in between, or abort under `MALLOC_CHECK_`/ASan. The `fgets`-failed path + jumps to `out:` before :83, so it is correct. **Fix:** move the `fclose` at :83 below the checks, or drop the + `fclose` from `out:` and close before each `goto`. +- **T14 (not silent):** the plan's lead said a failed read drops the device silently. It does drop the device, but + only after printing one of `fopen %s: %s`, `property "%s" in file %s is currently unknown`, `value "%s" in file %s + is not a number` or the strtol line, and then `Failed to parse %s`. That is the intended behaviour; the lead is + amended. +- **T24 (format):** the ERANGE message has no `\n`, so it and `Failed to parse` share one line. `errno` is never set + to 0 before `strtol`. A stale `ERANGE` from an earlier call, together with a file that legitimately holds + `LONG_MAX`, would be reported as out of range. +- **Rows:** none in the corpus: sysfs always has the three files with numbers in them. The unit rows in + `TestGoipTuntapUnit` (fopen, not a number, empty, ERANGE) pin the texts goip reproduces. They cannot pin the double + close. + +## T20. `encaplimit` reads an uninitialized byte + +```c + } else { + __u8 uval; + + if (get_u8(&uval, *argv, 0) < -1) /* ip6tunnel.c:184 */ + invarg("invalid ELIM", *argv); + p->encap_limit = uval; +``` + +`get_u8` returns 0 or -1, never less than -1, so the invarg never fires. On failure `get_u8` leaves `uval` unset, +and `ip` copies the uninitialized stack byte into the struct. In `show` that byte is a match filter: `ip -6 tunnel +show encaplimit 300` (tunnel/ec-063) listed every tunnel, so the byte happened to be 0. In `add` it is sent to the +kernel. Linux's `ip link ... type ip6tnl encaplimit` has the same test (link_ip6tnl.c:198). There goip refuses the +value as not implemented (goip-link-kinds, KG4-T05), because the request byte is unknowable. **Fix:** `if +(get_u8(&uval, *argv, 0))`. + +## T1, T2. `-s` stats are bare `printf`, inside `-j` + +`print_nlmsg_tunnel` (tunnel.c:400-414) prints each tunnel through `json_print`. Then, under `-s`, it calls +`tnl_print_stats`, which is five bare `printf`s (tunnel.c:336-346), and finally `fputc('\n', stdout)`. Under `-j` the +document becomes: + +``` +[{"ifname":"gre0",...,"flags":[]} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ip_vti0",...} +``` + +(tunnel/pw-010.) That is not JSON. Even without `-s`, the bare newline gives `[{...}\n,{...}\n]`, which parses but +is not json_writer's output. The counters are `__u64` printed `%lld`. + +**T2:** if `get_rtnl_link_stats_rta` finds no stats, the callback returns -1 after the tunnel was printed. That ends +the whole dump with "Dump terminated", exit 1. No kernel omits the stats from these dumps, so this is latent (unit +row). + +## T7, T9. JSON and newline inconsistencies between the paths + +- vti prints `ip/ip` (protocol IPIP), indistinguishable from ipip except by name. +- `ttl inherit` and `tos inherit` are `PRINT_FP`, so the JSON has no `ttl`/`tos` member for them. A consumer can't + tell inherit from "not printed". v6's `hoplimit inherit` is the same. +- isatap routers are `"pr"` and `"pdr"` members, repeated within one object (`{"pr":"192.0.2.11","pdr":...}`). With + two or more `pr`s the object has duplicate keys. +- `remote` is `any` in text but `"0.0.0.0"` in JSON (iptunnel.c:309); v6 always prints `::`. +- The link is `"dev"` in v4 JSON (iptunnel.c:344) and `"link"` in v6 (ip6tunnel.c:81), with the same text `dev X`. +- **T9:** v4's named path ends with `fputc('\n')` (iptunnel.c:437). v6's (ip6tunnel.c:363) does not, so `ip -6 tunnel + show ip6t1` leaves the cursor on the line (tunnel/ec-044). In a batch the next command's output runs on: + `...allow-localremotegre0: gre/ip remote any ...` (tunnel/ec-072). `-s NAME` takes the list path instead + (ip6tunnel.c:348), so `-s` changes which code prints the tunnel (tunnel/ec-045). +- Both named paths print text under `-j`: they never call `new_json_obj`, so `print_*` finds no writer + (tunnel/pw-022). + +## T5, T6, T10, T12. What `show` actually lists + +- **T5:** `tnl_defname` turns any mode, and any name with a `gre`/`ipip`/`sit`/`isatap`/`vti` prefix, into the + single-device path. So `ip tunnel show mode gre` prints only `gre0`, the fallback device, with the parsed + arguments as its lookup key (tunnel/ec-026), not every gre tunnel. `show gre9` is `get tunnel "gre9" failed: No + such device`, exit 1 (tunnel/ng-001). The plan's "exit 255" was wrong: `do_show` returns -1 and `do_cmd` negates + it. +- **T6:** `key`, `ikey` and `okey` are refused without a gre or vti mode ("Keys are not allowed with ipip and sit + tunnels", exit 1, tunnel/ng-002), and with one the list is skipped. So `ip_tunnel_parm_match`'s `i_key` test is + reachable only through a multicast `remote`, which sets the keys. +- **T10:** `do_iptunnel` scans its arguments for `mode` before anything else, and an IPv6 mode word sets + `preferred_family = AF_INET6`, overriding `-4`. `ip tunnel show mode any` therefore lists the IPv6 tunnels + (tunnel/ec-036), because `any` is in the IPv6 list (iptunnel.c:540). +- **T12:** `ip6_tnl_parm_match` compares `proto` only. `mode vti6` sets `IPPROTO_IPV6` plus `VTI_ISVTI` in `i_flags`, + which the match never reads. So `ip -6 tunnel show mode ip6ip6` lists `ip6_vti0` (tunnel/ec-049), and `mode vti6` + lists the ip6ip6 tunnels. The `!p2->proto` arm also passes a device configured `mode any` for every mode filter. + +## T8. A 16th isatap router is silently dropped + +`print_tunnel` passes `struct ip_tunnel_prl prl[16]`, entry 0 being the request header, so the kernel fills at most +15 entries. With 16 routers configured (`prl16` fixture), `ip tunnel show isa16` prints 15 and says nothing about +the 16th (tunnel/ec-038). The kernel reports the full count only if asked again with a bigger buffer, which `ip` +never does. + +## T3. A refused `SIOCGETTUNNEL` in the list is a stderr line and exit 0 + +`print_nlmsg_tunnel` skips a device whose ioctl fails after `tnl_get_ioctl` prints `get tunnel "X" failed: %s` +(tunnel.c:397-398, :65). The listing then exits 0 with an incomplete list. No device in the corpus refuses (the +external and Ethernet kinds are filtered out by ARPHRD first), so this is a unit row. + +## T4, T11. Messages with a newline too many + +- **T4:** `perror("Cannot send dump request\n")` (tunnel.c:421, iptuntap.c:434) prints `Cannot send dump request`, + then a newline, then `: ` on a line of its own. The same pattern is in bridge (B3's class). +- **T11:** `invarg("invalid TTL\n", *argv)` (iptunnel.c:143) gives `Error: argument "300" is wrong: invalid TTL`, + then two newlines (tunnel/ng-006). The same text is in link_gre.c:276 and link_iptnl.c:220 at HEAD. + +## T25. `tos 0x10/junk` drops the junk silently + +```c + dsfield = *argv; + strsep(&dsfield, "/"); + if (strcmp(*argv, "inherit") != 0) { + dsfield = *argv; + p->iph.tos = 0; + } else + p->iph.tos = 1; +``` + +`strsep` cuts the word at the first `/`. For a value that is not `inherit`, the code then points `dsfield` back at +the cut word, so whatever followed the slash is never looked at: `tos 0x10/junk` is `tos 0x10`, and `tos 0x10/0x20` +too. Only `inherit/X` reads the part after the slash. A unit row (`TestTnlTOS`) and an ioctl-input row pin it. + +## T13, T15, T16, T17, T22. `ip tuntap show` + +- **T13:** `do_iptuntap` calls `do_show(argc-1, argv+1)`, and `do_show` never reads its arguments. `ip tuntap show + dev tap0` lists every tun device (tuntap/ec-013), as does `show bogus`. The usage advertises `[ dev PHYS_DEV ]`. +- **T15:** under `-d`, each holder is `print_string("%s", name)` then `print_uint("(%d)", pid)` with no separator: + `Attached to processes:python3(209813)python3(209816)` (tuntap/ec-015). +- **T16:** the line before is `print_string(PRINT_FP, NULL, "%s\tAttached to processes:", _SL_)`, but the device's + line ends with a hard `print_string(PRINT_FP, NULL, "%s", "\n")`. So `-o -d` is one line per device with a + backslash before "Attached" (tuntap/ec-016). Without `-d`, `-o` changes nothing. +- **T17:** `print_tuntap` accepts `RTM_DELLINK` as well as `RTM_NEWLINK` in a dump. It keeps only `ARPHRD_NONE` and + `ARPHRD_ETHER`, which are the two types a tun device can have. +- **T22:** `show_processes` walks every `/proc/*/fd/*` and keeps descriptors whose fdinfo `iff:` equals the device + *name*. `/proc` is shared across network namespaces, so a process holding a `tap0` in another namespace is listed + under this namespace's `tap0` (tuntap/ec-018, fixture `xns`). The fdinfo carries no namespace or ifindex to tell + them apart. + +## K1, K2. Kernel notes + +- **K1:** the workbench guest kernel has no `CONFIG_IPV6_SIT_6RD`. Every `SIOCGET6RD` is EINVAL, which `ip` skips + silently (`tnl_ioctl_get_6rd`'s `skiperr`), and `ip tunnel 6rd` cannot be captured. The 6rd printer is covered by + unit rows only. +- **K2:** an isatap tunnel made over netlink (`ip link add ... type sit mode isatap`) reports protocol 0 to + `SIOCGETTUNNEL`, so `ip tunnel show` prints it as `any/ip` and never asks for its routers. One made with `ip tunnel + add mode isatap` reports `IPPROTO_IPV6`. The `isan` device in the `tnl4` fixture pins the difference. + +## Dropped leads + +- **T21** ("`mode any` sticks across batch lines"): refuted. `ip_batch_cmd` resets `preferred_family` before each + line, and tunnel/ec-071 shows line 2 back on v4. The nlcapgen comment that asserted it is corrected. +- **`ip tunnel show ""` is usage:** refuted. `matches("", "help")` returns non-zero for an empty prefix, so `""` falls + through to `get_ifname`, which refuses it: `"name" not a valid ifname`, exit 255. +- **T18:** no such lead was written. The numbering jumps from the plan's T17 to 8C's T19. diff --git a/internal/goip/cparse.go b/internal/goip/cparse.go index b4df05422..f097baf21 100644 --- a/internal/goip/cparse.go +++ b/internal/goip/cparse.go @@ -8,8 +8,10 @@ import ( "strconv" "strings" + "github.com/randomizedcoder/xtcp2/internal/goip/render" "github.com/randomizedcoder/xtcp2/pkg/cint" "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" ) // This file transcribes the libc and lib/utils.c number and address readers @@ -332,3 +334,26 @@ func mplsPton(s string) (data []byte, tooMany, ok bool) { } return nil, true, false } + +// rtnlDsfieldA2N is rtnl_dsfield_a2n: a name from the rt_dsfield file +// iproute2 ships, then strtoul base 16 over the whole argument, at most 255. +func rtnlDsfieldA2N(arg string) (uint8, bool) { + if v, ok := render.DsfieldByName(arg); ok { + return v, true + } + r := cStrtoul(arg, 16) + if r.end == 0 || r.end != len(arg) || r.val > math.MaxUint8 { + return 0, false + } + return uint8(r.val), true +} + +// cStrerror is glibc's strerror for the errnos the loader reports: Go's +// texts are glibc's with the first letter lowered. +func cStrerror(e unix.Errno) string { + s := e.Error() + if s == "" { + return s + } + return strings.ToUpper(s[:1]) + s[1:] +} diff --git a/internal/goip/dispatch.go b/internal/goip/dispatch.go index e1004ac36..da5ad570b 100644 --- a/internal/goip/dispatch.go +++ b/internal/goip/dispatch.go @@ -7,6 +7,7 @@ import ( "time" "github.com/randomizedcoder/xtcp2/internal/goip/req" + "github.com/randomizedcoder/xtcp2/internal/tnlsys" "golang.org/x/sys/unix" ) @@ -45,6 +46,10 @@ type object struct { showVerb string // noShow marks an object with no read that ends: monitor prints until // it is killed, so Show, and the HTTP paths over it, leave it out. + // Objects whose listing goip leaves to the command line are marked too: + // the genl ones, and tunnel and tuntap, which read the kernel outside + // netlink (runCtx.sys, which Show's context does not open) and, for + // tuntap, ignore every selector (T13). noShow bool } @@ -53,6 +58,7 @@ const ( objRouteCst = "route" objLinkCst = "link" objNexthopCst = "nexthop" + objTunnelCst = "tunnel" ) // objects is the object table in iproute2's order, which is load-bearing. @@ -89,13 +95,13 @@ var objects = []object{ {name: "fou", run: runFou, verbs: fouVerbs, noShow: true}, {name: "ila", run: runIla, verbs: ilaVerbs, noShow: true}, {name: "macsec", run: runMacsec, verbs: macsecVerbs, noShow: true}, - {name: "tunnel"}, - {name: "tunl6"}, + {name: objTunnelCst, run: runTunnel, verbs: tunnelVerbs, outputModes: true, wideStats: true, noShow: true}, + {name: "tunl", run: runTunnel, verbs: tunnelVerbs, outputModes: true, wideStats: true, aliasOf: objTunnelCst, noShow: true}, {name: "tcp_metrics", run: runTCPMetrics, verbs: tcpMetricsVerbs}, {name: "tcpmetrics", run: runTCPMetrics, verbs: tcpMetricsVerbs, aliasOf: "tcp_metrics"}, {name: "token", run: runToken, verbs: tokenVerbs}, - {name: "tuntap"}, - {name: "tap", aliasOf: "tuntap"}, + {name: "tuntap", run: runTuntap, verbs: tuntapVerbs, outputModes: true, wideStats: true, noShow: true}, + {name: "tap", run: runTuntap, verbs: tuntapVerbs, outputModes: true, wideStats: true, aliasOf: "tuntap", noShow: true}, {name: "mroute", run: runMroute, verbs: mrouteVerbs}, {name: "mrule", run: runMrule, verbs: ruleVerbs}, {name: "netns", run: runNetns, verbs: netnsVerbs, showVerb: netnsListIDVerbCst}, @@ -246,6 +252,9 @@ func wideStatsObject(args []string) bool { type runCtx struct { src Source lltab *LLTab + // sys answers what tunnel and tuntap ask outside netlink: the + // SIOCGETTUNNEL family of ioctls, sysfs and /proc. See openSys. + sys tnlsys.Sys // in is stdin, which only the showdump and restore verbs read. in io.Reader out io.Writer diff --git a/internal/goip/dispatch_test.go b/internal/goip/dispatch_test.go index 57acc8865..b8f1bda9e 100644 --- a/internal/goip/dispatch_test.go +++ b/internal/goip/dispatch_test.go @@ -135,12 +135,15 @@ func TestLookupObject(t *testing.T) { arg: "l", wantName: "link", }, { - // **Recognized but unimplemented, which must be distinguishable - // from a typo.** The harness drives both tools with the same argv, - // so it has to tell "goip has not got there yet" from "that is not - // a command". - description: "boundary: \"tuntap\" is recognized and reports ErrNotImplemented", - arg: "tuntap", wantName: "tuntap", wantErr: ErrNotImplemented, + // increment 8 gave the last run-less rows theirs: tuntap reads + // sysfs through tnlsys. + description: "boundary: \"tunt\" is tuntap, the last object to be implemented", + arg: "tunt", wantName: "tuntap", + }, + { + // ip.c's cmds has tunl after tunnel (v7.2.0); there is no tunl6. + description: "corner: \"tunl\" is the tunnel alias, and \"tunl6\" is unknown", + arg: "tunl6", wantErr: ErrUnknownObject, }, { // G7-T01 gave xfrm its run; its policy and monitor are still diff --git a/internal/goip/goip.go b/internal/goip/goip.go index 85b367eee..023170ca2 100644 --- a/internal/goip/goip.go +++ b/internal/goip/goip.go @@ -5,6 +5,8 @@ import ( "fmt" "io" "os" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" ) // Exit codes, matching `ip`: 1 for a usage or argument error, 2 for a runtime @@ -127,6 +129,10 @@ func run(args []string, stdin io.Reader, stdout, stderr io.Writer) int { }() c.src = src + if c.sys, err = openSys(); err != nil { + fmt.Fprintf(stderr, "goip: %v\n", err) + return ExitFailure + } if err := obj.run(c, args[1:]); err != nil { fmt.Fprintf(stderr, "goip: %v\n", err) @@ -164,6 +170,8 @@ func run(args []string, stdin io.Reader, stdout, stderr io.Writer) int { // dump it cannot finish, and 2 for a kernel refusal. vrf exits 255 for // what ipvrf.c ends with usage's exit(-1) — `vrf help`, two or more names // — and 1 for an Invalid VRF, ipvrf_show's NAME branch with a zero table. +// tunnel and tuntap exit 255 for what iptunnel.c, ip6tunnel.c and +// iptuntap.c end with exit(-1), and 1 for a show that returns -1. func exitCodeOf(err error) int { switch { case errors.Is(err, ErrFlushIncomplete), errors.Is(err, ErrDumpFile), errors.Is(err, ErrRuleDumpTerminated), @@ -172,7 +180,8 @@ func exitCodeOf(err error) int { errors.Is(err, ErrMptcpUsage), errors.Is(err, ErrMptcpSubscribe), errors.Is(err, ErrFouUsage), errors.Is(err, ErrFouDumpTerminated), errors.Is(err, ErrIlaUsage), errors.Is(err, ErrIlaDumpTerminated), errors.Is(err, ErrL2tpUsage), errors.Is(err, ErrMacsecUsage), errors.Is(err, ErrXfrmUsage), - errors.Is(err, ErrVrfUsage), errors.Is(err, ErrMaddrUsage), errors.Is(err, ErrStatsUsage): + errors.Is(err, ErrVrfUsage), errors.Is(err, ErrMaddrUsage), errors.Is(err, ErrStatsUsage), + errors.Is(err, ErrTunnelUsage): return ExitMinusOne case errors.Is(err, ErrStatsInval): return ExitEINVAL @@ -197,7 +206,7 @@ func exitCodeOf(err error) int { errors.Is(err, ErrMptcpReply), errors.Is(err, ErrFouRefused), errors.Is(err, ErrIlaShowArgs), errors.Is(err, ErrL2tpDumpTerminated), errors.Is(err, ErrMacsecRefused), errors.Is(err, ErrMacsecDumpTerminated), errors.Is(err, ErrXfrmRefused), - errors.Is(err, ErrXfrmDumpTerminated), errors.Is(err, ErrVrfInvalid): + errors.Is(err, ErrXfrmDumpTerminated), errors.Is(err, ErrVrfInvalid), errors.Is(err, ErrTunnelRefused): return ExitUsage } return ExitFailure @@ -227,6 +236,22 @@ func openSource() (Source, func() error, error) { return s, s.Close, nil } +// openSys picks what tunnel and tuntap ask outside netlink: the snapshot +// GOIP_TNLSYS names (a tnlsnap sidecar, internal/tnlsys), an empty one +// under GOIP_REPLAY, so a replay never asks the host's kernel and a +// question its capture did not record fails as a replay error, or the +// live kernel. Like GOIP_REPLAY it is an environment variable so goip's +// argv stays ip's. +func openSys() (tnlsys.Sys, error) { + if p := os.Getenv("GOIP_TNLSYS"); p != "" { + return tnlsys.Load(p) + } + if _, ok := replayPathFromEnv(); ok { + return &tnlsys.Snapshot{}, nil + } + return tnlsys.Live{}, nil +} + // missLoopCount is utils.c's missarg for `-loops` with no count, which exits // -1, so the status is 255. func missLoopCount(stderr io.Writer) int { diff --git a/internal/goip/imports_test.go b/internal/goip/imports_test.go index 8040c565e..5bb04d42b 100644 --- a/internal/goip/imports_test.go +++ b/internal/goip/imports_test.go @@ -46,6 +46,8 @@ var goipMayImport = map[string]string{ "pkg/nlparity as the answer. The plan's import set listed only xtcpnl; this is the one addition, and it " + "satisfies the same §16 property.", modulePath + "/internal/jsonw": "jsonw_puts, the one string escaper json_writer.c's ports share with gordma; stdlib only", + modulePath + "/internal/tnlsys": "the tunnel and tuntap sidecar (8S): the SIOCGET* ioctls, the tun sysfs props and " + + "the /dev/net/tun /proc walk, live or from a tnlsnap snapshot. It imports only pkg/cint and x/sys/unix.", "github.com/cilium/ebpf": "`encap bpf` and seg6local `endpoint` load an object's program as ip's libbpf does " + "(bpf_load.go): the ELF and BTF parse, relocations and BPF_PROG_LOAD. Pure Go, so `go build ./cmd/goip` " + "still links outside nix.", @@ -173,6 +175,7 @@ func TestGoipImportSetIsHermetic(t *testing.T) { modulePath + "/pkg/cint": "the C int conversions; stdlib only", modulePath + "/pkg/strpolicy": "reached through pkg/xtcpnl's congestion-name decoder; stdlib only", modulePath + "/internal/jsonw": "jsonw_puts, shared with gordma; stdlib only", + modulePath + "/internal/tnlsys": "the tunnel and tuntap sidecar; pkg/cint and x/sys/unix only", modulePath + "/gen/go/xtcp_flat_record": "reached through pkg/xtcpnl's inet_diag decoders, which " + "write into the generated proto. This is where grpc and protobuf enter the closure.", } diff --git a/internal/goip/keywords.go b/internal/goip/keywords.go index fe9c62923..80fa98be2 100644 --- a/internal/goip/keywords.go +++ b/internal/goip/keywords.go @@ -29,3 +29,25 @@ const ( kindVxcanCst = "vxcan" kindNetkitCst = "netkit" ) + +// Keywords the tunnel read path (obj_tunnel.go, obj_tunnel6.go) shares +// with the link kinds' write parsers. +const ( + kindKeyTTL = "ttl" + kindKeyHoplimit = "hoplimit" + tnlKeyKey = "key" + tnlKeyIkey = "ikey" + tnlKeyOkey = "okey" + tnlKeyHlim = "hlim" + kindKeyRemote = "remote" + gre6Flowlabel = "flowlabel" + gre6Dscp = "dscp" + kindVti6Cst = "vti6" + kindIP6GreCst = "ip6gre" + lwtKeyCsum = "csum" +) + +// groupKeywordCst is the `group` keyword, which vxlan and nexthop share +// with `ip stats show`'s first level (ipstatsLevels) and ip tuntap's +// group property. +const groupKeywordCst = "group" diff --git a/internal/goip/link_gre6_args.go b/internal/goip/link_gre6_args.go index 9e3104ed6..eb0591020 100644 --- a/internal/goip/link_gre6_args.go +++ b/internal/goip/link_gre6_args.go @@ -25,7 +25,6 @@ import ( // multicast check. const ( - kindIP6GreCst = "ip6gre" kindIP6GretapCst = "ip6gretap" kindIP6ErspanCst = "ip6erspan" ) @@ -35,8 +34,6 @@ const ( var gre6Kinds = []string{kindIP6GreCst, kindIP6GretapCst, kindIP6ErspanCst} const ( - gre6Flowlabel = "flowlabel" - gre6Dscp = "dscp" gre6AllowLR = "allow-localremote" gre6NoAllowLR = "noallow-localremote" gre6Encaplimit = "encaplimit" diff --git a/internal/goip/link_kind_args.go b/internal/goip/link_kind_args.go index 84973920a..f86dffe22 100644 --- a/internal/goip/link_kind_args.go +++ b/internal/goip/link_kind_args.go @@ -18,9 +18,6 @@ import ( // The keywords, and the names check_duparg gives them. const ( kindKeyID = "id" - kindKeyRemote = "remote" - kindKeyTTL = "ttl" - kindKeyHoplimit = "hoplimit" kindKeyDsfield = "dsfield" kindKeyDF = "df" kindKeyLabel = "label" diff --git a/internal/goip/link_tunnel_args.go b/internal/goip/link_tunnel_args.go index 511372267..d0f56b7b9 100644 --- a/internal/goip/link_tunnel_args.go +++ b/internal/goip/link_tunnel_args.go @@ -3,13 +3,11 @@ package goip import ( - "encoding/binary" "errors" "fmt" "io" "net/netip" "slices" - "strings" "golang.org/x/sys/unix" @@ -51,14 +49,10 @@ type kindEnv struct { // The tunnel words several parsers spell the same way. const ( - tnlKeyKey = "key" - tnlKeyIkey = "ikey" - tnlKeyOkey = "okey" tnlKeyEncap = "encap" tnlKeyFwmark = "fwmark" tnlKeyIgnoreDF = "ignore-df" tnlKeyLocal = addrLocalKeywordCst - tnlKeyHlim = "hlim" tnlKeyTClass = "tclass" ) @@ -142,27 +136,6 @@ func tunnelUsageErr(line string) error { return fmt.Errorf("%w: %s", ErrInvalidArgument, line) } -// tnlParseKey is tnl_parse_key (ip/tunnel.c:164-178): a value with a '.' is -// get_addr32's address, read big-endian, whose failure is exit(1); -// anything else is get_unsigned base 0, whose failure is exit(-1) naming -// the keyword. -func tnlParseKey(name, v string) (uint64, error) { - if strings.IndexByte(v, '.') >= 0 { - a, ok := getAddrIPv4Parts(v) - if !ok { - return 0, fmt.Errorf("%w: Error: an IP address is expected rather than %q", ErrInvalidArgument, v) - } - b := a.As4() - return uint64(binary.BigEndian.Uint32(b[:])), nil - } - n, ok := getU32(v, 0) - if !ok { - return 0, linkUsage(fmt.Errorf("%w: invalid value for %q: %q; it should be an unsigned integer", - ErrInvalidArgument, name, v)) - } - return uint64(n), nil -} - // tunnelU8 is get_u8 base 0, whose failure is invarg with text. func tunnelU8(v, text string) (uint64, error) { n, ok := getU8(v, 0) diff --git a/internal/goip/link_vti_args.go b/internal/goip/link_vti_args.go index caa4e5c2e..6bb0f2731 100644 --- a/internal/goip/link_vti_args.go +++ b/internal/goip/link_vti_args.go @@ -20,8 +20,7 @@ import ( // family, and there is no after-loop check. const ( - kindVtiCst = "vti" - kindVti6Cst = "vti6" + kindVtiCst = "vti" ) // vtiKinds are the kinds the vti prefetch reads. diff --git a/internal/goip/link_vxlan_args.go b/internal/goip/link_vxlan_args.go index 0484f62ac..dbfb3e6c6 100644 --- a/internal/goip/link_vxlan_args.go +++ b/internal/goip/link_vxlan_args.go @@ -384,7 +384,3 @@ func (p *vxlanParse) finish(errOut io.Writer, set bool) error { func vxlanErr(msg string) error { return kindOptErr(kindVxlanCst, msg) } - -// groupKeywordCst is the `group` keyword, which vxlan and nexthop share -// with `ip stats show`'s first level (ipstatsLevels). -const groupKeywordCst = "group" diff --git a/internal/goip/lwt_encap_args.go b/internal/goip/lwt_encap_args.go index 88a890a53..03c0f98e1 100644 --- a/internal/goip/lwt_encap_args.go +++ b/internal/goip/lwt_encap_args.go @@ -35,7 +35,6 @@ const ( lwtKeyVxlan = "vxlan_opts" lwtKeyErspan = "erspan_opts" lwtKeyOpts = "opts" // duparg2's name for a second option word - lwtKeyCsum = "csum" ) // lwtTunnelFlagWords are parse_encap_ip's flag words and their TUNNEL_* bits. diff --git a/internal/goip/lwt_encap_bpf_args.go b/internal/goip/lwt_encap_bpf_args.go index 93d798486..6890fa0cd 100644 --- a/internal/goip/lwt_encap_bpf_args.go +++ b/internal/goip/lwt_encap_bpf_args.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "path" - "strings" "github.com/cilium/ebpf" "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" @@ -68,16 +67,6 @@ func bpfFailed(lines string, errno unix.Errno) error { return linkUsage(fmt.Errorf("%w: %s%s%s", ErrBpfLoad, lines, bpfFailedPrefixCst, cStrerror(errno))) } -// cStrerror is glibc's strerror for the errnos the loader reports: Go's -// texts are glibc's with the first letter lowered. -func cStrerror(e unix.Errno) string { - s := e.Error() - if s == "" { - return s - } - return strings.ToUpper(s[:1]) + s[1:] -} - // bpfProgArgs is bpf_do_parse from the mode word at args[i] for an lwt // type, then the load (bpf_load_common): it returns the program and the // index of the last word it used (PREV_ARG). The mode is `obj` or a prefix diff --git a/internal/goip/obj_tunnel.go b/internal/goip/obj_tunnel.go new file mode 100644 index 000000000..6d66cf060 --- /dev/null +++ b/internal/goip/obj_tunnel.go @@ -0,0 +1,778 @@ +package goip + +import ( + "encoding/binary" + "errors" + "fmt" + "io" + "net/netip" + "strings" + + "github.com/randomizedcoder/xtcp2/internal/goip/render" + "github.com/randomizedcoder/xtcp2/internal/goip/service" + "github.com/randomizedcoder/xtcp2/internal/tnlsys" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// `ip tunnel` is do_iptunnel (ip/iptunnel.c, iproute2 v7.2.0), and `ip -6 +// tunnel` do_ip6tunnel (ip/ip6tunnel.c), over ip/tunnel.c: +// +// - a pre-scan of the arguments: a "mode" whose word is an IPv6 mode +// switches to do_ip6tunnel, whatever -4 said (T10); +// - the verb by prefix; no verb is show; +// - show: parse_args, then either one SIOCGETTUNNEL on the named or +// fallback device, printed as text even under -j (no new_json_obj), or +// do_tunnels_list: a link dump of the family, one SIOCGETTUNNEL per +// tunnel of the family's ARPHRDs, the match against the arguments and +// print_tunnel, each followed by a bare newline, under -j too. +// +// The ioctls go through c.sys (internal/tnlsys): the kernel live, or the +// row's recorded sidecar under replay. The writes, add, change, delete, +// prl and 6rd, are ioctls goip does not make. + +var ( + // ErrTunnelUsage is a refusal iptunnel.c, ip6tunnel.c or iptuntap.c + // ends with exit(-1), 255: usage, an unknown command or mode, invarg, + // duparg2 and incomplete_command. + ErrTunnelUsage = errors.New(objTunnelCst) + // ErrTunnelRefused is a show that returns -1, exit 1: a refused + // named ioctl, keys with ipip or sit, a broadcast tunnel with no + // source, and a dump it cannot finish ("Dump terminated"). + ErrTunnelRefused = errors.New("tunnel refused") +) + +const ( + tnlModeCst = "mode" + tnlNameCst = "name" + tnlHelpCst = "help" + // tnlInheritCst is the word ttl, tos, tclass, flowlabel and dscp take. + tnlInheritCst = "inherit" + tnlTclassCst = "tclass" + tnlDsfieldCst = "dsfield" + + // The IPv6 mode words both parse_args and the pre-scan read. + tnlModeIP6IP6Cst = "ip6ip6" + tnlModeIPv6v6Cst = "ipv6/ipv6" + tnlModeIP4IP6Cst = "ip4ip6" + tnlModeIPIP6wCst = "ipip6" + tnlModeIPv4v6Cst = "ipv4/ipv6" + tnlModeGREv6Cst = "gre/ipv6" + tnlModeIPIP6Cst = "ip/ipv6" + tnlModeAnyV6Cst = "any/ipv6" + + // The one-sided seq and csum words. + tnlISeqCst = "iseq" + tnlOSeqCst = "oseq" + tnlICsumCst = "icsum" + tnlOCsumCst = "ocsum" + + tunnelUsageCst = "Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]\n" + + " [ mode { gre | ipip | isatap | sit | vti } ]\n" + + " [ remote ADDR ] [ local ADDR ]\n" + + " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" + + " [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n" + + " [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n" + + " [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n" + + "\n" + + "Where: NAME := STRING\n" + + " ADDR := { IP_ADDRESS | any }\n" + + " TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff }\n" + + " TTL := { 1..255 | inherit }\n" + + " KEY := { DOTTED_QUAD | NUMBER }" + + ip6TunnelUsageCst = "Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]\n" + + " [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ]\n" + + " [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n" + + " [ encaplimit ELIM ]\n" + + " [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n" + + " [ dscp inherit ]\n" + + " [ [no]allow-localremote ]\n" + + " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" + + "\n" + + "Where: NAME := STRING\n" + + " ADDR := IPV6_ADDRESS\n" + + " ELIM := { none | 0..255 }(default=4)\n" + + " TTL := 0..255 (default=64)\n" + + " TCLASS := { 0x0..0xff | inherit }\n" + + " FLOWLABEL := { 0x0..0xfffff | inherit }\n" + + " KEY := { DOTTED_QUAD | NUMBER }" +) + +// The protocols a tunnel struct carries. +const ( + tnlProtoIPIP uint8 = unix.IPPROTO_IPIP + tnlProtoGRE uint8 = unix.IPPROTO_GRE + tnlProtoIPv6 uint8 = unix.IPPROTO_IPV6 +) + +// ipDFCst is IP_DF, frag_off's don't-fragment bit, host order. +const ipDFCst = 0x4000 + +// tnlMulticast is IN_MULTICAST(ntohl(a)). +func tnlMulticast(a netip.Addr) bool { + return a.Is4() && a.As4()[0]&0xf0 == 0xe0 +} + +// tnlUsage wraps a refusal as ErrTunnelUsage's exit(-1). +func tnlUsage(err error) error { + return fmt.Errorf("%w: %w", ErrTunnelUsage, err) +} + +// tnlUsageMsg is ErrTunnelUsage with ip's line, which may end in a period. +func tnlUsageMsg(line string) error { + return fmt.Errorf("%w: %s", ErrTunnelUsage, line) +} + +// tnlNext is NEXT_ARG, whose incomplete_command exits -1. +func tnlNext(args []string, i int) (int, error) { + j, err := nextArg(args, i) + if err != nil { + return i, tnlUsage(err) + } + return j, nil +} + +// tnlSL is _SL_: a backslash under -o, else a newline. +func tnlSL(c *runCtx) string { + if c.oneline { + return "\\" + } + return "\n" +} + +// tunnelModeIsIPv6 is tunnel_mode_is_ipv6. +func tunnelModeIsIPv6(mode string) bool { + switch mode { + case tnlModeIPv6v6Cst, tnlModeIP6IP6Cst, kindVti6Cst, tnlModeIPIP6Cst, tnlModeIPv4v6Cst, tnlModeIPIP6wCst, tnlModeIP4IP6Cst, kindIP6GreCst, + tnlModeGREv6Cst, tnlModeAnyV6Cst, addrNameAnyCst: + return true + } + return false +} + +// runTunnel is do_iptunnel. +func runTunnel(c *runCtx, args []string) error { + fam := c.family + for i := 0; i < len(args)-1; i++ { + if args[i] == tnlModeCst { + if tunnelModeIsIPv6(args[i+1]) { + fam = unix.AF_INET6 + } + break + } + } + switch fam { + case unix.AF_UNSPEC, unix.AF_INET: + case unix.AF_INET6: + return runIP6Tunnel(c, args) + default: + return fmt.Errorf("%w: Unsupported protocol family: %d", ErrTunnelUsage, fam) + } + if len(args) == 0 { + return tunnelShowV4(c, nil) + } + verb, rest := args[0], args[1:] + switch { + case matchesPrefix(verb, addrVerbAddCst), matchesPrefix(verb, addrVerbChangeCst), + matchesPrefix(verb, addrVerbDeleteCst): + return fmt.Errorf("tunnel %q: an ioctl write: %w", verb, ErrNotImplemented) + case matchesPrefix(verb, showVerbCst), matchesPrefix(verb, lstVerbCst), matchesPrefix(verb, listVerbCst): + return tunnelShowV4(c, rest) + case matchesPrefix(verb, "prl"), matchesPrefix(verb, "6rd"): + return fmt.Errorf("tunnel %q: an ioctl write: %w", verb, ErrNotImplemented) + case matchesPrefix(verb, tnlHelpCst): + return fmt.Errorf("%w: %s", ErrTunnelUsage, tunnelUsageCst) + } + return fmt.Errorf("%w: Command %q is unknown, try \"ip tunnel help\"", ErrTunnelUsage, verb) +} + +// runIP6Tunnel is do_ip6tunnel, reached through do_iptunnel. +func runIP6Tunnel(c *runCtx, args []string) error { + if len(args) == 0 { + return tunnelShowV6(c, nil) + } + verb, rest := args[0], args[1:] + switch { + case matchesPrefix(verb, addrVerbAddCst), matchesPrefix(verb, addrVerbChangeCst), + matchesPrefix(verb, addrVerbDeleteCst): + return fmt.Errorf("tunnel %q: an ioctl write: %w", verb, ErrNotImplemented) + case matchesPrefix(verb, showVerbCst), matchesPrefix(verb, lstVerbCst), matchesPrefix(verb, listVerbCst): + return tunnelShowV6(c, rest) + case matchesPrefix(verb, tnlHelpCst): + return fmt.Errorf("%w: %s", ErrTunnelUsage, ip6TunnelUsageCst) + } + return tnlUsageMsg(fmt.Sprintf("Command %q is unknown, try \"ip -f inet6 tunnel help\".", verb)) +} + +// tnlParseKey is tnl_parse_key (ip/tunnel.c:164-178): a value with a '.' is +// get_addr32's address, read big-endian, whose failure is exit(1); +// anything else is get_unsigned base 0, whose failure is exit(-1) naming +// the keyword. +func tnlParseKey(name, v string) (uint64, error) { + if strings.IndexByte(v, '.') >= 0 { + a, ok := getAddrIPv4Parts(v) + if !ok { + return 0, fmt.Errorf("%w: Error: an IP address is expected rather than %q", ErrInvalidArgument, v) + } + b := a.As4() + return uint64(binary.BigEndian.Uint32(b[:])), nil + } + n, ok := getU32(v, 0) + if !ok { + return 0, linkUsage(fmt.Errorf("%w: invalid value for %q: %q; it should be an unsigned integer", + ErrInvalidArgument, name, v)) + } + return uint64(n), nil +} + +// tnlParseName is parse_args' last arm: name takes the next word, a +// prefix of help is usage, then duparg2 and get_ifname. +func tnlParseName(args []string, i int, have, usage string) (string, int, error) { + var err error + if args[i] == tnlNameCst { + if i, err = tnlNext(args, i); err != nil { + return "", i, err + } + } else if matchesPrefix(args[i], tnlHelpCst) { + return "", i, fmt.Errorf("%w: %s", ErrTunnelUsage, usage) + } + if have != "" { + return "", i, tnlUsage(duparg2Err(tnlNameCst, args[i])) + } + if !checkIfname(args[i]) { + return "", i, tnlUsage(invargErr("\"name\" not a valid ifname", args[i])) + } + return args[i], i, nil +} + +// tnlKeyWord is parse_args' key, ikey and okey: the flags it sets and the +// key, which tnl_parse_key reads. +func tnlKeyWord(args []string, i int, iflags, oflags *uint16, ikey, okey *uint32) (int, error) { + w := args[i] + i, err := tnlNext(args, i) + if err != nil { + return i, err + } + k, err := tnlParseKey(w, args[i]) + if err != nil { + return i, err + } + v := uint32(k) + if w != tnlKeyOkey { + *iflags |= xtcpnl.GreFlagKey + *ikey = v + } + if w != tnlKeyIkey { + *oflags |= xtcpnl.GreFlagKey + *okey = v + } + return i, nil +} + +// tnlFlagWords are parse_args' seq and csum words, which take no value: +// the GRE bit and whether each sets it in i_flags and o_flags. +var tnlFlagWords = map[string]struct { + bit uint16 + in, out bool +}{ + "seq": {xtcpnl.GreFlagSeq, true, true}, + tnlISeqCst: {xtcpnl.GreFlagSeq, true, false}, + tnlOSeqCst: {xtcpnl.GreFlagSeq, false, true}, + lwtKeyCsum: {xtcpnl.GreFlagCsum, true, true}, + tnlICsumCst: {xtcpnl.GreFlagCsum, true, false}, + tnlOCsumCst: {xtcpnl.GreFlagCsum, false, true}, +} + +// tnlFlagWord sets a seq or csum word's bits; false for any other word. +func tnlFlagWord(w string, iflags, oflags *uint16) bool { + f, ok := tnlFlagWords[w] + if !ok { + return false + } + if f.in { + *iflags |= f.bit + } + if f.out { + *oflags |= f.bit + } + return true +} + +// tnlDev resolves parse_args' dev: ll_name_to_index, whose miss is nodev's +// returned -1. A replay has no single-get; its dump fallback's miss is the +// kernel's ENODEV. +func tnlDev(c *runCtx, dev string) (int32, error) { + idx, err := genlNameToIndex(c, dev) + if service.IsLinkNotFound(err) { + idx, err = 0, nil + } + if err != nil { + return 0, err + } + if idx == 0 { + return 0, nodevErr(dev) + } + return idx, nil +} + +// tnlSetProto is set_tunnel_proto. +func tnlSetProto(p *xtcpnl.IPTunnelParm, proto uint8) error { + if p.Protocol != 0 && p.Protocol != proto { + return tnlUsageMsg("You managed to ask for more than one tunnel mode.") + } + p.Protocol = proto + return nil +} + +// tnlModeV4 is parse_args' mode word. +func tnlModeV4(p *xtcpnl.IPTunnelParm, mode string, isatap *bool) error { + switch mode { + case "ipip", "ip/ip": + return tnlSetProto(p, tnlProtoIPIP) + case "gre", "gre/ip": + return tnlSetProto(p, tnlProtoGRE) + case "sit", "ipv6/ip": + return tnlSetProto(p, tnlProtoIPv6) + case "isatap": + *isatap = true + return tnlSetProto(p, tnlProtoIPv6) + case "vti": + if err := tnlSetProto(p, tnlProtoIPIP); err != nil { + return err + } + p.IFlags |= xtcpnl.VtiIsVti + return nil + } + return fmt.Errorf("%w: Unknown tunnel mode %q", ErrTunnelUsage, mode) +} + +// tnlAddr32 is get_addr32, whose failure is exit(1). +func tnlAddr32(v string) (netip.Addr, error) { + a, ok := getAddr1(v, unix.AF_INET) + if !ok { + return netip.Addr{}, fmt.Errorf("%w: Error: an IP address is expected rather than \"%s\"", ErrInvalidArgument, v) + } + var b [4]byte + copy(b[:], a.data) + return netip.AddrFrom4(b), nil +} + +// tnlTOS is parse_args' tos value: strsep at the first '/' cuts the word; +// "inherit" sets bit 0 and reads what followed the slash, anything else +// reads the cut word and drops what followed. +func tnlTOS(arg string) (uint8, error) { + head, tail, slash := arg, "", false + for i := 0; i < len(arg); i++ { + if arg[i] == '/' { + head, tail, slash = arg[:i], arg[i+1:], true + break + } + } + var tos uint8 + ds, have := head, true + if head == tnlInheritCst { + tos, ds, have = 1, tail, slash + } + if have { + v, ok := rtnlDsfieldA2N(ds) + if !ok { + return 0, tnlUsage(invargErr("bad TOS value", head)) + } + tos |= v + } + return tos, nil +} + +// tnlV4TakesValue is whether iptunnel.c parse_args' word w takes NEXT_ARG. +func tnlV4TakesValue(w string) bool { + switch w { + case tnlModeCst, kindKeyRemote, addrLocalKeywordCst, devKeywordCst, kindKeyTTL, kindKeyHoplimit, tnlKeyHlim, + tosKeywordCst, tnlTclassCst: + return true + } + return matchesPrefix(w, tnlDsfieldCst) +} + +// tnlV4Value is parse_args' arms that take a value, past NEXT_ARG: dev's +// device is returned for after the loop. +func tnlV4Value(p *xtcpnl.IPTunnelParm, w, v string, isatap *bool) (medium string, err error) { + switch w { + case tnlModeCst: + return "", tnlModeV4(p, v, isatap) + case kindKeyRemote: + p.Daddr, err = tnlAddr32(v) + case addrLocalKeywordCst: + p.Saddr, err = tnlAddr32(v) + case devKeywordCst: + return v, nil + case kindKeyTTL, kindKeyHoplimit, tnlKeyHlim: + if v != tnlInheritCst { + u, ok := getU8(v, 0) + if !ok { + return "", tnlUsage(invargErr("invalid TTL\n", v)) + } + p.TTL = u + } + default: // tos, tclass and a prefix of dsfield + p.TOS, err = tnlTOS(v) + } + return "", err +} + +// parseTunnelV4 is iptunnel.c parse_args for SIOCGETTUNNEL. +func parseTunnelV4(c *runCtx, args []string) (xtcpnl.IPTunnelParm, error) { + p := xtcpnl.IPTunnelParm{VersionIHL: 0x45, FragOff: ipDFCst} + var medium string + var isatap bool + var err error + for i := 0; i < len(args); i++ { + w := args[i] + switch { + case w == tnlKeyKey || w == tnlKeyIkey || w == tnlKeyOkey: + if i, err = tnlKeyWord(args, i, &p.IFlags, &p.OFlags, &p.IKey, &p.OKey); err != nil { + return p, err + } + case tnlFlagWord(w, &p.IFlags, &p.OFlags): + case w == "nopmtudisc": + p.FragOff = 0 + case w == "pmtudisc": + p.FragOff = ipDFCst + case tnlV4TakesValue(w): + if i, err = tnlNext(args, i); err != nil { + return p, err + } + m, err := tnlV4Value(&p, w, args[i], &isatap) + if err != nil { + return p, err + } + if m != "" { + medium = m + } + default: + if p.Name, i, err = tnlParseName(args, i, p.Name, tunnelUsageCst); err != nil { + return p, err + } + } + } + return p, tnlParseV4Tail(c, &p, medium, isatap) +} + +// tnlParseV4Tail is parse_args after its loop: the protocol a name prefix +// implies, the key check, dev, a multicast remote's keys, and isatap. +func tnlParseV4Tail(c *runCtx, p *xtcpnl.IPTunnelParm, medium string, isatap bool) error { + if p.Protocol == 0 { + n := p.Name + switch { + case hasPrefix(n, "gre"): + p.Protocol = tnlProtoGRE + case hasPrefix(n, "ipip"): + p.Protocol = tnlProtoIPIP + case hasPrefix(n, "sit"): + p.Protocol = tnlProtoIPv6 + case hasPrefix(n, "isatap"): + p.Protocol = tnlProtoIPv6 + isatap = true + case hasPrefix(n, "vti"): + p.Protocol = tnlProtoIPIP + p.IFlags |= xtcpnl.VtiIsVti + } + } + if (p.IFlags|p.OFlags)&xtcpnl.GreFlagKey != 0 && p.IFlags&xtcpnl.VtiIsVti == 0 && p.Protocol != tnlProtoGRE { + return fmt.Errorf("%w: Keys are not allowed with ipip and sit tunnels", ErrTunnelRefused) + } + if medium != "" { + idx, err := tnlDev(c, medium) + if err != nil { + return err + } + p.Link = idx + } + if tnlMulticast(p.Daddr) { + d := p.Daddr.As4() + k := binary.BigEndian.Uint32(d[:]) + if p.IKey == 0 { + p.IKey = k + p.IFlags |= xtcpnl.GreFlagKey + } + if p.OKey == 0 { + p.OKey = k + p.OFlags |= xtcpnl.GreFlagKey + } + if !p.Saddr.IsValid() || p.Saddr.IsUnspecified() { + return fmt.Errorf("%w: A broadcast tunnel requires a source address", ErrTunnelRefused) + } + } + if isatap { + p.IFlags |= xtcpnl.SitIsatap + } + return nil +} + +// hasPrefix is memcmp(name, prefix, len(prefix)) == 0 over a zeroed +// name[IFNAMSIZ]. +func hasPrefix(name, prefix string) bool { + return len(name) >= len(prefix) && name[:len(prefix)] == prefix +} + +// tnlDefname is tnl_defname: the fallback device of the protocol, or "" +// for the list. +func tnlDefname(p *xtcpnl.IPTunnelParm) string { + switch p.Protocol { + case tnlProtoIPIP: + if p.IFlags&xtcpnl.VtiIsVti != 0 { + return "ip_vti0" + } + return "tunl0" + case tnlProtoGRE: + return "gre0" + case tnlProtoIPv6: + return "sit0" + } + return "" +} + +// tnlIoctl makes one ioctl through c.sys. ok is false for a refusal, after +// msg's line for a kernel errno (msg returns "" to stay silent) or +// tnl_*_ioctl's socket line; err is a source error, a replay gap. +func tnlIoctl(c *runCtx, family int, req uint32, name string, arg []byte, + msg func(unix.Errno) string) (bool, error) { + _, err := c.sys.Ioctl(family, req, name, arg) + if err == nil { + return true, nil + } + var se *tnlsys.SocketError + if errors.As(err, &se) { + var e unix.Errno + if errors.As(se.Err, &e) { + _, werr := fmt.Fprintf(c.errOut, "create socket failed: %s\n", cStrerror(e)) + return false, werr + } + return false, err + } + var e unix.Errno + if !errors.As(err, &e) { + return false, err + } + if s := msg(e); s != "" { + if _, werr := io.WriteString(c.errOut, s); werr != nil { + return false, werr + } + } + return false, nil +} + +// tnlGetMsg is tnl_get_ioctl's refusal line. +func tnlGetMsg(name string) func(unix.Errno) string { + return func(e unix.Errno) string { + return fmt.Sprintf("get tunnel \"%s\" failed: %s\n", name, cStrerror(e)) + } +} + +// tnlNoSkip is tnl_prl_ioctl's skiperr, -1: no errno is silent. +const tnlNoSkip unix.Errno = 0 + +// tnlGenMsg is tnl_gen_ioctl's refusal line, silent for skip. +func tnlGenMsg(name string, req uint32, skip unix.Errno) func(unix.Errno) string { + return func(e unix.Errno) string { + if e == skip { + return "" + } + return fmt.Sprintf("%s: ioctl %x failed: %s\n", name, req, cStrerror(e)) + } +} + +// tnlIndexName is ll_index_to_name for a tunnel's link. +func tnlIndexName(c *runCtx, link int32) string { + if link == 0 { + return "" + } + return genlIndexToName(c, link) +} + +// tunnelViewV4 asks what print_tunnel asks of one v4 tunnel: the routers +// of an isatap tunnel, the link's name, a sit tunnel's 6rd prefix. +func tunnelViewV4(c *runCtx, p xtcpnl.IPTunnelParm) (*render.TunnelV4, error) { + t := &render.TunnelV4{Parm: p} + if p.Protocol == tnlProtoIPv6 && p.IFlags&xtcpnl.SitIsatap != 0 { + buf := xtcpnl.TunnelPRLRequest(16) + ok, err := tnlIoctl(c, unix.AF_INET, tnlsys.SIOCGETPRL, p.Name, buf, tnlGenMsg(p.Name, tnlsys.SIOCGETPRL, tnlNoSkip)) + if err != nil { + return nil, err + } + if ok { + if t.PRL, err = xtcpnl.ParseTunnelPRL(buf); err != nil { + return nil, err + } + } + } + t.Dev = tnlIndexName(c, p.Link) + if p.Protocol == tnlProtoIPv6 { + buf := make([]byte, xtcpnl.Tunnel6RDSize) + ok, err := tnlIoctl(c, unix.AF_INET, tnlsys.SIOCGET6RD, p.Name, buf, + tnlGenMsg(p.Name, tnlsys.SIOCGET6RD, unix.EINVAL)) + if err != nil { + return nil, err + } + if ok { + r, err := xtcpnl.ParseTunnel6RD(buf) + if err != nil { + return nil, err + } + t.SixRD = &r + } + } + return t, nil +} + +// tunnelShowV4 is iptunnel.c do_show. +func tunnelShowV4(c *runCtx, args []string) error { + p, err := parseTunnelV4(c, args) + if err != nil { + return err + } + basedev := tnlDefname(&p) + if basedev == "" { + return tunnelsList(c, unix.AF_INET, p.Name, func(pr *render.Printer, li *xtcpnl.LinkInfo) (bool, error) { + return tunnelListV4(c, pr, &p, li) + }) + } + name := p.Name + if name == "" { + name = basedev + } + buf := p.Marshal() + ok, err := tnlIoctl(c, unix.AF_INET, tnlsys.SIOCGETTUNNEL, name, buf, tnlGetMsg(name)) + if err != nil { + return err + } + if !ok { + return ErrTunnelRefused + } + q, err := xtcpnl.ParseIPTunnelParm(buf) + if err != nil { + return err + } + t, err := tunnelViewV4(c, q) + if err != nil { + return err + } + // No new_json_obj on this path: print_tunnel's JSON calls find no + // writer and print text, under -j too. + pr := render.NewPrinter(false) + render.PrintTunnelV4(pr, t, &render.Dsfield{}, tnlSL(c)) + pr.Raw("\n") + _, err = c.out.Write(pr.Bytes()) + return err +} + +// tunnelListV4 is print_nlmsg_tunnel's per-tunnel part for v4: the zeroed +// parm, its ioctl, ip_tunnel_parm_match and print_tunnel. +func tunnelListV4(c *runCtx, pr *render.Printer, p1 *xtcpnl.IPTunnelParm, li *xtcpnl.LinkInfo) (bool, error) { + buf := make([]byte, xtcpnl.IPTunnelParmSize) + ok, err := tnlIoctl(c, unix.AF_INET, tnlsys.SIOCGETTUNNEL, li.Name, buf, tnlGetMsg(li.Name)) + if err != nil || !ok { + return false, err + } + p2, err := xtcpnl.ParseIPTunnelParm(buf) + if err != nil { + return false, err + } + if !tnlMatchV4(p1, &p2) { + return false, nil + } + t, err := tunnelViewV4(c, p2) + if err != nil { + return false, err + } + render.PrintTunnelV4(pr, t, &render.Dsfield{}, tnlSL(c)) + return true, nil +} + +// addrSet is an address the match tests: one that is not zero. +func addrSet(a netip.Addr) bool { + return a.IsValid() && !a.IsUnspecified() +} + +// tnlMatchV4 is ip_tunnel_parm_match. +func tnlMatchV4(p1, p2 *xtcpnl.IPTunnelParm) bool { + return (p1.Link == 0 || p1.Link == p2.Link) && + (p1.Name == "" || p1.Name == p2.Name) && + (!addrSet(p1.Daddr) || p1.Daddr == p2.Daddr) && + (!addrSet(p1.Saddr) || p1.Saddr == p2.Saddr) && + (p1.IKey == 0 || p1.IKey == p2.IKey) +} + +// tnlArphrdOK is print_nlmsg_tunnel's ARPHRD filter for the family. +func tnlArphrdOK(family int, t uint16) bool { + if family == unix.AF_INET { + return t == unix.ARPHRD_TUNNEL || t == unix.ARPHRD_IPGRE || t == unix.ARPHRD_SIT + } + return t == unix.ARPHRD_TUNNEL6 || t == unix.ARPHRD_IP6GRE +} + +// tunnelsList is do_tunnels_list: the family's link dump, each tunnel of +// the family's ARPHRDs (and p1name, when set) handed to each, which +// prints it or not; then -s's stats block and a bare newline, under -j +// too. A message too short for its ifinfomsg, and a printed tunnel +// with no stats under -s, end the dump: "Dump terminated", rc 1. +func tunnelsList(c *runCtx, family int, p1name string, + each func(*render.Printer, *xtcpnl.LinkInfo) (bool, error)) error { + pr := render.NewPrinter(c.json) + pr.NewObj() + err := tunnelsWalk(c, pr, family, p1name, each) + pr.DeleteObj() + if _, werr := c.out.Write(pr.Bytes()); werr != nil { + return werr + } + return err +} + +// tunnelsWalk is do_tunnels_list's rtnl_dump_filter. +func tunnelsWalk(c *runCtx, pr *render.Printer, family int, p1name string, + each func(*render.Printer, *xtcpnl.LinkInfo) (bool, error)) error { + fam, ok := tnlFamily(family) + if !ok { + return fmt.Errorf("%w: family %d", ErrTunnelUsage, family) + } + bodies, err := c.src.Dump(xtcpnl.BuildDumpLinkRequestFamily(fam, c.nextSeq()), unix.RTM_NEWLINK) + if err != nil { + return fmt.Errorf("%w: Dump terminated: %w", ErrTunnelRefused, err) + } + sl := tnlSL(c) + for _, body := range bodies { + li, err := xtcpnl.ParseNewLink(body) + if err != nil { + return fmt.Errorf("%w: Dump terminated: %w", ErrTunnelRefused, err) + } + if !tnlArphrdOK(family, li.Type) || li.Name == "" || (p1name != "" && p1name != li.Name) { + continue + } + printed, err := each(pr, &li) + if err != nil { + return err + } + if !printed { + continue + } + if c.showStats > 0 { + if li.Stats == nil { + return fmt.Errorf("%w: Dump terminated", ErrTunnelRefused) + } + pr.Raw(render.TunnelStats(li.Stats, sl)) + } + pr.Raw("\n") + } + return nil +} + +// tnlFamily is the AF_* as ifi_family. +func tnlFamily(family int) (uint8, bool) { + switch family { + case unix.AF_INET: + return unix.AF_INET, true + case unix.AF_INET6: + return unix.AF_INET6, true + } + return 0, false +} diff --git a/internal/goip/obj_tunnel6.go b/internal/goip/obj_tunnel6.go new file mode 100644 index 000000000..37a23b4f5 --- /dev/null +++ b/internal/goip/obj_tunnel6.go @@ -0,0 +1,252 @@ +package goip + +import ( + "fmt" + "net/netip" + + "github.com/randomizedcoder/xtcp2/internal/goip/render" + "github.com/randomizedcoder/xtcp2/internal/tnlsys" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// `ip -6 tunnel show` is ip/ip6tunnel.c do_show at v7.2.0: parse_args over +// a zeroed ip6_tnl_parm2 of protocol 0 (any), then one SIOCGETTUNNEL on +// the named device, printed with no final newline (T9), or, with no name +// or under -s, do_tunnels_list over the AF_INET6 link dump. + +// The ip6_tnl_parm2 flowinfo masks, host order. +const ( + ip6FlowinfoTclassCst = 0x0FF00000 + ip6FlowinfoFlowlabelCst = 0x000FFFFF +) + +// tnlModeV6 is ip6tunnel.c parse_args' mode word. +func tnlModeV6(p *xtcpnl.IP6TnlParm2, mode string) error { + switch mode { + case tnlModeIPv6v6Cst, tnlModeIP6IP6Cst: + p.Proto = tnlProtoIPv6 + case kindVti6Cst: + p.Proto = tnlProtoIPv6 + p.IFlags |= xtcpnl.VtiIsVti + case tnlModeIPIP6Cst, tnlModeIPv4v6Cst, tnlModeIPIP6wCst, tnlModeIP4IP6Cst: + p.Proto = tnlProtoIPIP + case kindIP6GreCst, tnlModeGREv6Cst: + p.Proto = tnlProtoGRE + case tnlModeAnyV6Cst, addrNameAnyCst: + p.Proto = 0 + default: + return fmt.Errorf("%w: Unknown tunnel mode %q", ErrTunnelUsage, mode) + } + return nil +} + +// tnlAddr6 is get_addr(AF_INET6), whose failure is exit(1): any, all and +// default are all zero. +func tnlAddr6(v string) (netip.Addr, error) { + a, err := routeGetAddr(v, unix.AF_INET6) + if err != nil { + return netip.Addr{}, err + } + var b [16]byte + copy(b[:], a.data) + return netip.AddrFrom16(b), nil +} + +// tnl6Value is parse_args' arms that take a value: false for a word that +// is not one of them. +func tnl6Value(p *xtcpnl.IP6TnlParm2, w, v string) (bool, error) { + switch w { + case kindKeyRemote: + a, err := tnlAddr6(v) + p.Raddr = a + return true, err + case addrLocalKeywordCst: + a, err := tnlAddr6(v) + p.Laddr = a + return true, err + case "encaplimit": + if v == noneKeywordCst { + p.Flags |= xtcpnl.IP6TnlFIgnEncapLimit + return true, nil + } + // get_u8's -1 is never < -1 (T20): a bad value leaves uval + // unset, which the corpus shows as 0. + u, ok := getU8(v, 0) + if !ok { + u = 0 + } + p.EncapLimit = u + p.Flags &^= xtcpnl.IP6TnlFIgnEncapLimit + return true, nil + case kindKeyHoplimit, kindKeyTTL, tnlKeyHlim: + u, ok := getU8(v, 0) + if !ok { + return true, tnlUsage(invargErr("invalid TTL", v)) + } + p.HopLimit = u + return true, nil + case gre6Flowlabel, "fl": + p.FlowInfo &^= ip6FlowinfoFlowlabelCst + if v == tnlInheritCst { + p.Flags |= xtcpnl.IP6TnlFUseOrigFlowlabel + return true, nil + } + u, ok := getU32(v, 16) + if !ok || u > ip6FlowinfoFlowlabelCst { + return true, tnlUsage(invargErr("invalid Flowlabel", v)) + } + p.FlowInfo |= u + p.Flags &^= xtcpnl.IP6TnlFUseOrigFlowlabel + return true, nil + case gre6Dscp: + if v != tnlInheritCst { + return true, tnlUsage(invargErr("not inherit", v)) + } + p.Flags |= xtcpnl.IP6TnlFRcvDSCPCopy + return true, nil + } + if w == tnlTclassCst || w == "tc" || w == tosKeywordCst || matchesPrefix(w, tnlDsfieldCst) { + p.FlowInfo &^= ip6FlowinfoTclassCst + if v == tnlInheritCst { + p.Flags |= xtcpnl.IP6TnlFUseOrigTclass + return true, nil + } + u, ok := getU8(v, 16) + if !ok { + return true, tnlUsage(invargErr("invalid TClass", v)) + } + p.FlowInfo |= uint32(u) << 20 + p.Flags &^= xtcpnl.IP6TnlFUseOrigTclass + return true, nil + } + return false, nil +} + +// tnl6TakesValue is whether parse_args' word w takes NEXT_ARG. +func tnl6TakesValue(w string) bool { + switch w { + case tnlModeCst, kindKeyRemote, addrLocalKeywordCst, devKeywordCst, "encaplimit", kindKeyHoplimit, kindKeyTTL, tnlKeyHlim, gre6Flowlabel, "fl", gre6Dscp, + tnlTclassCst, "tc", tosKeywordCst: + return true + } + return matchesPrefix(w, tnlDsfieldCst) +} + +// parseTunnelV6 is ip6tunnel.c parse_args for SIOCGETTUNNEL over do_show's +// starting struct. +func parseTunnelV6(c *runCtx, args []string) (xtcpnl.IP6TnlParm2, error) { + var p xtcpnl.IP6TnlParm2 + var medium string + var err error + for i := 0; i < len(args); i++ { + w := args[i] + switch { + case w == tnlKeyKey || w == tnlKeyIkey || w == tnlKeyOkey: + if i, err = tnlKeyWord(args, i, &p.IFlags, &p.OFlags, &p.IKey, &p.OKey); err != nil { + return p, err + } + case tnlFlagWord(w, &p.IFlags, &p.OFlags): + case w == "allow-localremote": + p.Flags |= xtcpnl.IP6TnlFAllowLocalRemote + case w == "noallow-localremote": + p.Flags &^= xtcpnl.IP6TnlFAllowLocalRemote + case tnl6TakesValue(w): + if i, err = tnlNext(args, i); err != nil { + return p, err + } + switch w { + case tnlModeCst: + err = tnlModeV6(&p, args[i]) + case devKeywordCst: + medium = args[i] + default: + _, err = tnl6Value(&p, w, args[i]) + } + if err != nil { + return p, err + } + default: + if p.Name, i, err = tnlParseName(args, i, p.Name, ip6TunnelUsageCst); err != nil { + return p, err + } + } + } + if medium != "" { + idx, err := tnlDev(c, medium) + if err != nil { + return p, err + } + p.Link = idx + } + return p, nil +} + +// tunnelShowV6 is ip6tunnel.c do_show. +func tunnelShowV6(c *runCtx, args []string) error { + p, err := parseTunnelV6(c, args) + if err != nil { + return err + } + if p.Name == "" || c.showStats > 0 { + return tunnelsList(c, unix.AF_INET6, p.Name, func(pr *render.Printer, li *xtcpnl.LinkInfo) (bool, error) { + return tunnelListV6(c, pr, &p, li) + }) + } + buf := p.Marshal() + ok, err := tnlIoctl(c, unix.AF_INET6, tnlsys.SIOCGETTUNNEL, p.Name, buf, tnlGetMsg(p.Name)) + if err != nil { + return err + } + if !ok { + return ErrTunnelRefused + } + q, err := xtcpnl.ParseIP6TnlParm2(buf) + if err != nil { + return err + } + // Text under -j too, as on the v4 named path, and no newline (T9). + pr := render.NewPrinter(false) + render.PrintTunnelV6(pr, &render.TunnelV6{Parm: q, Dev: tnlIndexName(c, q.Link)}, tnlSL(c)) + _, err = c.out.Write(pr.Bytes()) + return err +} + +// tunnelListV6 is print_nlmsg_tunnel's per-tunnel part for v6: +// ip6_tnl_parm_initialize (protocol by ARPHRD, the device's index and +// p1's name), the ioctl, ip6_tnl_parm_match and print_tunnel. +func tunnelListV6(c *runCtx, pr *render.Printer, p1 *xtcpnl.IP6TnlParm2, li *xtcpnl.LinkInfo) (bool, error) { + p2 := xtcpnl.IP6TnlParm2{TunnelName: xtcpnl.TunnelName{Name: p1.Name}, Link: li.Index, Proto: tnlProtoIPv6} + if li.Type == unix.ARPHRD_IP6GRE { + p2.Proto = tnlProtoGRE + } + buf := p2.Marshal() + ok, err := tnlIoctl(c, unix.AF_INET6, tnlsys.SIOCGETTUNNEL, li.Name, buf, tnlGetMsg(li.Name)) + if err != nil || !ok { + return false, err + } + q, err := xtcpnl.ParseIP6TnlParm2(buf) + if err != nil { + return false, err + } + if !tnlMatchV6(p1, &q) { + return false, nil + } + render.PrintTunnelV6(pr, &render.TunnelV6{Parm: q, Dev: tnlIndexName(c, q.Link)}, tnlSL(c)) + return true, nil +} + +// tnlMatchV6 is ip6_tnl_parm_match. +func tnlMatchV6(p1, p2 *xtcpnl.IP6TnlParm2) bool { + const tc, fl = ip6FlowinfoTclassCst, ip6FlowinfoFlowlabelCst + return (p1.Link == 0 || p1.Link == p2.Link) && + (p1.Name == "" || p1.Name == p2.Name) && + (!addrSet(p1.Laddr) || p1.Laddr == p2.Laddr) && + (!addrSet(p1.Raddr) || p1.Raddr == p2.Raddr) && + (p1.Proto == 0 || p2.Proto == 0 || p1.Proto == p2.Proto) && + (p1.EncapLimit == 0 || p1.EncapLimit == p2.EncapLimit) && + (p1.HopLimit == 0 || p1.HopLimit == p2.HopLimit) && + (p1.FlowInfo&tc == 0 || (p1.FlowInfo^p2.FlowInfo)&tc == 0) && + (p1.FlowInfo&fl == 0 || (p1.FlowInfo^p2.FlowInfo)&fl == 0) && + (p1.Flags == 0 || p1.Flags&p2.Flags != 0) +} diff --git a/internal/goip/obj_tunnel_test.go b/internal/goip/obj_tunnel_test.go new file mode 100644 index 000000000..14b4b0ed8 --- /dev/null +++ b/internal/goip/obj_tunnel_test.go @@ -0,0 +1,388 @@ +package goip + +import ( + "bytes" + "encoding/binary" + "encoding/hex" + "fmt" + "net/netip" + "slices" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// fakeTnlSys is a tnlsys.Sys from maps: an ioctl answer by +// "family/req/name", a property by "dev/prop", and the descriptors. Every +// ioctl's input is kept, to hold goip to the bytes ip passes. +type fakeTnlSys struct { + ioctls map[string]fakeIoctl + props map[string]fakeProp + fds []tnlsys.TunFD + fdsErr error + inputs []string +} + +type fakeIoctl struct { + out []byte + err error +} + +type fakeProp struct { + v string + err error +} + +func (f *fakeTnlSys) Ioctl(family int, req uint32, name string, arg []byte) ([]byte, error) { + k := fmt.Sprintf("%d/%x/%s", family, req, name) + f.inputs = append(f.inputs, fmt.Sprintf("%s=%x", k, arg)) + a, ok := f.ioctls[k] + if !ok { + return nil, fmt.Errorf("%w: %s", tnlsys.ErrNotRecorded, k) + } + copy(arg, a.out) + return nil, a.err +} + +func (f *fakeTnlSys) ReadProp(dev, prop string) (string, error) { + p, ok := f.props[dev+"/"+prop] + if !ok { + return "", fmt.Errorf("%w: %s/%s", tnlsys.ErrNotRecorded, dev, prop) + } + return p.v, p.err +} + +func (f *fakeTnlSys) TunFDs() ([]tnlsys.TunFD, error) { return f.fds, f.fdsErr } + +// fakeLinkDump answers every dump with its bodies. +type fakeLinkDump struct{ bodies [][]byte } + +func (s *fakeLinkDump) Dump([]byte, uint16) ([][]byte, error) { return s.bodies, nil } + +// tnlLink is an RTM_NEWLINK body: ifinfomsg of the ARPHRD, IFLA_IFNAME, +// then the kind and IFLA_STATS64 when given. +func tnlLink(index int32, arphrd uint16, name, kind string, stats bool) []byte { + b := ifinfomsg(index, 0, 0) + binary.LittleEndian.PutUint16(b[2:4], arphrd) + b = append(b, nla(unix.IFLA_IFNAME, strz(name))...) + if kind != "" { + b = append(b, nla(unix.IFLA_LINKINFO, nla(unix.IFLA_INFO_KIND, []byte(kind)))...) + } + if stats { + s := make([]byte, xtcpnl.RtnlLinkStats64SizeCst) + s[0], s[16] = 7, 9 // rx_packets 7, rx_bytes 9 + b = append(b, nla(unix.IFLA_STATS64, s)...) + } + return b +} + +var ( + tnlA4 = netip.MustParseAddr + // tnlGre1 is a gre tunnel with key 5 both ways and seq in. + tnlGre1 = xtcpnl.IPTunnelParm{TunnelName: xtcpnl.TunnelName{Name: "gre1"}, IFlags: xtcpnl.GreFlagKey | xtcpnl.GreFlagSeq, + OFlags: xtcpnl.GreFlagKey, IKey: 5, OKey: 5, VersionIHL: 0x45, FragOff: 0x4000, TTL: 32, Protocol: 47, + Saddr: tnlA4("192.0.2.1"), Daddr: tnlA4("198.51.100.2")} + tnlIpip1 = xtcpnl.IPTunnelParm{TunnelName: xtcpnl.TunnelName{Name: "ipip1"}, VersionIHL: 0x45, FragOff: 0x4000, + Protocol: 4, Saddr: tnlA4("0.0.0.0"), Daddr: tnlA4("198.51.100.1")} + tnlIsa1 = xtcpnl.IPTunnelParm{TunnelName: xtcpnl.TunnelName{Name: "isa1"}, IFlags: xtcpnl.SitIsatap, + VersionIHL: 0x45, FragOff: 0x4000, Protocol: 41, Saddr: tnlA4("192.0.2.1"), Daddr: tnlA4("0.0.0.0")} + tnlIP6t1 = xtcpnl.IP6TnlParm2{TunnelName: xtcpnl.TunnelName{Name: "ip6t1"}, Proto: 41, EncapLimit: 4, HopLimit: 1, + FlowInfo: 0x12345, Flags: xtcpnl.IP6TnlFIgnEncapLimit | xtcpnl.IP6TnlFUseOrigTclass, + Laddr: tnlA4("2001:db8::1"), Raddr: tnlA4("2001:db8::2")} +) + +func tnlOut(p xtcpnl.IPTunnelParm) fakeIoctl { return fakeIoctl{out: p.Marshal()} } + +// tnlPRL is a SIOCGETPRL answer: the header, then each router. +func tnlPRL(routers ...xtcpnl.TunnelPRL) fakeIoctl { + b := xtcpnl.TunnelPRLRequest(16) + for i, r := range routers { + e := b[(i+1)*xtcpnl.TunnelPRLSize:] + a := r.Addr.As4() + copy(e, a[:]) + binary.NativeEndian.PutUint16(e[4:6], r.Flags) + } + return fakeIoctl{out: b} +} + +// tnl6RD is a SIOCGET6RD answer. +func tnl6RD(prefix string, plen uint16, relay string, rlen uint16) fakeIoctl { + b := make([]byte, xtcpnl.Tunnel6RDSize) + copy(b, tnlA4(prefix).AsSlice()) + copy(b[16:], tnlA4(relay).AsSlice()) + binary.NativeEndian.PutUint16(b[20:22], plen) + binary.NativeEndian.PutUint16(b[22:24], rlen) + return fakeIoctl{out: b} +} + +// tnlKey is fakeTnlSys's ioctl key. +func tnlKey(family int, req uint32, name string) string { + return fmt.Sprintf("%d/%x/%s", family, req, name) +} + +type tnlUnitCase struct { + description string + args string + opts string // j s d o + links [][]byte + ioctls map[string]fakeIoctl + props map[string]fakeProp + fds []tnlsys.TunFD + // expected is "rc|stdout|a fragment of stderr". + expected string +} + +func runTnlUnit(t *testing.T, tc *tnlUnitCase) (string, *fakeTnlSys) { + t.Helper() + var out, errOut bytes.Buffer + c := newRunCtx(nil, &out, &errOut) + sys := &fakeTnlSys{ioctls: tc.ioctls, props: tc.props, fds: tc.fds} + c.src, c.sys = &fakeLinkDump{bodies: tc.links}, sys + c.json = strings.Contains(tc.opts, "j") + c.oneline = strings.Contains(tc.opts, "o") + if strings.Contains(tc.opts, "s") { + c.showStats = 1 + } + if strings.Contains(tc.opts, "d") { + c.showDetails = 1 + } + if strings.Contains(tc.opts, "6") { + c.family = unix.AF_INET6 + } + if strings.Contains(tc.opts, "f") { + c.family = unix.AF_PACKET + } + args := strings.Fields(tc.args) + run := runTunnel + if args[0] == "tuntap" { + run = runTuntap + } + err := run(c, args[1:]) + rc := 0 + if err != nil { + rc = exitCodeOf(err) + errOut.WriteString("goip: " + err.Error() + "\n") + } + return fmt.Sprintf("%d|%s|%s", rc, out.String(), errOut.String()), sys +} + +func checkTnlUnit(t *testing.T, tests []tnlUnitCase) { + t.Helper() + for i := range tests { + tc := &tests[i] + t.Run(tc.description, func(t *testing.T) { + got, _ := runTnlUnit(t, tc) + rc, rest, _ := strings.Cut(tc.expected, "|") + stdout, frag, _ := strings.Cut(rest, "|") + grc, grest, _ := strings.Cut(got, "|") + gout, gerr, _ := strings.Cut(grest, "|") + if grc != rc || gout != stdout || !strings.Contains(gerr, frag) { + t.Errorf("got rc %s stdout %q stderr %q\nwant rc %s stdout %q stderr containing %q", + grc, gout, gerr, rc, stdout, frag) + } + if frag == "" && gerr != "" { + t.Errorf("stderr %q, want none", gerr) + } + }) + } +} + +// TestGoipTunnelUnit drives ip tunnel's show paths over a fake link dump +// and a fake tnlsys.Sys. +// +// go test ./internal/goip/ -run TestGoipTunnelUnit +func TestGoipTunnelUnit(t *testing.T) { + gre1 := tnlLink(5, unix.ARPHRD_IPGRE, "gre1", "", true) + ipip1 := tnlLink(6, unix.ARPHRD_TUNNEL, "ipip1", "", false) + isa1 := tnlLink(7, unix.ARPHRD_SIT, "isa1", "", false) + d0 := tnlLink(2, unix.ARPHRD_ETHER, "d0", "dummy", false) + gre1Out := map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "gre1"): tnlOut(tnlGre1)} + sit1 := tnlIsa1 + sit1.Name, sit1.IFlags = "sit1", 0 + vti := tnlIpip1 + vti.Name, vti.IFlags, vti.Protocol = "vti1", xtcpnl.VtiIsVti, 4 + tos := tnlIpip1 + tos.TOS = 0x11 + isaIoctls := map[string]fakeIoctl{ + tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "isa1"): tnlOut(tnlIsa1), + tnlKey(unix.AF_INET, tnlsys.SIOCGETPRL, "isa1"): tnlPRL(xtcpnl.TunnelPRL{Addr: tnlA4("192.0.2.11")}, + xtcpnl.TunnelPRL{Addr: tnlA4("192.0.2.10"), Flags: xtcpnl.PRLDefault}), + tnlKey(unix.AF_INET, tnlsys.SIOCGET6RD, "isa1"): {err: unix.EINVAL}, + } + checkTnlUnit(t, []tnlUnitCase{ + // Positive. + {description: "positive: gre with key 5 and seq in, its flag line after the line", + args: "tunnel show", links: [][]byte{d0, gre1}, ioctls: gre1Out, + expected: "0|gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n|"}, + {description: "positive: -j ipip: remote and local as addresses, no ttl member for inherit (T7)", + args: "tunnel", opts: "j", links: [][]byte{ipip1}, + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "ipip1"): tnlOut(tnlIpip1)}, + expected: `0|[{"ifname":"ipip1","mode":"ip/ip","remote":"198.51.100.1","local":"0.0.0.0"}` + "\n]\n|"}, + {description: "positive: isatap routers, pr then pdr in the kernel's order; 6rd EINVAL is silent", + args: "tunnel show", links: [][]byte{isa1}, ioctls: isaIoctls, + expected: "0|isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\n|"}, + {description: "positive: -j isatap: pr and pdr are members of one object (T7)", + args: "tunnel show", opts: "j", links: [][]byte{isa1}, ioctls: isaIoctls, + expected: `0|[{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"}` + "\n]\n|"}, + {description: "positive: sit with a 6rd prefix and relay", + args: "tunnel show", links: [][]byte{tnlLink(8, unix.ARPHRD_SIT, "sit1", "", false)}, + ioctls: map[string]fakeIoctl{ + tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "sit1"): tnlOut(sit1), + tnlKey(unix.AF_INET, tnlsys.SIOCGET6RD, "sit1"): tnl6RD("2001:db8::", 32, "192.0.2.0", 24), + }, + expected: "0|sit1: ipv6/ip remote any local 192.0.2.1 ttl inherit 6rd-prefix 2001:db8::/32 6rd-relay_prefix 192.0.2.0/24\n|"}, + {description: "positive: v6 named: text, no final newline (T9)", + args: "tunnel show ip6t1", opts: "6", + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET6, tnlsys.SIOCGETTUNNEL, "ip6t1"): {out: tnlIP6t1.Marshal()}}, + expected: "0|ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345)|"}, + {description: "positive: tos inherit/ with the rest named in text", + args: "tunnel show", links: [][]byte{ipip1}, + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "ipip1"): tnlOut(tos)}, + expected: "0|ipip1: ip/ip remote 198.51.100.1 local any ttl inherit tos inherit/0x10\n|"}, + {description: "positive: -s: the stats block after the line", + args: "tunnel show", opts: "s", links: [][]byte{gre1}, ioctls: gre1Out, + expected: "0|gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n" + + "RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n" + + " 7 9 0 0 0 0 \n" + + "TX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n" + + " 0 0 0 0 0 0 \n|"}, + // Negative. + {description: "negative: a refused ioctl in the list is a stderr line and a skip, rc 0 (T3)", + args: "tunnel show", links: [][]byte{gre1, ipip1}, + ioctls: map[string]fakeIoctl{ + tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "gre1"): {err: unix.ENODEV}, + tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "ipip1"): tnlOut(tnlIpip1), + }, + expected: "0|ipip1: ip/ip remote 198.51.100.1 local any ttl inherit\n|get tunnel \"gre1\" failed: No such device\n"}, + {description: "negative: the named path's refusal is rc 1 (T5)", + args: "tunnel show gre9", + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "gre9"): {err: unix.ENODEV}}, + expected: "1||get tunnel \"gre9\" failed: No such device"}, + {description: "negative: keys without a gre or vti mode (T6)", + args: "tunnel show key 5", expected: "1||Keys are not allowed with ipip and sit tunnels"}, + {description: "negative: an unknown mode exits -1", + args: "tunnel show mode bogus", expected: "255||Unknown tunnel mode \"bogus\""}, + {description: "negative: two modes exit -1", + args: "tunnel show mode gre mode sit", expected: "255||You managed to ask for more than one tunnel mode."}, + {description: "negative: add is a write goip does not make", + args: "tunnel add name t1 mode gre", expected: "1||not implemented"}, + {description: "negative: a second name is duparg2", + args: "tunnel show a b", expected: "255||either \"name\" is duplicate, or \"b\" is garbage"}, + {description: "negative: a broadcast tunnel needs a source", + args: "tunnel show mode gre remote 239.1.1.1", expected: "1||A broadcast tunnel requires a source address"}, + {description: "negative: a replay gap is an error, not a kernel answer", + args: "tunnel show", links: [][]byte{gre1}, expected: "2||not in the snapshot"}, + {description: "negative: a socket(2) failure is ip's create socket line", + args: "tunnel show gre1", + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "gre1"): {err: &tnlsys.SocketError{Err: unix.EAFNOSUPPORT}}}, + expected: "1||create socket failed: Address family not supported by protocol\n"}, + {description: "negative: a refused SIOCGETPRL prints tnl_gen_ioctl's line and no routers", + args: "tunnel show", links: [][]byte{isa1}, + ioctls: map[string]fakeIoctl{ + tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "isa1"): tnlOut(tnlIsa1), + tnlKey(unix.AF_INET, tnlsys.SIOCGETPRL, "isa1"): {err: unix.EPERM}, + tnlKey(unix.AF_INET, tnlsys.SIOCGET6RD, "isa1"): {err: unix.EOPNOTSUPP}, + }, + expected: "0|isa1: ipv6/ip remote any local 192.0.2.1 ttl inherit\n|isa1: ioctl 89f4 failed: Operation not permitted\nisa1: ioctl 89f8 failed: Operation not supported\n"}, + {description: "negative: an unknown verb exits -1", + args: "tunnel bogus", expected: "255||Command \"bogus\" is unknown, try \"ip tunnel help\""}, + {description: "negative: -0 is no tunnel family", + args: "tunnel show", opts: "f", expected: "255||Unsupported protocol family: 17"}, + // Boundary. + {description: "boundary: no tunnels is nothing in text", + args: "tunnel show", links: [][]byte{d0}, expected: "0||"}, + {description: "boundary: no tunnels is an empty array under -j", + args: "tunnel show", opts: "j", expected: "0|[]\n|"}, + {description: "boundary: -s with no stats ends the dump after the line (T2)", + args: "tunnel show", opts: "s", links: [][]byte{ipip1}, + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "ipip1"): tnlOut(tnlIpip1)}, + expected: "1|ipip1: ip/ip remote 198.51.100.1 local any ttl inherit|Dump terminated"}, + {description: "boundary: ttl 300 is invarg with its own newline (T11)", + args: "tunnel show ttl 300", expected: "255||invalid TTL\n\n"}, + {description: "boundary: a 21-bit flowlabel", + args: "tunnel show flowlabel 0x100000", opts: "6", expected: "255||invalid Flowlabel"}, + {description: "boundary: help is usage", + args: "tunnel help", expected: "255||Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]"}, + // Corner. + {description: "corner: mode any is the v6 code even under -4 (T10)", + args: "tunnel show mode any", opts: "j", links: [][]byte{tnlLink(9, unix.ARPHRD_TUNNEL6, "ip6t1", "", false)}, + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET6, tnlsys.SIOCGETTUNNEL, "ip6t1"): {out: tnlIP6t1.Marshal()}}, + expected: `0|[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345"}` + "\n]\n|"}, + {description: "corner: vti prints ip/ip (T7)", + args: "tunnel show vti1", ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "vti1"): tnlOut(vti)}, + expected: "0|vti1: ip/ip remote 198.51.100.1 local any ttl inherit\n|"}, + {description: "corner: the named path prints text under -j", + args: "tunnel show gre1", opts: "j", ioctls: gre1Out, + expected: "0|gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n|"}, + {description: "corner: -o puts the flag line after a backslash, the newline stays", + args: "tunnel show", opts: "o", links: [][]byte{gre1}, ioctls: gre1Out, + expected: "0|gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\\ Drop packets out of sequence.\n|"}, + {description: "corner: -j -s puts the stats text inside the document (T1)", + args: "tunnel show", opts: "js", links: [][]byte{gre1}, ioctls: gre1Out, + expected: `0|[{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq"]}` + + "\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n" + + " 7 9 0 0 0 0 \n" + + "TX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n" + + " 0 0 0 0 0 0 \n]\n|"}, + }) +} + +// TestGoipTunnelIoctlInputs holds goip to the bytes ip passes each ioctl. +// +// go test ./internal/goip/ -run TestGoipTunnelIoctlInputs +func TestGoipTunnelIoctlInputs(t *testing.T) { + g6 := tnlIP6t1 + g6.Name, g6.Proto = "ip6g1", 47 + tests := []struct { + description string + tc tnlUnitCase + expected string // one of the inputs, "family/req/name=hex" + }{ + {"positive: the v4 list passes a zeroed struct", tnlUnitCase{args: "tunnel show", + links: [][]byte{tnlLink(5, unix.ARPHRD_IPGRE, "gre1", "", false)}, + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "gre1"): tnlOut(tnlGre1)}}, + "2/89f0/gre1=" + strings.Repeat("00", 52)}, + {"positive: the v6 list passes the index, ip6gre's protocol and p1's name", tnlUnitCase{args: "tunnel show remote 2001:db8::4", + opts: "6", + links: [][]byte{tnlLink(12, unix.ARPHRD_IP6GRE, "ip6g1", "", false)}, + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET6, tnlsys.SIOCGETTUNNEL, "ip6g1"): {out: g6.Marshal()}}}, + "10/89f0/ip6g1=" + strings.Repeat("00", 16) + "0c0000002f" + strings.Repeat("00", 55)}, + {"positive: the named path passes the parsed struct: version 4, ihl 5, DF", tnlUnitCase{args: "tunnel show mode gre", + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "gre0"): tnlOut(tnlGre1)}}, + "2/89f0/gre0=" + strings.Repeat("00", 32) + "4500000000004000002f" + strings.Repeat("00", 10)}, + {"boundary: the PRL request is 16 entries, the header's datalen 240", tnlUnitCase{args: "tunnel show isatap1", + ioctls: map[string]fakeIoctl{ + tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "isatap1"): tnlOut(tnlIsa1), + tnlKey(unix.AF_INET, tnlsys.SIOCGETPRL, "isa1"): tnlPRL(), + tnlKey(unix.AF_INET, tnlsys.SIOCGET6RD, "isa1"): {err: unix.EINVAL}, + }}, + "2/89f4/isa1=" + strings.Repeat("00", 8) + "f0000000" + strings.Repeat("00", 244)}, + {"corner: an isatap name prefix sets protocol 41 and SIT_ISATAP in the named struct", tnlUnitCase{args: "tunnel show isatap1", + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "isatap1"): {err: unix.ENODEV}}}, + "2/89f0/isatap1=" + hexName("isatap1") + "000000000100000000000000000000004500000000004000002900" + strings.Repeat("00", 9)}, + {"positive: iseq and ocsum set one side each", tnlUnitCase{args: "tunnel show mode gre iseq ocsum", + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "gre0"): tnlOut(tnlGre1)}}, + "2/89f0/gre0=" + strings.Repeat("00", 20) + "10008000" + strings.Repeat("00", 8) + "4500000000004000002f" + strings.Repeat("00", 10)}, + {"corner: a tos with a slash keeps only the part before it", tnlUnitCase{args: "tunnel show mode ipip tos 0x10/0x20", + ioctls: map[string]fakeIoctl{tnlKey(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "tunl0"): tnlOut(tnlIpip1)}}, + "2/89f0/tunl0=" + strings.Repeat("00", 32) + "4510000000004000000400" + strings.Repeat("00", 9)}, + } + for _, tt := range tests { + t.Run(tt.description, func(t *testing.T) { + _, sys := runTnlUnit(t, &tt.tc) + if !slices.Contains(sys.inputs, tt.expected) { + t.Errorf("inputs %q\nwant %q among them", sys.inputs, tt.expected) + } + }) + } +} + +// hexName is a name[IFNAMSIZ] in hex. +func hexName(n string) string { + b := make([]byte, 16) + copy(b, n) + return hex.EncodeToString(b) +} diff --git a/internal/goip/obj_tuntap.go b/internal/goip/obj_tuntap.go new file mode 100644 index 000000000..e657ea24d --- /dev/null +++ b/internal/goip/obj_tuntap.go @@ -0,0 +1,221 @@ +package goip + +import ( + "errors" + "fmt" + "strings" + + "github.com/randomizedcoder/xtcp2/internal/goip/render" + "github.com/randomizedcoder/xtcp2/internal/tnlsys" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// `ip tuntap` is do_iptuntap (ip/iptuntap.c, iproute2 v7.2.0): the verb by +// prefix, no verb being show. show ignores its arguments (T13), dumps the +// links with an IFLA_INFO_KIND "tun" filter, and prints each ARPHRD_NONE +// or ARPHRD_ETHER link of kind tun whose three sysfs properties read_prop +// parses, the processes holding it under -d. goip reads sysfs and /proc +// through c.sys (internal/tnlsys); add and delete are writes it does not +// make. + +const ( + tuntapKindCst = "tun" + + tuntapUsageCst = "Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]\n" + + " [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n" + + " [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n" + + "\n" + + "Where: USER := { STRING | NUMBER }\n" + + " GROUP := { STRING | NUMBER }" + + // taskNameBufCst is get_task_name's SPRINT_BUF: fgets keeps 63 bytes. + taskNameBufCst = 64 +) + +// runTuntap is do_iptuntap. +func runTuntap(c *runCtx, args []string) error { + if len(args) == 0 { + return tuntapShow(c) + } + verb := args[0] + switch { + case matchesPrefix(verb, addrVerbAddCst), matchesPrefix(verb, addrVerbDeleteCst): + return fmt.Errorf("tuntap %q: a TUNSETIFF write: %w", verb, ErrNotImplemented) + case matchesPrefix(verb, showVerbCst), matchesPrefix(verb, lstVerbCst), matchesPrefix(verb, listVerbCst): + return tuntapShow(c) + case matchesPrefix(verb, tnlHelpCst): + return fmt.Errorf("%w: %s", ErrTunnelUsage, tuntapUsageCst) + } + return tnlUsageMsg(fmt.Sprintf("Command %q is unknown, try \"ip tuntap help\".", verb)) +} + +// tuntapShow is do_show: the filtered dump, then print_tuntap for each +// reply, in new_json_obj's array under -j. +func tuntapShow(c *runCtx) error { + req, err := xtcpnl.BuildDumpLinkRequestKind(unix.AF_UNSPEC, tuntapKindCst, c.nextSeq()) + if err != nil { + return err + } + pr := render.NewPrinter(c.json) + pr.NewObj() + err = tuntapWalk(c, pr, req) + pr.DeleteObj() + if _, werr := c.out.Write(pr.Bytes()); werr != nil { + return werr + } + return err +} + +// tuntapWalk is rtnl_dump_filter over print_tuntap. +func tuntapWalk(c *runCtx, pr *render.Printer, req []byte) error { + bodies, err := c.src.Dump(req, unix.RTM_NEWLINK) + if err != nil { + return fmt.Errorf("%w: Dump terminated: %w", ErrTunnelRefused, err) + } + for _, body := range bodies { + li, err := xtcpnl.ParseNewLink(body) + if err != nil { + return fmt.Errorf("%w: Dump terminated: %w", ErrTunnelRefused, err) + } + if err := printTuntap(c, pr, &li); err != nil { + return err + } + } + return nil +} + +// printTuntap is print_tuntap after its length check. +func printTuntap(c *runCtx, pr *render.Printer, li *xtcpnl.LinkInfo) error { + if li.Type != unix.ARPHRD_NONE && li.Type != unix.ARPHRD_ETHER { + return nil + } + if li.Name == "" || li.Kind != tuntapKindCst { + return nil + } + t := render.Tuntap{Name: li.Name, Owner: -1, Group: -1, Details: c.showDetails > 0} + for _, f := range []struct { + prop string + v *int64 + }{{"tun_flags", &t.Flags}, {"owner", &t.Owner}, {groupKeywordCst, &t.Group}} { + ok, err := readProp(c, li.Name, f.prop, f.v) + if err != nil || !ok { + return err + } + } + if t.Details { + procs, err := tunProcesses(c, li.Name) + if err != nil { + return err + } + t.Procs = procs + } + render.PrintTuntap(pr, &t, tnlSL(c)) + return nil +} + +// readProp is lib/utils.c read_prop: ok with the value, or false after +// its lines on stderr. err is a source error, a replay gap. +func readProp(c *runCtx, dev, prop string, v *int64) (bool, error) { + fname := "/sys/class/net/" + dev + "/" + prop + content, err := c.sys.ReadProp(dev, prop) + if err != nil { + var e unix.Errno + if !errors.As(err, &e) { + return false, err + } + _, werr := fmt.Fprintf(c.errOut, "fopen %s: %s\n", fname, cStrerror(e)) + return false, werr + } + var msg string + line, ok := xtcpnl.SysfsPropLine(content) + n, perr := xtcpnl.ParseSysfsLong(content) + switch { + case !ok: + msg = fmt.Sprintf("property \"%s\" in file %s is currently unknown\n", prop, fname) + case errors.Is(perr, xtcpnl.ErrSysfsNotNumber): + msg = fmt.Sprintf("value \"%s\" in file %s is not a number\n", line, fname) + case errors.Is(perr, xtcpnl.ErrSysfsRange): + msg = fmt.Sprintf("strtol %s: %s", fname, cStrerror(unix.ERANGE)) + case perr != nil: + return false, perr + default: + *v = n + return true, nil + } + _, werr := fmt.Fprintf(c.errOut, "%sFailed to parse %s\n", msg, fname) + return false, werr +} + +// tunProcesses is show_processes: each /dev/net/tun descriptor whose +// fdinfo has an "iff" naming the device, as the process's comm and pid. +func tunProcesses(c *runCtx, name string) ([]render.TunProc, error) { + fds, err := c.sys.TunFDs() + if err != nil { + return nil, err + } + var out []render.TunProc + for _, fd := range fds { + for _, iff := range fdinfoIffs(fd.FdInfo) { + if iff == name { + out = append(out, render.TunProc{Name: taskName(fd), Pid: fd.Pid}) + } + } + } + return out, nil +} + +// taskName is get_task_name's answer as show_processes prints it: comm's +// first line, at most 63 bytes, or "" when it cannot be read. +func taskName(fd tnlsys.TunFD) string { + if fd.NoComm || fd.Pid == 0 || fd.Comm == "" { + return "" + } + s := fd.Comm + if i := strings.IndexByte(s, '\n'); i >= 0 { + s = s[:i+1] + } + if len(s) > taskNameBufCst-1 { + s = s[:taskNameBufCst-1] + } + if i := strings.IndexAny(s, "\n\x00"); i >= 0 { + s = s[:i] + } + return s +} + +// fdinfoIffs is show_processes' fscanf("%m[^:]: %ms\n") loop over an +// fdinfo file: the value of each pair whose key is "iff". The scan stops +// where fscanf would return less than two conversions and then meet the +// end of the file; a key fscanf cannot match (a ':' where the key should +// start) would loop forever in ip, and ends the scan here. +func fdinfoIffs(s string) []string { + var out []string + i := 0 + for i < len(s) { + colon := strings.IndexByte(s[i:], ':') + if colon <= 0 { + break + } + key := s[i : i+colon] + i += colon + 1 + for i < len(s) && cIsSpace(s[i]) { + i++ + } + j := i + for j < len(s) && !cIsSpace(s[j]) { + j++ + } + if j == i { + break + } + if key == "iff" { + out = append(out, s[i:j]) + } + i = j + for i < len(s) && cIsSpace(s[i]) { + i++ + } + } + return out +} diff --git a/internal/goip/obj_tuntap_test.go b/internal/goip/obj_tuntap_test.go new file mode 100644 index 000000000..f6ff1b665 --- /dev/null +++ b/internal/goip/obj_tuntap_test.go @@ -0,0 +1,181 @@ +package goip + +import ( + "fmt" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" + "golang.org/x/sys/unix" +) + +// tunProps is a device's three sysfs properties. +func tunProps(dev, flags, owner, group string) map[string]fakeProp { + return map[string]fakeProp{dev + "/tun_flags": {v: flags}, dev + "/owner": {v: owner}, dev + "/group": {v: group}} +} + +func tunFdinfo(dev string) string { + return "pos:\t0\nflags:\t0100002\nmnt_id:\t15\nino:\t1033\niff:\t" + dev + "\n" +} + +// TestGoipTuntapUnit drives ip tuntap's show over a fake link dump and a +// fake tnlsys.Sys. +// +// go test ./internal/goip/ -run TestGoipTuntapUnit +func TestGoipTuntapUnit(t *testing.T) { + tap0 := tnlLink(4, unix.ARPHRD_ETHER, "tap0", "tun", false) + tun1 := tnlLink(5, unix.ARPHRD_NONE, "tun1", "tun", false) + props := tunProps("tap0", "0x3802", "1000", "100") + holders := []tnlsys.TunFD{ + {Pid: 11, FD: 3, FdInfo: tunFdinfo("tap0"), Comm: "holder\n"}, + {Pid: 12, FD: 4, FdInfo: tunFdinfo("tun1"), Comm: "other\n"}, + {Pid: 13, FD: 3, FdInfo: tunFdinfo("tap0"), NoComm: true}, + } + merge := func(ms ...map[string]fakeProp) map[string]fakeProp { + out := map[string]fakeProp{} + for _, m := range ms { + for k, v := range m { + out[k] = v + } + } + return out + } + checkTnlUnit(t, []tnlUnitCase{ + // Positive. + {description: "positive: tap with one_queue and persist, user and group", + args: "tuntap show", links: [][]byte{tap0}, props: props, + expected: "0|tap0: tap one_queue persist user 1000 group 100\n|"}, + {description: "positive: -j: flags as an array, user and group numbers", + args: "tuntap", opts: "j", links: [][]byte{tap0}, props: props, + expected: `0|[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100}]` + "\n|"}, + {description: "positive: -d: the holders, run together, comm's newline cut (T15)", + args: "tuntap show", opts: "d", links: [][]byte{tap0}, props: props, fds: holders, + expected: "0|tap0: tap one_queue persist user 1000 group 100\n\tAttached to processes:holder(11)(13)\n|"}, + {description: "positive: -j -d: a processes array of objects", + args: "tuntap show", opts: "jd", links: [][]byte{tap0}, props: props, fds: holders, + expected: `0|[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100,` + + `"processes":[{"name":"holder","pid":11},{"name":"","pid":13}]}]` + "\n|"}, + // Negative. + {description: "negative: an unreadable property skips the device after fopen's line", + args: "tuntap show", links: [][]byte{tap0, tun1}, + props: merge(map[string]fakeProp{"tap0/tun_flags": {err: unix.ENOENT}}, tunProps("tun1", "0x1001", "-1", "-1")), + expected: "0|tun1: tun\n|fopen /sys/class/net/tap0/tun_flags: No such file or directory\n"}, + {description: "negative: a value that is not a number, then Failed to parse", + args: "tuntap show", links: [][]byte{tap0}, props: merge(props, map[string]fakeProp{"tap0/owner": {v: "x1\n"}}), + expected: "0||value \"x1\" in file /sys/class/net/tap0/owner is not a number\nFailed to parse /sys/class/net/tap0/owner\n"}, + {description: "negative: an unknown command exits -1", + args: "tuntap bogus", expected: "255||Command \"bogus\" is unknown, try \"ip tuntap help\"."}, + {description: "negative: add is a write goip does not make", + args: "tuntap add dev tap9 mode tap", expected: "1||not implemented"}, + {description: "boundary: -d with no holders prints the Attached line alone", + args: "tuntap show", opts: "d", links: [][]byte{tap0}, props: props, expected: "0|tap0: tap one_queue persist user 1000 group 100\n\tAttached to processes:\n|"}, + // Boundary. + {description: "boundary: no tun devices is an empty array", + args: "tuntap show", opts: "j", expected: "0|[]\n|"}, + {description: "boundary: an empty file is currently unknown", + args: "tuntap show", links: [][]byte{tap0}, props: merge(props, map[string]fakeProp{"tap0/group": {v: ""}}), + expected: "0||property \"group\" in file /sys/class/net/tap0/group is currently unknown\n"}, + {description: "boundary: past a long is strtol's line, with no newline of its own", + args: "tuntap show", links: [][]byte{tap0}, props: merge(props, map[string]fakeProp{"tap0/owner": {v: "99999999999999999999\n"}}), + expected: "0||strtol /sys/class/net/tap0/owner: Numerical result out of range" + "Failed to parse /sys/class/net/tap0/owner\n"}, + {description: "boundary: help is usage", + args: "tuntap help", expected: "255||Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]"}, + // Corner. + {description: "corner: arguments after show are ignored (T13)", + args: "tuntap show dev tun1 bogus", links: [][]byte{tap0}, props: props, + expected: "0|tap0: tap one_queue persist user 1000 group 100\n|"}, + {description: "corner: pi and filter print when their bit is clear; unknown bits as hex; -1 owner omitted", + args: "tuntap show", links: [][]byte{tun1}, props: tunProps("tun1", "0x10011", "-1", "5"), + expected: "0|tun1: tun pi filter 0x10010 group 5\n|"}, + {description: "corner: -o -d: the Attached line after a backslash, the newline stays (T16)", + args: "tuntap show", opts: "od", links: [][]byte{tap0}, props: props, fds: holders[:1], + expected: "0|tap0: tap one_queue persist user 1000 group 100\\\tAttached to processes:holder(11)\n|"}, + {description: "corner: an ARPHRD other than NONE or ETHER is not a tun device (T17)", + args: "tuntap show", links: [][]byte{tnlLink(6, unix.ARPHRD_TUNNEL, "tap0", "tun", false)}, props: props, + expected: "0||"}, + {description: "corner: a kind other than tun is skipped before sysfs", + args: "tuntap show", links: [][]byte{tnlLink(6, unix.ARPHRD_ETHER, "v0", "veth", false)}, expected: "0||"}, + }) +} + +// TestFdinfoIffs is show_processes' fscanf loop over an fdinfo file. +// +// go test ./internal/goip/ -run TestFdinfoIffs +func TestFdinfoIffs(t *testing.T) { + tests := []struct { + description string + in string + expected string + }{ + {"positive: a tun descriptor's fdinfo", tunFdinfo("tap0"), "[tap0]"}, + {"negative: no iff line", "pos:\t0\nflags:\t02\n", "[]"}, + {"boundary: empty", "", "[]"}, + {"boundary: a key at the end with no value", "pos:\t0\niff:", "[]"}, + {"corner: a value is one word; the next word is the next key", "iff: a b: c\n", "[a]"}, + {"corner: a line starting with ':' stops the scan (ip loops forever)", ":x\niff: a\n", "[]"}, + {"corner: two iff lines", "iff:\ta\niff:\tb\n", "[a b]"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := fmt.Sprint(fdinfoIffs(tc.in)); got != tc.expected { + t.Errorf("fdinfoIffs(%q) = %s, want %s", tc.in, got, tc.expected) + } + }) + } +} + +// TestTaskName is get_task_name as show_processes prints it. +// +// go test ./internal/goip/ -run TestTaskName +func TestTaskName(t *testing.T) { + tests := []struct { + description string + fd tnlsys.TunFD + expected string + }{ + {"positive: comm's newline cut", tnlsys.TunFD{Pid: 1, Comm: "qemu\n"}, "qemu"}, + {"negative: an unreadable comm", tnlsys.TunFD{Pid: 1, NoComm: true}, ""}, + {"boundary: an empty comm is fgets' NULL", tnlsys.TunFD{Pid: 1, Comm: ""}, ""}, + {"boundary: 63 bytes kept", tnlsys.TunFD{Pid: 1, Comm: strings.Repeat("a", 70)}, strings.Repeat("a", 63)}, + {"corner: pid 0 is refused", tnlsys.TunFD{Comm: "x\n"}, ""}, + {"corner: a NUL ends the string", tnlsys.TunFD{Pid: 1, Comm: "a\x00b\n"}, "a"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := taskName(tc.fd); got != tc.expected { + t.Errorf("taskName = %q, want %q", got, tc.expected) + } + }) + } +} + +// TestTnlTOS is parse_args' tos value. +// +// go test ./internal/goip/ -run TestTnlTOS +func TestTnlTOS(t *testing.T) { + tests := []struct { + description string + in string + expected string + }{ + {"positive: hex", "0x10", "0x10"}, + {"positive: inherit/hex sets bit 0", "inherit/0x10", "0x11"}, + {"negative: not a value", "zz", "error"}, + {"boundary: inherit alone is 1", "inherit", "0x01"}, + {"boundary: 0x100 is past a byte", "100", "error"}, + {"corner: what follows a slash after a value is dropped", "0x10/zz", "0x10"}, + {"corner: inherit/ with nothing after it reads an empty word", "inherit/", "error"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + v, err := tnlTOS(tc.in) + got := fmt.Sprintf("0x%02x", v) + if err != nil { + got = "error" + } + if got != tc.expected { + t.Errorf("tnlTOS(%q) = %s (%v), want %s", tc.in, got, err, tc.expected) + } + }) + } +} diff --git a/internal/goip/render/ipprint.go b/internal/goip/render/ipprint.go index 06846b678..825780ae8 100644 --- a/internal/goip/render/ipprint.go +++ b/internal/goip/render/ipprint.go @@ -105,6 +105,13 @@ func (p *Printer) FPf(format string, a ...any) { } } +// Raw is a bare printf or fputc to stdout: written as it is in both +// modes, so under -j it lands between the document's tokens, as ip's own +// does (ip/tunnel.c's stats block and per-tunnel newline). +func (p *Printer) Raw(s string) { + p.b.WriteString(s) +} + // U64 is print_u64 and its unsigned siblings. func (p *Printer) U64(kind PrintKind, key, format string, v uint64) { p.value(kind, key, format, strconv.FormatUint(v, 10), v) diff --git a/internal/goip/render/tunnel.go b/internal/goip/render/tunnel.go new file mode 100644 index 000000000..b94326a6a --- /dev/null +++ b/internal/goip/render/tunnel.go @@ -0,0 +1,346 @@ +package render + +import ( + "fmt" + "net/netip" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// The renders of `ip tunnel`, `ip -6 tunnel` and `ip tuntap` at iproute2 +// v7.2.0: ip/iptunnel.c and ip/ip6tunnel.c print_tunnel, ip/tunnel.c +// tnl_print_gre_flags and tnl_print_stats, and ip/iptuntap.c print_tuntap. +// Each writes to a Printer as the C writes to stdout, including its bare +// printf calls, which land inside a -j document (Printer.Raw). + +// The tunnel protocol numbers tnl_strproto names. +const ( + tnlProtoIPIP = 4 + tnlProtoIPv6 = 41 + tnlProtoGRE = 47 + tnlProtoESP = 50 + tnlProtoMPLS = 137 +) + +// The mode words of ESP and MPLS. +const ( + tnlProtoESPCst = "esp" + tnlProtoMPLSCst = "mpls" +) + +// ipDF is IP_DF in frag_off, host order. +const ipDF = 0x4000 + +// The ip6_tnl_parm2 flowinfo masks, host order (include/linux/ipv6.h +// IPV6_FLOWINFO_*). +const ( + ip6FlowinfoTclass = 0x0FF00000 + ip6FlowinfoFlowlabel = 0x000FFFFF +) + +// TnlStrproto is tnl_strproto: the protocol's mode word. +func TnlStrproto(proto uint8) string { + switch proto { + case tnlProtoIPIP: + return "ip" + case tnlProtoGRE: + return "gre" + case tnlProtoIPv6: + return "ipv6" + case tnlProtoESP: + return tnlProtoESPCst + case tnlProtoMPLS: + return tnlProtoMPLSCst + case 0: + return tnlAnyCst + } + return "unknown" +} + +// TunnelV4 is what iptunnel.c print_tunnel prints of one tunnel: the +// SIOCGETTUNNEL answer and what it asks on the way. +type TunnelV4 struct { + Parm xtcpnl.IPTunnelParm + // PRL is the SIOCGETPRL answer for an isatap tunnel, nil when it was + // not asked or failed. Entry 0 is the request header, never printed. + PRL []xtcpnl.TunnelPRL + // Dev is ll_index_to_name(link) when link is set. + Dev string + // SixRD is the SIOCGET6RD answer for a sit tunnel, nil when it was + // not asked or failed. + SixRD *xtcpnl.Tunnel6RD +} + +// PrintTunnelV4 is iptunnel.c print_tunnel. ds is the run's rt_dsfield +// table; sl is _SL_. +func PrintTunnelV4(p *Printer, t *TunnelV4, ds *Dsfield, sl string) { + q := &t.Parm + p.OpenObject("") + p.String(PrintAny, "ifname", "%s: ", q.Name) + p.String(PrintAny, "mode", "%s ", TnlStrproto(q.Protocol)+"/ip") + p.FPf("remote ") + remote := tnlAnyCst + if !isZero4(q.Daddr) || p.JSON() { + remote = addr4(q.Daddr) + } + p.String(PrintAny, "remote", "%s ", remote) + p.FPf("local ") + local := tnlAnyCst + if !isZero4(q.Saddr) || p.JSON() { + local = addr4(q.Saddr) + } + p.String(PrintAny, "local", "%s", local) + + if q.Protocol == tnlProtoIPv6 && q.IFlags&xtcpnl.SitIsatap != 0 { + for i := 1; i < len(t.PRL); i++ { + e := t.PRL[i] + if isZero4(e.Addr) { + continue + } + if e.Flags&xtcpnl.PRLDefault != 0 { + p.String(PrintAny, "pdr", " pdr %s", addr4(e.Addr)) + } else { + p.String(PrintAny, "pr", " pr %s", addr4(e.Addr)) + } + } + } + if q.Link != 0 { + p.String(PrintAny, "dev", " dev %s", t.Dev) + } + if q.TTL != 0 { + p.U64(PrintAny, "ttl", " ttl %d", uint64(q.TTL)) + } else { + p.FPf(" ttl inherit") + } + if q.TOS != 0 { + if q.TOS != 1 { + s := ds.N2A(q.TOS) + if !p.JSON() && q.TOS&1 != 0 { + s = "inherit/" + ds.N2A(q.TOS&^1) + } + p.String(PrintAny, "tos", " tos %s", s) + } else { + p.FPf(" tos inherit") + } + } + if q.FragOff&ipDF == 0 { + p.Null(PrintAny, "nopmtudisc", " nopmtudisc") + } + if q.Protocol == tnlProtoIPv6 && t.SixRD != nil && t.SixRD.PrefixLen != 0 { + r := t.SixRD + p.String(PrintAny, "6rd-prefix", " 6rd-prefix %s", inet6Ntop(r.Prefix.As16())) + p.U64(PrintAny, "6rd-prefixlen", "/%d", uint64(r.PrefixLen)) + if !isZero4(r.RelayPrefix) { + p.String(PrintAny, "6rd-relay_prefix", " 6rd-relay_prefix %s", addr4(r.RelayPrefix)) + p.U64(PrintAny, "6rd-relay_prefixlen", "/%d", uint64(r.RelayPrefixLen)) + } + } + printGreFlags(p, q.Protocol, q.IFlags, q.OFlags, q.IKey, q.OKey, sl) + p.CloseObject() +} + +// TunnelV6 is what ip6tunnel.c print_tunnel prints of one tunnel. +type TunnelV6 struct { + Parm xtcpnl.IP6TnlParm2 + // Dev is ll_index_to_name(link) when link is set. + Dev string +} + +// PrintTunnelV6 is ip6tunnel.c print_tunnel; sl is _SL_. +func PrintTunnelV6(p *Printer, t *TunnelV6, sl string) { + q := &t.Parm + p.OpenObject("") + p.String(PrintAny, "ifname", "%s: ", q.Name) + p.String(PrintAny, "mode", "%s ", TnlStrproto(q.Proto)+"/ipv6") + p.FPf("remote ") + p.String(PrintAny, "remote", "%s ", addr16(q.Raddr)) + p.FPf("local ") + p.String(PrintAny, "local", "%s", addr16(q.Laddr)) + if q.Link != 0 { + p.String(PrintAny, "link", " dev %s", t.Dev) + } + if q.Flags&xtcpnl.IP6TnlFIgnEncapLimit != 0 { + p.Null(PrintAny, "ip6_tnl_f_ign_encap_limit", " encaplimit none") + } else { + p.U64(PrintAny, "encap_limit", " encaplimit %d", uint64(q.EncapLimit)) + } + if q.HopLimit != 0 { + p.U64(PrintAny, "hoplimit", " hoplimit %d", uint64(q.HopLimit)) + } else { + p.FPf(" hoplimit inherit") + } + if q.Flags&xtcpnl.IP6TnlFUseOrigTclass != 0 { + p.Null(PrintAny, "ip6_tnl_f_use_orig_tclass", " tclass inherit") + } else { + p.String(PrintAny, "tclass", " tclass %s", fmt.Sprintf("0x%02x", (q.FlowInfo&ip6FlowinfoTclass)>>20)) + } + if q.Flags&xtcpnl.IP6TnlFUseOrigFlowlabel != 0 { + p.Null(PrintAny, "ip6_tnl_f_use_orig_flowlabel", " flowlabel inherit") + } else { + p.String(PrintAny, "flowlabel", " flowlabel %s", fmt.Sprintf("0x%05x", q.FlowInfo&ip6FlowinfoFlowlabel)) + } + p.String(PrintAny, "flowinfo", " (flowinfo %s)", fmt.Sprintf("0x%08x", q.FlowInfo)) + if q.Flags&xtcpnl.IP6TnlFRcvDSCPCopy != 0 { + p.Null(PrintAny, "ip6_tnl_f_rcv_dscp_copy", " dscp inherit") + } + if q.Flags&xtcpnl.IP6TnlFAllowLocalRemote != 0 { + p.Null(PrintAny, "ip6_tnl_f_allow_local_remote", " allow-localremote") + } + printGreFlags(p, q.Proto, q.IFlags, q.OFlags, q.IKey, q.OKey, sl) + p.CloseObject() +} + +// printGreFlags is tnl_print_gre_flags: the keys, then for a GRE tunnel +// the flags array under -j, or one bare printf line each in text. +func printGreFlags(p *Printer, proto uint8, iflags, oflags uint16, ikey, okey uint32, sl string) { + if iflags&xtcpnl.GreFlagKey != 0 && oflags&xtcpnl.GreFlagKey != 0 && ikey == okey { + p.U64(PrintAny, "key", " key %d", uint64(ikey)) + } else { + if iflags&xtcpnl.GreFlagKey != 0 { + p.U64(PrintAny, "ikey", " ikey %d", uint64(ikey)) + } + if oflags&xtcpnl.GreFlagKey != 0 { + p.U64(PrintAny, "okey", " okey %d", uint64(okey)) + } + } + if proto != tnlProtoGRE { + return + } + p.OpenArray("flags") + for _, f := range []struct { + set bool + json, text string + }{ + {iflags&xtcpnl.GreFlagSeq != 0, "rx_drop_ooseq", " Drop packets out of sequence."}, + {iflags&xtcpnl.GreFlagCsum != 0, "rx_csum", " Checksum in received packet is required."}, + {oflags&xtcpnl.GreFlagSeq != 0, "tx_seq", " Sequence packets on output."}, + {oflags&xtcpnl.GreFlagCsum != 0, "tx_csum", " Checksum output packets."}, + } { + if !f.set { + continue + } + if p.JSON() { + p.String(PrintJSON, "", "%s", f.json) + } else { + p.Raw(sl + f.text) + } + } + p.CloseArray() +} + +// TunnelStats is tnl_print_stats: bare printf, so under -j too. The +// counters are __u64 printed with %lld. +func TunnelStats(s *xtcpnl.RtnlLinkStats64, sl string) string { + ll := cint.LongLong + return sl + + "RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts" + sl + + fmt.Sprintf(" %-10d %-12d %-6d %-8d %-8d %-8d", ll(s.RxPackets), ll(s.RxBytes), ll(s.RxErrors), + ll(s.RxFrameErrors), ll(s.RxFifoErrors), ll(s.Multicast)) + sl + + "TX: Packets Bytes Errors DeadLoop NoRoute NoBufs" + sl + + fmt.Sprintf(" %-10d %-12d %-6d %-8d %-8d %-6d", ll(s.TxPackets), ll(s.TxBytes), ll(s.TxErrors), + ll(s.Collisions), ll(s.TxCarrierErrors), ll(s.TxDropped)) +} + +// The tun flag words print_flags prints, in its order; pi and filter are +// printed when their bit is clear. +var tunFlagWords = []struct { + bit int64 + clear bool + word string +}{ + {xtcpnl.TunIffTun, false, "tun"}, + {xtcpnl.TunIffTap, false, "tap"}, + {xtcpnl.TunIffNoPI, true, "pi"}, + {xtcpnl.TunIffOneQueue, false, "one_queue"}, + {xtcpnl.TunIffMultiQueue, false, "multi_queue"}, + {xtcpnl.TunIffVnetHdr, false, "vnet_hdr"}, + {xtcpnl.TunIffPersist, false, "persist"}, + {xtcpnl.TunIffNoPI, true, "filter"}, // IFF_NOFILTER, the same bit +} + +// TunProc is one process show_processes prints: its comm, or "", +// and its pid. +type TunProc struct { + Name string + Pid int +} + +// Tuntap is what print_tuntap prints of one tun device. +type Tuntap struct { + Name string + Flags int64 // read_prop's long + Owner, Group int64 // -1 for none + // Details is show_details: Procs follow "Attached to processes:". + Details bool + Procs []TunProc +} + +// PrintTuntap is print_tuntap from its open_json_object; sl is _SL_. +func PrintTuntap(p *Printer, t *Tuntap, sl string) { + p.OpenObject("") + p.String(PrintAny, "ifname", "%s:", t.Name) + p.OpenArray("flags") + var known int64 + for _, w := range tunFlagWords { + known |= w.bit + if (t.Flags&w.bit != 0) != w.clear { + p.String(PrintAny, "", " %s", w.word) + } + } + if rest := t.Flags &^ known; rest != 0 { + h := fmt.Sprintf("%#x", cint.U64Bits(rest)) + p.String(PrintAny, "", " %s", h) + } + p.CloseArray() + printLongU64(p, "user", " user %d", t.Owner) + printLongU64(p, "group", " group %d", t.Group) + if t.Details { + p.FPf("%s\tAttached to processes:", sl) + p.OpenArray("processes") + for _, pr := range t.Procs { + p.OpenObject("") + p.String(PrintAny, "name", "%s", pr.Name) + p.Int(PrintAny, "pid", "(%d)", int64(pr.Pid)) + p.CloseObject() + } + p.CloseArray() + } + p.CloseObject() + p.FPf("\n") +} + +// printLongU64 is print_u64 of a long that is not -1: the JSON number is +// its u64 bits, the text its %ld. +func printLongU64(p *Printer, key, format string, v int64) { + if v == -1 { + return + } + if p.JSON() { + p.U64(PrintJSON, key, "", cint.U64Bits(v)) + return + } + p.FPf(format, v) +} + +// isZero4 is an address of all zero bytes, or no address. +func isZero4(a netip.Addr) bool { + return !a.IsValid() || a.IsUnspecified() +} + +// addr4 is format_host or rt_addr_n2a of a 4-byte address: dotted quad. +func addr4(a netip.Addr) string { + if !a.IsValid() { + return "0.0.0.0" + } + return a.String() +} + +// addr16 is format_host or rt_addr_n2a of a 16-byte address: glibc's +// inet_ntop. +func addr16(a netip.Addr) string { + if !a.Is6() { + return "::" + } + return inet6Ntop(a.As16()) +} diff --git a/internal/goip/resolve_test.go b/internal/goip/resolve_test.go index 69ba65a70..84136d207 100644 --- a/internal/goip/resolve_test.go +++ b/internal/goip/resolve_test.go @@ -153,7 +153,7 @@ func TestResolveShow(t *testing.T) { }, { name: "unimplemented_object", category: "negative", - description: "tunn is tunnel, which goip does not implement", + description: "tunn is tunnel, which goip leaves to the command line", inputs: [][]string{{"tunn"}}, wantErr: ErrNotImplemented, wantMsg: "ip tunnel show:", }, { @@ -553,7 +553,7 @@ func TestLookupObjectExported(t *testing.T) { {name: "full_length", category: "boundary", description: "addrlabel spelled in full", tok: "addrlabel", expected: "addrlabel"}, {name: "one_longer", category: "boundary", description: "addressx matches no object", tok: "addressx", wantErr: ErrUnknownObject}, {name: "unknown", category: "negative", description: "zz is no object", tok: "zz", wantErr: ErrUnknownObject}, - {name: "unimplemented", category: "negative", description: "tunn is tunnel, named as the command ip would run", tok: "tunn", wantErr: ErrNotImplemented, wantMsg: "ip tunnel show:"}, + {name: "unimplemented", category: "negative", description: "tunn is tunnel, which Show does not serve, named as the command ip would run", tok: "tunn", wantErr: ErrNotImplemented, wantMsg: "ip tunnel show:"}, {name: "empty", category: "corner", description: "an empty token matches nothing", tok: "", wantErr: ErrUnknownObject}, } for _, tt := range tests { @@ -592,7 +592,7 @@ func TestIsVerb(t *testing.T) { {name: "exact_stats", category: "boundary", description: "stats compares with strcmp, so sh is no verb", object: "stats", tok: "sh", expected: false}, {name: "alias_not_canonical", category: "corner", description: "only canonical names are looked up; ntbl is LookupObject's job", object: "ntbl", tok: "show", expected: true}, {name: "unknown_object", category: "corner", description: "an object goip has no row for has no verbs", object: "zz", tok: "show", expected: false}, - {name: "unimplemented_object", category: "corner", description: "tunnel has no chain", object: "tunnel", tok: "show", expected: false}, + {name: "cli_only_object", category: "corner", description: "tunnel is left out of Show but has its chain: prl is a verb", object: "tunnel", tok: "prl", expected: true}, } for _, tt := range tests { t.Run(tt.category+"/"+tt.name, func(t *testing.T) { diff --git a/internal/goip/rule_write.go b/internal/goip/rule_write.go index ccd0e6316..73b16fde2 100644 --- a/internal/goip/rule_write.go +++ b/internal/goip/rule_write.go @@ -8,7 +8,6 @@ import ( "math" "strings" - "github.com/randomizedcoder/xtcp2/internal/goip/render" "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" "golang.org/x/sys/unix" ) @@ -499,19 +498,6 @@ func (w *ruleWrite) ruleType(args []string, i int) (int, error) { return i, nil } -// rtnlDsfieldA2N is rtnl_dsfield_a2n: a name from the rt_dsfield file -// iproute2 ships, then strtoul base 16 over the whole argument, at most 255. -func rtnlDsfieldA2N(arg string) (uint8, bool) { - if v, ok := render.DsfieldByName(arg); ok { - return v, true - } - r := cStrtoul(arg, 16) - if r.end == 0 || r.end != len(arg) || r.val > math.MaxUint8 { - return 0, false - } - return uint8(r.val), true -} - // rtnlDscpA2N is rtnl_dscp_a2n: get_u32 base 0, or a DS field name or hex // value shifted down to its DSCP. func rtnlDscpA2N(arg string) (uint32, bool) { diff --git a/internal/goip/service/service.go b/internal/goip/service/service.go index b56c08a49..6fb09c7cd 100644 --- a/internal/goip/service/service.go +++ b/internal/goip/service/service.go @@ -131,6 +131,13 @@ func (e *linkNotFoundError) Error() string { return fmt.Sprintf("goip: link %s not found", e.selector) } +// IsLinkNotFound is whether err is the dump fallback's miss, which stands in +// for the kernel's ENODEV to a single-get. +func IsLinkNotFound(err error) bool { + var miss *linkNotFoundError + return errors.As(err, &miss) +} + // linkFromGet is the body every single-get link accessor shares: send the // caller's request over Talk when the source can do single-gets, otherwise fall // back to one dump plus exact filtering, and hold both answers to the same diff --git a/internal/goip/tnlsys_seam_test.go b/internal/goip/tnlsys_seam_test.go new file mode 100644 index 000000000..2e0ab4caa --- /dev/null +++ b/internal/goip/tnlsys_seam_test.go @@ -0,0 +1,64 @@ +package goip + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" +) + +func TestOpenSys(t *testing.T) { + dir := t.TempDir() + good := filepath.Join(dir, "tnlsys.out") + if err := os.WriteFile(good, []byte(`{"tunfds":[]}`), 0o600); err != nil { + t.Fatal(err) + } + bad := filepath.Join(dir, "bad.out") + if err := os.WriteFile(bad, []byte(`{"bogus":1}`), 0o600); err != nil { + t.Fatal(err) + } + tests := []struct { + description string + tnlsys string + replay string + want string + wantErr string + }{ + {"positive: GOIP_TNLSYS loads the snapshot", good, "", "snapshot-recorded", ""}, + {"positive: GOIP_TNLSYS wins over GOIP_REPLAY", good, "x.pcap", "snapshot-recorded", ""}, + {"positive: no variables asks the kernel", "", "", "live", ""}, + {"negative: a missing sidecar is an error", filepath.Join(dir, "nope"), "", "", "no such file"}, + {"negative: a malformed sidecar is an error", bad, "", "", "unknown field"}, + {"corner: a replay with no sidecar answers nothing, never the host", "", "x.pcap", "snapshot-empty", ""}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + t.Setenv("GOIP_TNLSYS", tc.tnlsys) + t.Setenv("GOIP_REPLAY", tc.replay) + sys, err := openSys() + if tc.wantErr != "" { + if err == nil || !strings.Contains(err.Error(), tc.wantErr) { + t.Fatalf("err = %v, want %q", err, tc.wantErr) + } + return + } + if err != nil { + t.Fatal(err) + } + got := "live" + if s, ok := sys.(*tnlsys.Snapshot); ok { + got = "snapshot-empty" + if _, err := s.TunFDs(); err == nil { + got = "snapshot-recorded" + } + } else if _, ok := sys.(tnlsys.Live); !ok { + got = "other" + } + if got != tc.want { + t.Errorf("sys = %s, want %s", got, tc.want) + } + }) + } +} diff --git a/internal/goip/verbs.go b/internal/goip/verbs.go index aa4d577ba..1664f0adb 100644 --- a/internal/goip/verbs.go +++ b/internal/goip/verbs.go @@ -236,6 +236,13 @@ var ( monitorVerb = verb{name: monitorVerbCst, kind: verbOther} // l2tpVerbs is do_ipl2tp (ip/ipl2tp.c:824-844). l2tpVerbs = chain([]verb{helpVerb, addVerb, deleteVerb}, showLstList) + // tunnelVerbs is do_iptunnel (ip/iptunnel.c:570-588 at v7.2.0); the + // writes are ioctls goip does not make. do_ip6tunnel's chain is this + // one without prl and 6rd. + tunnelVerbs = chain([]verb{addVerb, changeVerb, deleteVerb}, showLstList, + []verb{{name: "prl", kind: verbWrite}, {name: "6rd", kind: verbWrite}, helpVerb}) + // tuntapVerbs is do_iptuntap (ip/iptuntap.c:453-466). + tuntapVerbs = chain([]verb{addVerb, deleteVerb}, showLstList, []verb{helpVerb}) // fouVerbs is do_ipfou (ip/ipfou.c:329-350): show alone lists. fouVerbs = []verb{helpVerb, addVerb, deleteVerb, {name: showVerbCst, kind: verbShow}} // ilaVerbs is do_ipila (ip/ipila.c:288-311). diff --git a/internal/goip/verbs_test.go b/internal/goip/verbs_test.go index 30f548b3d..34a2960ec 100644 --- a/internal/goip/verbs_test.go +++ b/internal/goip/verbs_test.go @@ -65,6 +65,10 @@ var iproute2Verbs = map[string][]string{ "ioam": {"help=", "namespace=", "schema=", "monitor="}, // ip/ipmonitor.c's do_ipmonitor reads object words, not verbs. "monitor": {}, + // ip/iptunnel.c:570-588 (v7.2.0) + "tunnel": {"add", "change", "delete", "show", "lst", "list", "prl", "6rd", "help"}, + // ip/iptuntap.c:453-466 (v7.2.0) + "tuntap": {"add", "delete", "show", "lst", "list", "help"}, // ip/ipxfrm.c:1554-1574 "xfrm": {"state", "sa", "policy", "monitor", "help"}, } diff --git a/internal/goip/ws_tunnel_test.go b/internal/goip/ws_tunnel_test.go new file mode 100644 index 000000000..d2c3df2d6 --- /dev/null +++ b/internal/goip/ws_tunnel_test.go @@ -0,0 +1,141 @@ +package goip + +import ( + "bytes" + "encoding/json" + "maps" + "path/filepath" + "slices" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" +) + +// The ws/tunnel and ws/tuntap spaces (goip 8C) replayed through goip's own +// entry point, argv as ip's: each row's tnlsnap run, its netlink capture +// (netlink_route_tnlsys.pcap) as GOIP_REPLAY and its sidecar (tnlsys.out) +// as GOIP_TNLSYS, so the netlink and the ioctl, sysfs and /proc answers are +// one run's. goip's stdout and exit status must be that run's, byte for +// byte; and the row's own run (ip.out) printed the same, but for -d, +// whose pids are each run's own. + +const wsTunnelRoot = "../../pkg/xtcpnl/testdata/7_3_1/ws" + +// wsTunnelRow is one row of a tunnel space: its command and the tnlsnap +// run it replays. +type wsTunnelRow struct { + dir string + row wsRowFile + run tnlsys.Run +} + +func wsTunnelRows(t *testing.T, space string) []wsTunnelRow { + t.Helper() + dirs, err := filepath.Glob(filepath.Join(wsTunnelRoot, space, "*")) + if err != nil { + t.Fatal(err) + } + slices.Sort(dirs) + out := make([]wsTunnelRow, 0, len(dirs)) + for _, d := range dirs { + r := wsTunnelRow{dir: d} + if err := json.Unmarshal([]byte(mustReadFile(t, filepath.Join(d, "cmd.json"))), &r.row); err != nil { + t.Fatal(err) + } + var s struct { + Run *tnlsys.Run `json:"run"` + } + if err := json.Unmarshal([]byte(mustReadFile(t, filepath.Join(d, "tnlsys.out"))), &s); err != nil { + t.Fatal(err) + } + if s.Run == nil { + t.Fatalf("%s: tnlsys.out has no run", d) + } + r.run = *s.Run + out = append(out, r) + } + return out +} + +// wsTunnelReplay runs goip over the row's tnlsnap run. +func wsTunnelReplay(t *testing.T, r *wsTunnelRow) (rc int, stdout, stderr string) { + t.Helper() + t.Setenv("GOIP_REPLAY", filepath.Join(r.dir, "netlink_route_tnlsys.pcap")) + t.Setenv("GOIP_REPLAY_PORTID", "") + t.Setenv("GOIP_TNLSYS", filepath.Join(r.dir, "tnlsys.out")) + var o, e bytes.Buffer + rc = run(strings.Fields(r.row.Cmd)[1:], strings.NewReader(""), &o, &e) + return rc, o.String(), e.String() +} + +// wsTunnelSkip is why goip does not replay a row, or "": a batch, which +// goip refuses; -pretty, which goip implements for no object; and a write, +// an ioctl or TUNSETIFF goip does not make (it refuses each with exit 1, +// where ip exits 255 for some argument errors first). +func wsTunnelSkip(cmd string) string { + f := strings.Fields(cmd) + switch { + case strings.Contains(cmd, "-batch"): + return "batch" + case slices.Contains(f, "-p"): + return "pretty" + case slices.ContainsFunc(f, func(w string) bool { + return w == "add" || w == "del" || w == "change" || w == "prl" || w == "6rd" + }): + return "write" + } + return "" +} + +// TestWsTunnelReplay replays every ws/tunnel and ws/tuntap row. +// +// go test ./internal/goip/ -run TestWsTunnelReplay +func TestWsTunnelReplay(t *testing.T) { + tests := []struct { + description string + space string + rows int // on disk + skipped map[string]int + }{ + {"positive: every ip tunnel and ip -6 tunnel read row", "tunnel", 171, map[string]int{"batch": 8, "pretty": 2, "write": 4}}, + {"positive: every ip tuntap read row", "tuntap", 46, map[string]int{"batch": 4, "write": 4}}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + rows := wsTunnelRows(t, tc.space) + if len(rows) != tc.rows { + t.Errorf("%d rows on disk, want %d", len(rows), tc.rows) + } + skipped := map[string]int{} + for i := range rows { + r := &rows[i] + if why := wsTunnelSkip(r.row.Cmd); why != "" { + skipped[why]++ + continue + } + t.Run(filepath.Base(r.dir), func(t *testing.T) { + rc, stdout, stderr := wsTunnelReplay(t, r) + if rc != r.run.RC || rc != r.row.Result.RC { + t.Fatalf("%s: exit %d, ip's %d (row %d)\nstderr %q\nip's %q", r.row.Cmd, rc, r.run.RC, + r.row.Result.RC, stderr, r.run.Stderr) + } + if stdout != r.run.Stdout { + t.Errorf("%s: stdout\n got %q\nwant %q", r.row.Cmd, stdout, r.run.Stdout) + } + if !strings.Contains(r.row.Cmd, "-d") { + if ipOut := mustReadFile(t, filepath.Join(r.dir, "ip.out")); ipOut != r.run.Stdout { + t.Errorf("%s: the row's run printed %q, its tnlsnap run %q", r.row.Cmd, ipOut, r.run.Stdout) + } + } + if r.run.Stderr == "" && rc == 0 && stderr != "" { + t.Errorf("%s: stderr %q, ip's empty", r.row.Cmd, stderr) + } + }) + } + if !maps.Equal(skipped, tc.skipped) { + t.Errorf("skipped %v, want %v", skipped, tc.skipped) + } + }) + } +} diff --git a/internal/tnlsys/live_linux.go b/internal/tnlsys/live_linux.go new file mode 100644 index 000000000..f440723b7 --- /dev/null +++ b/internal/tnlsys/live_linux.go @@ -0,0 +1,214 @@ +package tnlsys + +import ( + "errors" + "io" + "os" + "path" + "runtime" + "strconv" + "unsafe" + + "golang.org/x/sys/unix" +) + +// spillFill is what Live fills the bytes past an argument with, so a +// kernel write there shows. +const spillFill = 0xA5 + +// tunDev is TUNDEV, the path a tun descriptor's /proc link reads. +const tunDev = "/dev/net/tun" + +// Live asks the kernel. SysRoot and ProcRoot default to /sys and /proc; +// a test points them at a fake tree. +type Live struct { + SysRoot string + ProcRoot string +} + +// ifreqData is struct ifreq with the ifr_data member, as +// pkg/linkmonitor's ethtoolIfreq: the pointer stays visible to the GC, and +// the union is 24 bytes on 64-bit Linux, 16 on 32-bit. +type ifreqData struct { + name [ifNameSize]byte + data unsafe.Pointer + padding [8 + unsafe.Sizeof(uintptr(0))]byte +} + +// Ioctl makes req on a fresh socket, as tnl_get_ioctl and tnl_gen_ioctl +// do. The kernel writes into a copy of arg SpillWindow bytes longer, so a +// reply larger than arg lands in Go memory Live owns and comes back as +// spill instead of corrupting the heap. +func (l Live) Ioctl(family int, req uint32, name string, arg []byte) (spill []byte, err error) { + if !knownReq(req) || len(arg) == 0 || len(arg) > maxArg { + return nil, ErrRequest + } + fd, err := unix.Socket(family, unix.SOCK_DGRAM|unix.SOCK_CLOEXEC, 0) + if err != nil { + return nil, &SocketError{Err: err} + } + defer func() { + if cerr := unix.Close(fd); cerr != nil && err == nil { + err = cerr + } + }() + buf := make([]byte, len(arg)+SpillWindow) + copy(buf, arg) + for i := len(arg); i < len(buf); i++ { + buf[i] = spillFill + } + var ifr ifreqData + copy(ifr.name[:], IfName(name)) + ifr.data = unsafe.Pointer(&buf[0]) + _, _, errno := unix.Syscall(unix.SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(unsafe.Pointer(&ifr))) + runtime.KeepAlive(buf) + if errno != 0 { + return nil, errno + } + copy(arg, buf) + return spillOf(buf[len(arg):]), nil +} + +// spillOf is what the kernel wrote into a window past an argument that was +// filled with spillFill: the window up to its last byte that is not +// spillFill, nil when there is none. The kernel copies its reply from the +// argument's start, so its write is a prefix of the window; a reply ending +// in spillFill bytes is cut short by them. +func spillOf(w []byte) []byte { + for i := len(w) - 1; i >= 0; i-- { + if w[i] != spillFill { + return append([]byte(nil), w[:i+1]...) + } + } + return nil +} + +func (l Live) sysRoot() string { + if l.SysRoot != "" { + return l.SysRoot + } + return "/sys" +} + +func (l Live) procRoot() string { + if l.ProcRoot != "" { + return l.ProcRoot + } + return "/proc" +} + +// ReadProp reads /sys/class/net/DEV/PROP under an os.Root at SysRoot: the +// class/net entries are symlinks into devices/, which stay inside it. A +// name with a slash, or "." or "..", is ENOENT, as no device has one. +func (l Live) ReadProp(dev, prop string) (string, error) { + if !plainName(dev) || !plainName(prop) { + return "", unix.ENOENT + } + b, err := l.readSys(path.Join("class/net", dev, prop)) + if err != nil { + return "", errnoOf(err) + } + return string(b), nil +} + +func (l Live) readSys(name string) (b []byte, err error) { + r, err := os.OpenRoot(l.sysRoot()) + if err != nil { + return nil, err + } + defer closeInto(r, &err) + return r.ReadFile(name) +} + +// plainName is a single path element. +func plainName(s string) bool { + return s != "" && s != "." && s != ".." && path.Base(s) == s && s[0] != '/' +} + +// TunFDs is show_processes' walk: /proc/[0-9]*/fd/[0-9]* in directory +// order (glob with GLOB_NOSORT), the caller's own pid skipped, the +// descriptors whose link is /dev/net/tun kept with their fdinfo and their +// process's comm. A process or descriptor that goes away mid-walk is +// skipped; `ip` prints perror for those, which no recording reproduces. +func (l Live) TunFDs() (_ []TunFD, err error) { + r, err := os.OpenRoot(l.procRoot()) + if err != nil { + return nil, err + } + defer closeInto(r, &err) + pids, err := readDirNames(r, ".") + if err != nil { + return nil, err + } + self := os.Getpid() + out := []TunFD{} + for _, p := range pids { + pid, ok := leadingInt(p) + if !ok || pid == self { + continue + } + fds, err := readDirNames(r, p+"/fd") + if err != nil { + continue + } + for _, f := range fds { + fd, ok := leadingInt(f) + if !ok { + continue + } + link, err := r.Readlink(p + "/fd/" + f) + if err != nil || link != tunDev { + continue + } + info, err := r.ReadFile(p + "/fdinfo/" + strconv.Itoa(fd)) + if err != nil { + continue + } + t := TunFD{Pid: pid, FD: fd, FdInfo: string(info)} + if comm, err := r.ReadFile(p + "/comm"); err == nil { + t.Comm = string(comm) + } else { + t.NoComm = true + } + out = append(out, t) + } + } + return out, nil +} + +// readDirNames is a directory's names unsorted, in the order readdir +// returns them, as glob's GLOB_NOSORT leaves them. +func readDirNames(r *os.Root, dir string) (_ []string, err error) { + f, err := r.Open(dir) + if err != nil { + return nil, err + } + defer closeInto(f, &err) + names, err := f.Readdirnames(-1) + if err != nil && !errors.Is(err, io.EOF) { + return nil, err + } + return names, nil +} + +// leadingInt is sscanf's %d on a name glob's [0-9]* matched: the leading +// digits, which must be there. +func leadingInt(s string) (int, bool) { + n := 0 + for n < len(s) && s[n] >= '0' && s[n] <= '9' { + n++ + } + if n == 0 { + return 0, false + } + v, err := strconv.Atoi(s[:n]) + return v, err == nil +} + +// closeInto closes c, reporting its error through *err unless an earlier +// one is already there. +func closeInto(c io.Closer, err *error) { + if cerr := c.Close(); cerr != nil && *err == nil { + *err = cerr + } +} diff --git a/internal/tnlsys/snapshot.go b/internal/tnlsys/snapshot.go new file mode 100644 index 000000000..2a4ca7960 --- /dev/null +++ b/internal/tnlsys/snapshot.go @@ -0,0 +1,221 @@ +package tnlsys + +import ( + "bytes" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "os" + + "golang.org/x/sys/unix" +) + +// IoctlRec is one ioctl `ip` made: what it passed and what came back. +// In, Out and Spill are hex. Out is absent when the call failed and wrote +// nothing; Spill is what the kernel wrote past the argument, absent for +// nothing. +type IoctlRec struct { + Family int `json:"family"` + Req string `json:"req"` + Name string `json:"name"` + In string `json:"in"` + Out string `json:"out,omitempty"` + Spill string `json:"spill,omitempty"` + Errno unix.Errno `json:"errno,omitempty"` +} + +// PropRec is one sysfs property: its content, or the errno opening or +// reading it failed with. +type PropRec struct { + Dev string `json:"dev"` + Prop string `json:"prop"` + Value string `json:"value,omitempty"` + Errno unix.Errno `json:"errno,omitempty"` +} + +// Run is the traced `ip` run a snapshot came from, kept so a capture can +// check the recording saw the run the capture did. +type Run struct { + Argv []string `json:"argv"` + RC int `json:"rc"` + Stdout string `json:"stdout"` + Stderr string `json:"stderr"` +} + +// Snapshot is a recorded Sys: the JSON sidecar a capture row carries. +// A question it holds no answer for is ErrNotRecorded. +type Snapshot struct { + Ioctls []IoctlRec `json:"ioctls,omitempty"` + Props []PropRec `json:"props,omitempty"` + // Fds is nil when the walk was not recorded, and an empty slice + // when it found nothing. + Fds *[]TunFD `json:"tunfds,omitempty"` + Run *Run `json:"run,omitempty"` + + ioctls []ioctlEntry +} + +// ioctlEntry is an IoctlRec decoded. +type ioctlEntry struct { + family int + req uint32 + name string + in, out, spill []byte + errno unix.Errno +} + +// Load reads a snapshot file. +func Load(path string) (*Snapshot, error) { + b, err := os.ReadFile(path) + if err != nil { + return nil, fmt.Errorf("tnlsys: %w", err) + } + return Parse(b) +} + +// Parse decodes a snapshot, refusing unknown fields, bad hex and unknown +// requests, so a hand-edited sidecar fails loudly. +func Parse(b []byte) (*Snapshot, error) { + var s Snapshot + d := json.NewDecoder(bytes.NewReader(b)) + d.DisallowUnknownFields() + if err := d.Decode(&s); err != nil { + return nil, fmt.Errorf("tnlsys: snapshot: %w", err) + } + if d.More() { + return nil, errors.New("tnlsys: snapshot: trailing data") + } + if err := s.decode(); err != nil { + return nil, err + } + return &s, nil +} + +func (s *Snapshot) decode() error { + s.ioctls = make([]ioctlEntry, 0, len(s.Ioctls)) + for i, r := range s.Ioctls { + e, err := decodeIoctl(r) + if err != nil { + return fmt.Errorf("tnlsys: snapshot ioctl %d: %w", i, err) + } + s.ioctls = append(s.ioctls, e) + } + return nil +} + +func decodeIoctl(r IoctlRec) (ioctlEntry, error) { + req, ok := reqByName(r.Req) + if !ok { + return ioctlEntry{}, fmt.Errorf("unknown request %q", r.Req) + } + e := ioctlEntry{family: r.Family, req: req, name: IfName(r.Name), errno: r.Errno} + var err error + if e.in, err = hex.DecodeString(r.In); err != nil { + return ioctlEntry{}, fmt.Errorf("in: %w", err) + } + if e.out, err = hex.DecodeString(r.Out); err != nil { + return ioctlEntry{}, fmt.Errorf("out: %w", err) + } + if e.spill, err = hex.DecodeString(r.Spill); err != nil { + return ioctlEntry{}, fmt.Errorf("spill: %w", err) + } + if len(e.out) > len(e.in) { + return ioctlEntry{}, fmt.Errorf("out is %d bytes, in %d", len(e.out), len(e.in)) + } + return e, nil +} + +// Marshal is the snapshot as the sidecar file holds it. +func (s *Snapshot) Marshal() ([]byte, error) { + b, err := json.MarshalIndent(s, "", " ") + if err != nil { + return nil, fmt.Errorf("tnlsys: snapshot: %w", err) + } + return append(b, '\n'), nil +} + +// AddIoctl records one ioctl, as Trace and tests build a snapshot. +func (s *Snapshot) AddIoctl(family int, req uint32, name string, in, out, spill []byte, errno unix.Errno) { + r := IoctlRec{ + Family: family, Req: ReqName(req), Name: IfName(name), + In: hex.EncodeToString(in), Out: hex.EncodeToString(out), + Spill: hex.EncodeToString(spill), Errno: errno, + } + s.Ioctls = append(s.Ioctls, r) + s.ioctls = append(s.ioctls, ioctlEntry{ + family: family, req: req, name: r.Name, + in: bytes.Clone(in), out: bytes.Clone(out), spill: bytes.Clone(spill), errno: errno, + }) +} + +// Ioctl answers from the recording: the entry with the same family, +// request, name and input bytes. +func (s *Snapshot) Ioctl(family int, req uint32, name string, arg []byte) ([]byte, error) { + name = IfName(name) + for _, e := range s.ioctls { + if e.family != family || e.req != req || e.name != name || !bytes.Equal(e.in, arg) { + continue + } + copy(arg, e.out) + if e.errno != 0 { + return nil, e.errno + } + return bytes.Clone(e.spill), nil + } + return nil, fmt.Errorf("%w: %s %s family %d", ErrNotRecorded, ReqName(req), name, family) +} + +// ReadProp answers from the recording. +func (s *Snapshot) ReadProp(dev, prop string) (string, error) { + for _, p := range s.Props { + if p.Dev != dev || p.Prop != prop { + continue + } + if p.Errno != 0 { + return "", p.Errno + } + return p.Value, nil + } + return "", fmt.Errorf("%w: prop %s/%s", ErrNotRecorded, dev, prop) +} + +// TunFDs answers from the recording. +func (s *Snapshot) TunFDs() ([]TunFD, error) { + if s.Fds == nil { + return nil, fmt.Errorf("%w: tun descriptors", ErrNotRecorded) + } + return append([]TunFD(nil), (*s.Fds)...), nil +} + +// TunProps are the sysfs files print_tuntap reads. +var TunProps = []string{"tun_flags", "owner", "group"} + +// RecordProps reads TunProps of every tun device in devs through sys into +// s, failures as their errno. An entry with no tun_flags file (ENOENT, or +// ENOTDIR for a file such as bonding_masters) is not a tun device and is +// skipped: print_tuntap reads the files only for links of kind "tun". +func (s *Snapshot) RecordProps(sys Sys, devs []string) { + for _, d := range devs { + if _, err := sys.ReadProp(d, TunProps[0]); errors.Is(err, unix.ENOENT) || errors.Is(err, unix.ENOTDIR) { + continue + } + for _, p := range TunProps { + v, err := sys.ReadProp(d, p) + r := PropRec{Dev: d, Prop: p, Value: v} + if err != nil { + r.Value, r.Errno = "", errnoOf(err) + } + s.Props = append(s.Props, r) + } + } +} + +// errnoOf is err's errno, EIO for an error that carries none. +func errnoOf(err error) unix.Errno { + var e unix.Errno + if errors.As(err, &e) { + return e + } + return unix.EIO +} diff --git a/internal/tnlsys/tnlsys.go b/internal/tnlsys/tnlsys.go new file mode 100644 index 000000000..19366c5fc --- /dev/null +++ b/internal/tnlsys/tnlsys.go @@ -0,0 +1,169 @@ +// Package tnlsys answers the questions `ip tunnel` and `ip tuntap` ask the +// kernel outside netlink, live or from a recorded snapshot. +// +// iproute2 7.2.0's `ip tunnel show` dumps the links over rtnetlink, then +// asks each tunnel for its parameters with a SIOCGETTUNNEL ioctl +// (ip/tunnel.c tnl_get_ioctl), an isatap tunnel for its routers with +// SIOCGETPRL and a sit tunnel for its 6rd prefix with SIOCGET6RD. +// `ip tuntap show` reads /sys/class/net/DEV/{tun_flags,owner,group} +// (lib/utils.c read_prop) and, under -d, walks /proc for the processes +// holding /dev/net/tun (ip/iptuntap.c show_processes). nlmon sees none of +// that, and strace does not dump the struct behind ifr_data, so a netlink +// capture alone cannot replay these objects. +// +// Sys is the seam: Live asks the kernel, Snapshot answers from a JSON +// sidecar, and Trace (tnlsnap) records one by running the real `ip` under +// ptrace, so a snapshot holds exactly the ioctls `ip` made, each keyed by +// the bytes it passed in. That matters because the kernel's answer for a +// fallback device (gre0, ip6tnl0, ...) depends on those bytes: it looks up +// the tunnel the passed parameters describe (net/ipv4/ip_tunnel.c +// ip_tunnel_ctl, net/ipv6/ip6_tunnel.c ip6_tnl_siocdevprivate). +// +// The package has no goip imports: goip and tnlsnap both use it. +package tnlsys + +import ( + "errors" + "fmt" + "strings" +) + +// The ioctls `ip` reads tunnels with (include/uapi/linux/if_tunnel.h: +// SIOCDEVPRIVATE plus 0, 4 and 8). +const ( + SIOCGETTUNNEL uint32 = 0x89F0 + SIOCGETPRL uint32 = 0x89F4 + SIOCGET6RD uint32 = 0x89F8 +) + +// The C struct sizes those ioctls carry. +const ( + // IPTunnelParmSize is sizeof(struct ip_tunnel_parm): name[16], link, + // i_flags, o_flags, i_key, o_key and a 20-byte struct iphdr. + IPTunnelParmSize = 52 + // IP6TnlParm2Size is sizeof(struct ip6_tnl_parm2). + IP6TnlParm2Size = 76 + // TunnelPRLSize is sizeof(struct ip_tunnel_prl). + TunnelPRLSize = 16 + // Tunnel6RDSize is sizeof(struct ip_tunnel_6rd). + Tunnel6RDSize = 24 +) + +// SpillWindow is how many bytes past an ioctl's argument Live and Trace +// watch. A kernel that answers with a larger struct than `ip` passed +// writes past the buffer: ip6gre copies a 76-byte ip6_tnl_parm2 whatever +// buffer it was given, so `ip tunnel show` naming an ip6gre device has it +// write 24 bytes past a 52-byte ip_tunnel_parm. +const SpillWindow = 64 + +// maxArg bounds an ioctl argument: a SIOCGETPRL buffer is 16 bytes per +// router, and `ip` asks for 16. +const maxArg = 64 << 10 + +// ifNameSize is IFNAMSIZ. +const ifNameSize = 16 + +// ErrNotRecorded is a snapshot asked a question its recording never saw. +// It is a replay error, not a kernel answer: a recorded failure comes back +// as its errno. +var ErrNotRecorded = errors.New("tnlsys: not in the snapshot") + +// ErrRequest is an ioctl Live refuses to make: not one of the three gets, +// or an argument of no or absurd size. +var ErrRequest = errors.New("tnlsys: ioctl request refused") + +// SocketError is socket(2) failing before the ioctl, which `ip` reports as +// "create socket failed: %s". +type SocketError struct{ Err error } + +func (e *SocketError) Error() string { return "tnlsys: socket: " + e.Err.Error() } + +func (e *SocketError) Unwrap() error { return e.Err } + +// TunFD is one /dev/net/tun descriptor show_processes finds: the process +// and descriptor numbers, the descriptor's fdinfo text (whose "iff:" line +// names the device), and the process's comm file, NoComm when it could not +// be read (get_task_name failing, which `ip` prints as ""). +type TunFD struct { + Pid int `json:"pid"` + FD int `json:"fd"` + FdInfo string `json:"fdinfo"` + Comm string `json:"comm,omitempty"` + NoComm bool `json:"nocomm,omitempty"` +} + +// Sys is what `ip tunnel` and `ip tuntap` ask outside netlink. +type Sys interface { + // Ioctl makes req on a SOCK_DGRAM socket of family for the device + // name (cut as strlcpy into ifr_name cuts it), with arg as ifr_data. + // arg is updated in place. spill is what the kernel wrote past arg, + // nil for nothing. A kernel refusal is its unix.Errno. + Ioctl(family int, req uint32, name string, arg []byte) (spill []byte, err error) + // ReadProp is the content of /sys/class/net/DEV/PROP, or its errno. + ReadProp(dev, prop string) (string, error) + // TunFDs is every /dev/net/tun descriptor in /proc, in directory + // order, the caller's own excluded. + TunFDs() ([]TunFD, error) +} + +// ReqName names a request for a snapshot. +func ReqName(req uint32) string { + switch req { + case SIOCGETTUNNEL: + return "SIOCGETTUNNEL" + case SIOCGETPRL: + return "SIOCGETPRL" + case SIOCGET6RD: + return "SIOCGET6RD" + } + return fmt.Sprintf("%#x", req) +} + +// reqByName is ReqName's inverse for the three known requests. +func reqByName(s string) (uint32, bool) { + for _, r := range []uint32{SIOCGETTUNNEL, SIOCGETPRL, SIOCGET6RD} { + if ReqName(r) == s { + return r, true + } + } + return 0, false +} + +// knownReq is whether req is one of the three gets. +func knownReq(req uint32) bool { + _, ok := reqByName(ReqName(req)) + return ok +} + +// IfName is name as strlcpy(ifr.ifr_name, name, IFNAMSIZ) leaves it: cut +// at a NUL and at IFNAMSIZ-1 bytes. +func IfName(name string) string { + if i := strings.IndexByte(name, 0); i >= 0 { + name = name[:i] + } + if len(name) > ifNameSize-1 { + name = name[:ifNameSize-1] + } + return name +} + +// ArgSize is the argument size `ip` passes for req: the parm struct of +// family for SIOCGETTUNNEL, 16 routers for SIOCGETPRL, one ip_tunnel_6rd +// for SIOCGET6RD. +func ArgSize(family int, req uint32) int { + switch req { + case SIOCGETTUNNEL: + if family == afInet6 { + return IP6TnlParm2Size + } + return IPTunnelParmSize + case SIOCGETPRL: + return 16 * TunnelPRLSize + case SIOCGET6RD: + return Tunnel6RDSize + } + return 0 +} + +// afInet6 is AF_INET6, spelled here so the package builds off Linux. +const afInet6 = 10 diff --git a/internal/tnlsys/tnlsys_test.go b/internal/tnlsys/tnlsys_test.go new file mode 100644 index 000000000..a78dfbe1b --- /dev/null +++ b/internal/tnlsys/tnlsys_test.go @@ -0,0 +1,585 @@ +package tnlsys + +import ( + "bytes" + "encoding/hex" + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "slices" + "strings" + "testing" + + "golang.org/x/sys/unix" +) + +// helperEnv makes the test binary, run as a child, the command TestTrace +// traces. +const helperEnv = "TNLSYS_TRACE_HELPER" + +func TestMain(m *testing.M) { + if os.Getenv(helperEnv) == "1" { + os.Exit(traceHelper()) + } + os.Exit(m.Run()) +} + +// traceHelper makes two tunnel ioctls and one other, writes to both +// streams and exits 3. +func traceHelper() int { + var l Live + a := make([]byte, IPTunnelParmSize) + copy(a, "lo") + _, err1 := l.Ioctl(unix.AF_INET, SIOCGETTUNNEL, "lo", a) + b := make([]byte, Tunnel6RDSize) + _, err2 := l.Ioctl(unix.AF_INET, SIOCGET6RD, "nosuch0", b) + fmt.Printf("%v|%v\n", err1, err2) + fmt.Fprint(os.Stderr, "helper stderr") + return 3 +} + +func parm(name string, fill byte) []byte { + b := bytes.Repeat([]byte{fill}, IPTunnelParmSize) + copy(b, name+"\x00") + return b +} + +// fixture is a snapshot built the way Trace builds one. +func fixture() *Snapshot { + var s Snapshot + s.AddIoctl(unix.AF_INET, SIOCGETTUNNEL, "gre1", parm("", 0), parm("gre1", 1), nil, 0) + s.AddIoctl(unix.AF_INET, SIOCGETTUNNEL, "gre0", parm("", 0), parm("gre0", 2), nil, 0) + s.AddIoctl(unix.AF_INET, SIOCGETTUNNEL, "gre0", parm("", 7), parm("gre9", 3), nil, 0) + s.AddIoctl(unix.AF_INET6, SIOCGETTUNNEL, "gre1", parm("", 0), parm("gre1", 4), nil, 0) + s.AddIoctl(unix.AF_INET, SIOCGETTUNNEL, "gone0", parm("", 0), nil, nil, unix.ENODEV) + s.AddIoctl(unix.AF_INET, SIOCGETTUNNEL, "ip6gre1", parm("", 0), parm("ip6gre1", 5), []byte{9, 9}, 0) + s.AddIoctl(unix.AF_INET, SIOCGETPRL, "isa1", make([]byte, 16*TunnelPRLSize), bytes.Repeat([]byte{6}, 16*TunnelPRLSize), nil, 0) + s.Props = []PropRec{ + {Dev: "tap0", Prop: "tun_flags", Value: "0x1002\n"}, + {Dev: "tap0", Prop: "owner", Value: "-1\n"}, + {Dev: "tap1", Prop: "group", Errno: unix.ENOENT}, + } + fds := []TunFD{{Pid: 10, FD: 3, FdInfo: "iff:\ttap0\n", Comm: "holder\n"}} + s.Fds = &fds + return &s +} + +// roundTrip is s through its JSON form. +func roundTrip(t *testing.T, s *Snapshot) *Snapshot { + t.Helper() + b, err := s.Marshal() + if err != nil { + t.Fatal(err) + } + got, err := Parse(b) + if err != nil { + t.Fatalf("Parse(%s): %v", b, err) + } + return got +} + +func TestTnlsys(t *testing.T) { + type ask struct { + family int + req uint32 + name string + in []byte + } + tests := []struct { + description string + snap func(t *testing.T) *Snapshot + ask ask + wantOut []byte + wantSpill []byte + wantErr error + }{ + { + description: "positive: an ioctl after a JSON round trip answers its recorded output", + snap: func(t *testing.T) *Snapshot { return roundTrip(t, fixture()) }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "gre1", parm("", 0)}, + wantOut: parm("gre1", 1), + }, + { + description: "positive: a fallback device answers per input bytes", + snap: func(t *testing.T) *Snapshot { return roundTrip(t, fixture()) }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "gre0", parm("", 7)}, + wantOut: parm("gre9", 3), + }, + { + description: "positive: the same fallback device with zero input answers itself", + snap: func(t *testing.T) *Snapshot { return fixture() }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "gre0", parm("", 0)}, + wantOut: parm("gre0", 2), + }, + { + description: "positive: the kernel's write past the argument comes back as spill", + snap: func(t *testing.T) *Snapshot { return roundTrip(t, fixture()) }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "ip6gre1", parm("", 0)}, + wantOut: parm("ip6gre1", 5), + wantSpill: []byte{9, 9}, + }, + { + description: "positive: a PRL read of 16 routers", + snap: func(t *testing.T) *Snapshot { return roundTrip(t, fixture()) }, + ask: ask{unix.AF_INET, SIOCGETPRL, "isa1", make([]byte, 16*TunnelPRLSize)}, + wantOut: bytes.Repeat([]byte{6}, 16*TunnelPRLSize), + }, + { + description: "negative: a recorded errno comes back as itself, the argument untouched", + snap: func(t *testing.T) *Snapshot { return roundTrip(t, fixture()) }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "gone0", parm("", 0)}, + wantOut: parm("", 0), + wantErr: unix.ENODEV, + }, + { + description: "negative: input bytes never recorded are not recorded, not ENODEV", + snap: func(t *testing.T) *Snapshot { return fixture() }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "gre1", parm("", 1)}, + wantOut: parm("", 1), + wantErr: ErrNotRecorded, + }, + { + description: "negative: an unknown device is not recorded", + snap: func(t *testing.T) *Snapshot { return fixture() }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "nosuch", parm("", 0)}, + wantOut: parm("", 0), + wantErr: ErrNotRecorded, + }, + { + description: "boundary: an empty snapshot answers nothing", + snap: func(t *testing.T) *Snapshot { + s, err := Parse([]byte("{}")) + if err != nil { + t.Fatal(err) + } + return s + }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "gre1", parm("", 0)}, + wantOut: parm("", 0), + wantErr: ErrNotRecorded, + }, + { + description: "boundary: an argument one byte short of the recorded input misses", + snap: func(t *testing.T) *Snapshot { return fixture() }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "gre1", parm("", 0)[:IPTunnelParmSize-1]}, + wantOut: parm("", 0)[:IPTunnelParmSize-1], + wantErr: ErrNotRecorded, + }, + { + description: "corner: v4 and v6 under one name are kept apart", + snap: func(t *testing.T) *Snapshot { return roundTrip(t, fixture()) }, + ask: ask{unix.AF_INET6, SIOCGETTUNNEL, "gre1", parm("", 0)}, + wantOut: parm("gre1", 4), + }, + { + description: "corner: a name longer than IFNAMSIZ-1 is cut as strlcpy cuts it", + snap: func(t *testing.T) *Snapshot { + var s Snapshot + s.AddIoctl(unix.AF_INET, SIOCGETTUNNEL, "abcdefghijklmnopq", parm("", 0), parm("x", 1), nil, 0) + return roundTrip(t, &s) + }, + ask: ask{unix.AF_INET, SIOCGETTUNNEL, "abcdefghijklmnoXYZ", parm("", 0)}, + wantOut: parm("x", 1), + }, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + s := tc.snap(t) + arg := bytes.Clone(tc.ask.in) + spill, err := s.Ioctl(tc.ask.family, tc.ask.req, tc.ask.name, arg) + if !errors.Is(err, tc.wantErr) || (tc.wantErr == nil && err != nil) { + t.Fatalf("err = %v, want %v", err, tc.wantErr) + } + if !bytes.Equal(arg, tc.wantOut) { + t.Errorf("arg = %x\nwant %x", arg, tc.wantOut) + } + if !bytes.Equal(spill, tc.wantSpill) { + t.Errorf("spill = %x, want %x", spill, tc.wantSpill) + } + }) + } +} + +func TestSnapshotProps(t *testing.T) { + tests := []struct { + description string + dev, prop string + want string + wantErr error + }{ + {"positive: a recorded value", "tap0", "tun_flags", "0x1002\n", nil}, + {"positive: owner -1 is kept as text", "tap0", "owner", "-1\n", nil}, + {"negative: a recorded open failure is its errno", "tap1", "group", "", unix.ENOENT}, + {"negative: an unrecorded prop", "tap0", "group", "", ErrNotRecorded}, + {"corner: an unrecorded device", "tap9", "owner", "", ErrNotRecorded}, + } + s := roundTrip(t, fixture()) + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + got, err := s.ReadProp(tc.dev, tc.prop) + if !errors.Is(err, tc.wantErr) || (tc.wantErr == nil && err != nil) { + t.Fatalf("err = %v, want %v", err, tc.wantErr) + } + if got != tc.want { + t.Errorf("value = %q, want %q", got, tc.want) + } + }) + } +} + +func TestSnapshotTunFDs(t *testing.T) { + empty := []TunFD{} + tests := []struct { + description string + fds *[]TunFD + want []TunFD + wantErr error + }{ + {"positive: the recorded walk", fixture().Fds, []TunFD{{Pid: 10, FD: 3, FdInfo: "iff:\ttap0\n", Comm: "holder\n"}}, nil}, + {"boundary: a recorded walk that found nothing", &empty, []TunFD{}, nil}, + {"negative: no walk recorded", nil, nil, ErrNotRecorded}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + s := roundTrip(t, &Snapshot{Fds: tc.fds}) + got, err := s.TunFDs() + if !errors.Is(err, tc.wantErr) || (tc.wantErr == nil && err != nil) { + t.Fatalf("err = %v, want %v", err, tc.wantErr) + } + if !slices.Equal(got, tc.want) { + t.Errorf("fds = %+v, want %+v", got, tc.want) + } + }) + } +} + +func TestParseRefuses(t *testing.T) { + tests := []struct { + description string + json string + want string + }{ + {"negative: malformed hex in", `{"ioctls":[{"family":2,"req":"SIOCGETTUNNEL","name":"x","in":"zz"}]}`, "in: encoding/hex"}, + {"negative: odd-length hex out", `{"ioctls":[{"family":2,"req":"SIOCGETTUNNEL","name":"x","in":"00","out":"0"}]}`, "out: encoding/hex"}, + {"negative: an unknown request", `{"ioctls":[{"family":2,"req":"SIOCADDTUNNEL","name":"x","in":""}]}`, `unknown request "SIOCADDTUNNEL"`}, + {"negative: out longer than in", `{"ioctls":[{"family":2,"req":"SIOCGET6RD","name":"x","in":"00","out":"0000"}]}`, "out is 2 bytes, in 1"}, + {"negative: a negative errno", `{"props":[{"dev":"a","prop":"b","errno":-1}]}`, "cannot unmarshal"}, + {"negative: an unknown field", `{"ioctl":[]}`, "unknown field"}, + {"negative: trailing data", `{} {}`, "trailing data"}, + {"boundary: not JSON", ``, "EOF"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + _, err := Parse([]byte(tc.json)) + if err == nil || !strings.Contains(err.Error(), tc.want) { + t.Fatalf("err = %v, want it to contain %q", err, tc.want) + } + }) + } +} + +func TestIfNameAndArgSize(t *testing.T) { + tests := []struct { + description string + got, want any + }{ + {"positive: a short name is kept", IfName("gre1"), "gre1"}, + {"boundary: fifteen bytes are kept", IfName("abcdefghijklmno"), "abcdefghijklmno"}, + {"boundary: sixteen bytes lose the last", IfName("abcdefghijklmnop"), "abcdefghijklmno"}, + {"corner: a NUL ends the name", IfName("ab\x00cd"), "ab"}, + {"positive: v4 parm size", ArgSize(unix.AF_INET, SIOCGETTUNNEL), IPTunnelParmSize}, + {"positive: v6 parm size", ArgSize(unix.AF_INET6, SIOCGETTUNNEL), IP6TnlParm2Size}, + {"positive: PRL buffer is 16 routers", ArgSize(unix.AF_INET, SIOCGETPRL), 256}, + {"positive: 6rd size", ArgSize(unix.AF_INET, SIOCGET6RD), Tunnel6RDSize}, + {"negative: an unknown request has no size", ArgSize(unix.AF_INET, 0x89F1), 0}, + {"negative: an unknown request is named in hex", ReqName(0x89F1), "0x89f1"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if tc.got != tc.want { + t.Errorf("got %v, want %v", tc.got, tc.want) + } + }) + } +} + +func TestLiveIoctl(t *testing.T) { + tests := []struct { + description string + family int + req uint32 + name string + arg []byte + wantErr error + wantSocket bool + }{ + {"negative: no such device", unix.AF_INET, SIOCGETTUNNEL, "nosuch0", parm("", 0), unix.ENODEV, false}, + {"negative: a write request is refused before any socket", unix.AF_INET, 0x89F1, "lo", parm("", 0), ErrRequest, false}, + {"boundary: an empty argument is refused", unix.AF_INET, SIOCGETTUNNEL, "lo", nil, ErrRequest, false}, + {"boundary: an argument over 64 KiB is refused", unix.AF_INET, SIOCGETPRL, "lo", make([]byte, maxArg+1), ErrRequest, false}, + {"corner: a family with no sockets fails at socket(2)", 9999, SIOCGETTUNNEL, "lo", parm("", 0), unix.EAFNOSUPPORT, true}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + in := bytes.Clone(tc.arg) + spill, err := Live{}.Ioctl(tc.family, tc.req, tc.name, tc.arg) + if !errors.Is(err, tc.wantErr) { + t.Fatalf("err = %v, want %v", err, tc.wantErr) + } + var se *SocketError + if errors.As(err, &se) != tc.wantSocket { + t.Errorf("SocketError = %v, want %v", errors.As(err, &se), tc.wantSocket) + } + if spill != nil || !bytes.Equal(in, tc.arg) { + t.Errorf("a failed ioctl changed its argument or spilled: %x", spill) + } + }) + } +} + +func TestSpillOf(t *testing.T) { + fill := bytes.Repeat([]byte{spillFill}, 4) + tests := []struct { + description string + window []byte + want []byte + }{ + {"positive: an untouched window is no spill", fill, nil}, + {"positive: a written prefix is the spill", []byte{0, 6, spillFill, spillFill}, []byte{0, 6}}, + {"positive: the whole window written", []byte{1, 2, 3, 4}, []byte{1, 2, 3, 4}}, + {"boundary: an empty window", nil, nil}, + {"boundary: one byte written", []byte{0, spillFill, spillFill, spillFill}, []byte{0}}, + {"corner: a written spillFill inside the reply is kept", []byte{spillFill, 0, spillFill, spillFill}, []byte{spillFill, 0}}, + {"corner: the last byte written", []byte{spillFill, spillFill, spillFill, 1}, []byte{spillFill, spillFill, spillFill, 1}}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := spillOf(tc.window); !bytes.Equal(got, tc.want) { + t.Errorf("spillOf = %x, want %x", got, tc.want) + } + }) + } +} + +// writeTree makes files (content) and symlinks ("-> target") under root. +func writeTree(t *testing.T, root string, tree map[string]string) { + t.Helper() + for name, v := range tree { + p := filepath.Join(root, name) + if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil { + t.Fatal(err) + } + if target, ok := strings.CutPrefix(v, "-> "); ok { + if err := os.Symlink(target, p); err != nil { + t.Fatal(err) + } + continue + } + if err := os.WriteFile(p, []byte(v), 0o600); err != nil { + t.Fatal(err) + } + } +} + +func TestLiveReadProp(t *testing.T) { + root := t.TempDir() + writeTree(t, root, map[string]string{ + "devices/virtual/net/tap0/tun_flags": "0x1002\n", + "devices/virtual/net/tap0/owner": "-1\n", + "class/net/tap0": "-> ../../devices/virtual/net/tap0", + "class/net/esc": "-> ../../../", + }) + tests := []struct { + description string + dev, prop string + want string + wantErr error + }{ + {"positive: through the class/net symlink", "tap0", "tun_flags", "0x1002\n", nil}, + {"positive: owner", "tap0", "owner", "-1\n", nil}, + {"negative: a missing prop", "tap0", "group", "", unix.ENOENT}, + {"negative: a missing device", "tap9", "owner", "", unix.ENOENT}, + {"corner: a dev with a slash never leaves class/net", "../../devices/virtual/net/tap0", "owner", "", unix.ENOENT}, + {"corner: a dev of .. is refused", "..", "owner", "", unix.ENOENT}, + {"corner: a symlink out of the root is refused", "esc", "owner", "", nil}, + } + l := Live{SysRoot: root} + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + got, err := l.ReadProp(tc.dev, tc.prop) + if tc.wantErr == nil && tc.want == "" { + if err == nil { + t.Fatalf("read %q out of the root", got) + } + return + } + if !errors.Is(err, tc.wantErr) || (tc.wantErr == nil && err != nil) { + t.Fatalf("err = %v, want %v", err, tc.wantErr) + } + if got != tc.want { + t.Errorf("value = %q, want %q", got, tc.want) + } + }) + } +} + +func TestLiveTunFDs(t *testing.T) { + root := t.TempDir() + self := fmt.Sprint(os.Getpid()) + writeTree(t, root, map[string]string{ + "100/fd/3": "-> /dev/net/tun", + "100/fd/4": "-> /dev/null", + "100/fdinfo/3": "pos:\t0\niff:\ttap0\n", + "100/comm": "holder\n", + "102/fd/5": "-> /dev/net/tun", + "102/fdinfo/5": "iff:\ttun1\n", + "103/fd/6": "-> /dev/net/tun", + "104/fd/7": "-> /dev/net/tunnel", + "12x/fd/8": "-> /dev/net/tun", + "12x/fdinfo/8": "iff:\ttap0\n", + "self/fd/9": "-> /dev/net/tun", + self + "/fd/1": "-> /dev/net/tun", + self + "/fdinfo/1": "iff:\ttap0\n", + "100/fd/x1": "-> /dev/net/tun", + "105/fd/2a": "-> /dev/net/tun", + "105/fdinfo/2": "iff:\tq\n", + "105/comm": "a\n", + }) + got, err := Live{ProcRoot: root}.TunFDs() + if err != nil { + t.Fatal(err) + } + slices.SortFunc(got, func(a, b TunFD) int { return a.Pid*100 + a.FD - b.Pid*100 - b.FD }) + tests := []struct { + description string + want TunFD + }{ + {"corner: a name with leading digits scans as sscanf's %d", TunFD{Pid: 12, FD: 8, FdInfo: "iff:\ttap0\n", NoComm: true}}, + {"positive: a tun descriptor with fdinfo and comm", TunFD{Pid: 100, FD: 3, FdInfo: "pos:\t0\niff:\ttap0\n", Comm: "holder\n"}}, + {"negative: no comm file is NoComm", TunFD{Pid: 102, FD: 5, FdInfo: "iff:\ttun1\n", NoComm: true}}, + {"corner: an fd name with leading digits reads fdinfo by the number", TunFD{Pid: 105, FD: 2, FdInfo: "iff:\tq\n", Comm: "a\n"}}, + } + for i, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if i >= len(got) || got[i] != tc.want { + t.Errorf("walk = %+v, want %+v at %d", got, tc.want, i) + } + }) + } + t.Run("boundary: only those four; no fdinfo, another device, non-numeric names and self are skipped", func(t *testing.T) { + if len(got) != len(tests) { + t.Errorf("walk = %+v", got) + } + }) + t.Run("negative: a missing root is an error", func(t *testing.T) { + if _, err := (Live{ProcRoot: filepath.Join(root, "nope")}).TunFDs(); err == nil { + t.Error("no error") + } + }) +} + +func TestTrace(t *testing.T) { + t.Setenv(helperEnv, "1") + run, recs, err := Trace(&exec.Cmd{Path: os.Args[0], Args: []string{os.Args[0], "-test.run=^$"}}) + if errors.Is(err, unix.EPERM) { + t.Skipf("ptrace not permitted here: %v", err) + } + if err != nil { + t.Fatal(err) + } + in := parm("lo", 0) + tests := []struct { + description string + got, want any + }{ + {"positive: the exit status", run.RC, 3}, + {"positive: stdout is the helper's", run.Stdout, fmt.Sprintf("%v|%v\n", unix.EOPNOTSUPP, unix.ENODEV)}, + {"positive: stderr is the helper's", run.Stderr, "helper stderr"}, + {"positive: two tunnel ioctls, nothing else", len(recs), 2}, + {"positive: the first's family from its socket", recField(recs, 0, "family"), unix.AF_INET}, + {"positive: the first's input as passed", recField(recs, 0, "in"), hex.EncodeToString(in)}, + {"negative: the first failed EOPNOTSUPP, no output", recField(recs, 0, "errno+out"), fmt.Sprint(unix.EOPNOTSUPP) + "|"}, + {"negative: the second is ENODEV for its device", recField(recs, 1, "name+errno"), "nosuch0|" + fmt.Sprint(unix.ENODEV)}, + {"boundary: the 6rd input is 24 bytes", recField(recs, 1, "in"), strings.Repeat("00", Tunnel6RDSize)}, + {"corner: the argv is kept", len(run.Argv), 2}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if tc.got != tc.want { + t.Errorf("got %v, want %v (recs %+v)", tc.got, tc.want, recs) + } + }) + } +} + +func recField(recs []IoctlRec, i int, f string) any { + if i >= len(recs) { + return nil + } + r := recs[i] + switch f { + case "family": + return r.Family + case "in": + return r.In + case "errno+out": + return fmt.Sprint(r.Errno) + "|" + r.Out + case "name+errno": + return r.Name + "|" + fmt.Sprint(r.Errno) + } + return nil +} + +func TestLoad(t *testing.T) { + dir := t.TempDir() + b, err := fixture().Marshal() + if err != nil { + t.Fatal(err) + } + good := filepath.Join(dir, "tnlsys.out") + if err := os.WriteFile(good, b, 0o600); err != nil { + t.Fatal(err) + } + tests := []struct { + description string + path string + wantIoctls int + wantErr bool + }{ + {"positive: a marshaled snapshot loads whole", good, len(fixture().Ioctls), false}, + {"negative: a missing file", filepath.Join(dir, "nope"), 0, true}, + {"corner: a directory is not a snapshot", dir, 0, true}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + s, err := Load(tc.path) + if (err != nil) != tc.wantErr { + t.Fatalf("err = %v, want error %v", err, tc.wantErr) + } + if err == nil && len(s.Ioctls) != tc.wantIoctls { + t.Errorf("ioctls = %d, want %d", len(s.Ioctls), tc.wantIoctls) + } + }) + } +} + +func TestSocketError(t *testing.T) { + e := &SocketError{Err: unix.EAFNOSUPPORT} + tests := []struct { + description string + got, want any + }{ + {"positive: the message names socket", e.Error(), "tnlsys: socket: " + unix.EAFNOSUPPORT.Error()}, + {"positive: it unwraps to the errno", errors.Is(e, unix.EAFNOSUPPORT), true}, + {"negative: not another errno", errors.Is(e, unix.ENODEV), false}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if tc.got != tc.want { + t.Errorf("got %v, want %v", tc.got, tc.want) + } + }) + } +} diff --git a/internal/tnlsys/trace_linux_amd64.go b/internal/tnlsys/trace_linux_amd64.go new file mode 100644 index 000000000..c9ccd846c --- /dev/null +++ b/internal/tnlsys/trace_linux_amd64.go @@ -0,0 +1,342 @@ +package tnlsys + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + "os" + "os/exec" + "runtime" + "syscall" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "golang.org/x/sys/unix" +) + +// ifreqSize is sizeof(struct ifreq) on x86_64, and ifrDataOff the +// offset of ifr_data in it. +const ( + ifreqSize = 40 + ifrDataOff = 16 +) + +// syscallStop is the stop signal PTRACE_O_TRACESYSGOOD gives a syscall +// stop. +const syscallStop = syscall.SIGTRAP | 0x80 + +// Trace runs cmd under ptrace and records every tunnel ioctl it makes: +// family (from the socket(2) the descriptor came from), request, device +// name and the argument before and after, with what the kernel wrote past +// it. The run's stdout, stderr and status come back in Run; cmd's own +// Stdout, Stderr and SysProcAttr are replaced. Threads are followed. +func Trace(cmd *exec.Cmd) (*Run, []IoctlRec, error) { + type result struct { + run *Run + recs []IoctlRec + err error + } + ch := make(chan result, 1) + // Every ptrace request must come from the thread that started the + // tracee: PTRACE_TRACEME makes that thread its tracer. The goroutine + // keeps its thread locked to the end, so the thread exits with it and + // never returns to the scheduler as some tracee's tracer. + go func() { + runtime.LockOSThread() + r, recs, err := trace(cmd) + ch <- result{r, recs, err} + }() + res := <-ch + return res.run, res.recs, res.err +} + +func trace(cmd *exec.Cmd) (*Run, []IoctlRec, error) { + outR, outW, err := os.Pipe() + if err != nil { + return nil, nil, fmt.Errorf("tnlsys: trace: %w", err) + } + errR, errW, err := os.Pipe() + if err != nil { + return nil, nil, joinClose(fmt.Errorf("tnlsys: trace: %w", err), outR, outW) + } + cmd.Stdout, cmd.Stderr = outW, errW + cmd.SysProcAttr = &syscall.SysProcAttr{Ptrace: true} + if err := cmd.Start(); err != nil { + return nil, nil, joinClose(fmt.Errorf("tnlsys: trace: %w", err), outR, outW, errR, errW) + } + if err := joinClose(nil, outW, errW); err != nil { + return nil, nil, err + } + stdout, stderr := drain(outR), drain(errR) + + t := tracer{pid: cmd.Process.Pid, fam: map[int]int{}} + rc, terr := t.run() + run := &Run{Argv: append([]string(nil), cmd.Args...), RC: rc, Stdout: string(<-stdout), Stderr: string(<-stderr)} + if cerr := joinClose(nil, outR, errR); terr == nil { + terr = cerr + } + return run, t.recs, terr +} + +// drain reads r to EOF on its own goroutine. +func drain(r io.Reader) <-chan []byte { + ch := make(chan []byte, 1) + go func() { + var b bytes.Buffer + if _, err := b.ReadFrom(r); err != nil { + b.WriteString("\n[tnlsys: read: " + err.Error() + "]") + } + ch <- b.Bytes() + }() + return ch +} + +// joinClose closes every file, joining their errors onto err. +func joinClose(err error, fs ...*os.File) error { + for _, f := range fs { + err = errors.Join(err, f.Close()) + } + return err +} + +// tracer is one traced process's state. +type tracer struct { + pid int + fam map[int]int // descriptor -> socket(2) domain, process-wide + recs []IoctlRec + thr map[int]*thread +} + +// thread is one traced thread's syscall state: entry and exit stops +// alternate per thread. +type thread struct { + inSyscall bool + nr uint64 + sockDom int + pend *pendingIoctl +} + +// pendingIoctl is an ioctl seen at entry, waiting for its exit. +type pendingIoctl struct { + family int + req uint32 + name string + arg uintptr + size int + in []byte // size + SpillWindow bytes +} + +// run steps the tracee's threads from syscall stop to syscall stop until +// the process exits, returning its exit status (128+N for a signal, as a +// shell reports it). Threads are followed (PTRACE_O_TRACECLONE) so a +// multithreaded command, a Go test helper say, is recorded whole. +func (t *tracer) run() (int, error) { + var ws unix.WaitStatus + if _, err := unix.Wait4(t.pid, &ws, 0, nil); err != nil { + return -1, fmt.Errorf("tnlsys: trace: wait: %w", err) + } + if !ws.Stopped() { + return -1, fmt.Errorf("tnlsys: trace: tracee did not stop at exec (%#x)", uint32(ws)) + } + opts := unix.PTRACE_O_TRACESYSGOOD | unix.PTRACE_O_EXITKILL | unix.PTRACE_O_TRACECLONE + if err := unix.PtraceSetOptions(t.pid, opts); err != nil { + return -1, fmt.Errorf("tnlsys: trace: options: %w", err) + } + t.thr = map[int]*thread{t.pid: {}} + if err := unix.PtraceSyscall(t.pid, 0); err != nil { + return -1, fmt.Errorf("tnlsys: trace: resume: %w", err) + } + for { + tid, err := unix.Wait4(-1, &ws, unix.WALL, nil) + if err != nil { + return -1, fmt.Errorf("tnlsys: trace: wait: %w", err) + } + if ws.Exited() || ws.Signaled() { + delete(t.thr, tid) + if tid == t.pid { + return t.status(ws), nil + } + continue + } + sig := 0 + switch { + case !ws.Stopped(): + case ws.StopSignal() == syscallStop: + if err := t.syscallStop(tid); err != nil { + if !threadGone(err) { + return -1, err + } + delete(t.thr, tid) + continue + } + case ws.StopSignal() == syscall.SIGTRAP: + // PTRACE_EVENT_CLONE and the like: resume without a signal. + case ws.StopSignal() == syscall.SIGSTOP && t.thr[tid] == nil: + t.thr[tid] = &thread{} // a new thread's first stop + default: + sig = int(ws.StopSignal()) + } + if err := unix.PtraceSyscall(tid, sig); err != nil && !errors.Is(err, unix.ESRCH) { + return -1, fmt.Errorf("tnlsys: trace: resume %d: %w", tid, err) + } + } +} + +// threadGone reports a ptrace request on a thread that no longer exists: +// ptrace(2) says a tracee can vanish at any stop, as a thread does when +// a sibling's exit_group kills it between the wait and the request. Its +// exit, if any, comes later from Wait4. +func threadGone(err error) bool { + return errors.Is(err, unix.ESRCH) +} + +// status is an exit status as a shell reports it. +func (t *tracer) status(ws unix.WaitStatus) int { + if ws.Signaled() { + return 128 + int(ws.Signal()) + } + return ws.ExitStatus() +} + +// syscallStop handles one entry or exit stop of thread tid. +func (t *tracer) syscallStop(tid int) error { + th := t.thr[tid] + if th == nil { + th = &thread{} + t.thr[tid] = th + } + var regs unix.PtraceRegs + if err := unix.PtraceGetRegs(tid, ®s); err != nil { + return fmt.Errorf("tnlsys: trace: regs: %w", err) + } + th.inSyscall = !th.inSyscall + if th.inSyscall { + th.nr = regs.Orig_rax + return t.entry(th, tid, ®s) + } + return t.exit(th, tid, ®s) +} + +func (t *tracer) entry(th *thread, tid int, regs *unix.PtraceRegs) error { + switch th.nr { + case unix.SYS_SOCKET: + th.sockDom = int(cint.Low32(regs.Rdi)) + case unix.SYS_IOCTL: + req := cint.Low32(regs.Rsi) + if !knownReq(req) { + return nil + } + return t.ioctlEntry(th, tid, int(cint.Low32(regs.Rdi)), req, uintptr(regs.Rdx)) + } + return nil +} + +func (t *tracer) ioctlEntry(th *thread, tid int, fd int, req uint32, ifrAddr uintptr) error { + ifr := make([]byte, ifreqSize) + if err := t.peek(tid, ifrAddr, ifr); err != nil { + return err + } + p := &pendingIoctl{ + family: t.fam[fd], req: req, + name: IfName(string(ifr[:ifNameSize])), + arg: uintptr(binary.LittleEndian.Uint64(ifr[ifrDataOff:])), + } + switch req { + case SIOCGETPRL: + hdr := make([]byte, TunnelPRLSize) + if err := t.peek(tid, p.arg, hdr); err != nil { + return err + } + datalen := int(binary.LittleEndian.Uint32(hdr[8:12])) + p.size = min(TunnelPRLSize+datalen, maxArg) + default: + p.size = ArgSize(p.family, req) + } + p.in = make([]byte, p.size+SpillWindow) + if err := t.peek(tid, p.arg, p.in); err != nil { + return err + } + // Fill the window past the argument, as Live does, so that the exit + // can tell the kernel's bytes from the tracee's own (its stack, whose + // pointers vary run to run). ioctlExit restores what the kernel left. + if err := t.poke(tid, p.arg+uintptr(p.size), bytes.Repeat([]byte{spillFill}, SpillWindow)); err != nil { + return err + } + th.pend = p + return nil +} + +func (t *tracer) exit(th *thread, tid int, regs *unix.PtraceRegs) error { + errno, failed := retErrno(regs.Rax) + switch th.nr { + case unix.SYS_SOCKET: + if !failed { + t.fam[int(cint.Low32(regs.Rax))] = th.sockDom + } + case unix.SYS_IOCTL: + p := th.pend + th.pend = nil + if p == nil { + return nil + } + return t.ioctlExit(tid, p, errno) + } + return nil +} + +// retErrno reads a syscall's return register: the kernel returns -errno, +// -4095 to -1, for a failure. +func retErrno(rax uint64) (unix.Errno, bool) { + if rax < ^uint64(4095) { + return 0, false + } + return unix.Errno(^rax + 1), true +} + +func (t *tracer) ioctlExit(tid int, p *pendingIoctl, errno unix.Errno) error { + out := make([]byte, len(p.in)) + if err := t.peek(tid, p.arg, out); err != nil { + return err + } + // The kernel's write past the argument is a prefix of the window; the + // tracee gets its own bytes back after it. + spill := spillOf(out[p.size:]) + if keep := p.size + len(spill); keep < len(p.in) { + if err := t.poke(tid, p.arg+uintptr(keep), p.in[keep:]); err != nil { + return err + } + } + var s Snapshot + if errno != 0 { + s.AddIoctl(p.family, p.req, p.name, p.in[:p.size], nil, nil, errno) + } else { + s.AddIoctl(p.family, p.req, p.name, p.in[:p.size], out[:p.size], spill, 0) + } + t.recs = append(t.recs, s.Ioctls...) + return nil +} + +// poke writes b into thread tid's memory at addr. +func (t *tracer) poke(tid int, addr uintptr, b []byte) error { + n, err := unix.PtracePokeData(tid, addr, b) + if err != nil { + return fmt.Errorf("tnlsys: trace: poke %#x: %w", addr, err) + } + if n != len(b) { + return fmt.Errorf("tnlsys: trace: poke %#x: %d of %d bytes", addr, n, len(b)) + } + return nil +} + +// peek reads len(b) bytes of thread tid's memory at addr. +func (t *tracer) peek(tid int, addr uintptr, b []byte) error { + n, err := unix.PtracePeekData(tid, addr, b) + if err != nil { + return fmt.Errorf("tnlsys: trace: peek %#x: %w", addr, err) + } + if n != len(b) { + return fmt.Errorf("tnlsys: trace: peek %#x: %d of %d bytes", addr, n, len(b)) + } + return nil +} diff --git a/internal/tnlsys/trace_linux_amd64_test.go b/internal/tnlsys/trace_linux_amd64_test.go new file mode 100644 index 000000000..feada609f --- /dev/null +++ b/internal/tnlsys/trace_linux_amd64_test.go @@ -0,0 +1,36 @@ +package tnlsys + +import ( + "errors" + "fmt" + "testing" + + "golang.org/x/sys/unix" +) + +// TestThreadGone is the tracer's rule for a thread that vanishes in a +// stop: ESRCH, however wrapped, skips the thread; any other error stops +// the trace. +// +// go test ./internal/tnlsys/ -run TestThreadGone +func TestThreadGone(t *testing.T) { + tests := []struct { + description string + err error + expected bool + }{ + {"positive: ESRCH from PTRACE_GETREGS", unix.ESRCH, true}, + {"positive: ESRCH wrapped as syscallStop wraps it", fmt.Errorf("tnlsys: trace: regs: %w", unix.ESRCH), true}, + {"negative: EIO is a real failure", fmt.Errorf("tnlsys: trace: peek: %w", unix.EIO), false}, + {"negative: a non-errno error", errors.New("tnlsys: trace: short read"), false}, + {"boundary: nil", nil, false}, + {"corner: ESRCH joined with another error", errors.Join(unix.EPERM, unix.ESRCH), true}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := threadGone(tc.err); got != tc.expected { + t.Errorf("threadGone(%v) = %v, want %v", tc.err, got, tc.expected) + } + }) + } +} diff --git a/internal/tnlsys/trace_other.go b/internal/tnlsys/trace_other.go new file mode 100644 index 000000000..eb81a7ba8 --- /dev/null +++ b/internal/tnlsys/trace_other.go @@ -0,0 +1,13 @@ +//go:build !(linux && amd64) + +package tnlsys + +import ( + "errors" + "os/exec" +) + +// Trace reads syscall registers, which only the x86_64 tracer knows. +func Trace(cmd *exec.Cmd) (*Run, []IoctlRec, error) { + return nil, nil, errors.New("tnlsys: trace: only linux/amd64") +} diff --git a/nix/binaries.nix b/nix/binaries.nix index 46f48454d..08408f140 100644 --- a/nix/binaries.nix +++ b/nix/binaries.nix @@ -100,6 +100,12 @@ let # and ParseBrVlanTables (internal/gobridge), and without a capture asks # the kernel, so a live run can diff it against the pinned bridge. "gobridge" + # tnlsnap records what `ip tunnel` and `ip tuntap` ask outside netlink + # (internal/tnlsys): it runs `ip` under ptrace and prints the tunnel + # ioctls, tun sysfs properties and /dev/net/tun holders as the JSON + # sidecar goip's GOIP_TNLSYS replays. A capture row runs it as a + # readback, so it has to be in the guest. + "tnlsnap" "ipmeta-bootstrap" "ipfeed-collector" "kafka_to_clickhouse" diff --git a/nix/microvms/workbench/tunnel.rows.jsonl b/nix/microvms/workbench/tunnel.rows.jsonl new file mode 100644 index 000000000..ae66b55f1 --- /dev/null +++ b/nix/microvms/workbench/tunnel.rows.jsonl @@ -0,0 +1,174 @@ +# Generated by `nlcapgen matrix -family tunnel -seed 1 -random 0`. +# Do not edit; regenerate. tools/nlcapgen/matrix.go explains the strategies. +# 171 rows. +{"id":"tunnel/ec-001","desc":"boundary: opt=plain cmd=bare:tunnel_show","cmd":"ip tunnel show","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bare","json":"0","words":"tunnel show"}} +{"id":"tunnel/ec-002","desc":"boundary: opt=json cmd=bare:-6_tunnel_show","cmd":"ip -j -6 tunnel show","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bare","json":"1","words":"-6 tunnel show"}} +{"id":"tunnel/ec-003","desc":"positive: opt=plain cmd=tnl4:tunnel_show","cmd":"ip tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show"}} +{"id":"tunnel/ec-004","desc":"corner: opt=plain cmd=tnl4:tunnel","cmd":"ip tunnel","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel"}} +{"id":"tunnel/ec-005","desc":"positive: opt=plain cmd=tnl4:tunnel_list","cmd":"ip tunnel list","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel list"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel list"}} +{"id":"tunnel/ec-006","desc":"positive: opt=plain cmd=tnl4:tunnel_lst","cmd":"ip tunnel lst","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel lst"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel lst"}} +{"id":"tunnel/ec-007","desc":"corner: opt=plain cmd=tnl4:tunnel_sh","cmd":"ip tunnel sh","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel sh"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel sh"}} +{"id":"tunnel/ec-008","desc":"corner: opt=plain cmd=tnl4:tunl_show","cmd":"ip tunl show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunl show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunl show"}} +{"id":"tunnel/ec-009","desc":"positive: opt=plain cmd=tnl4:-4_tunnel_show","cmd":"ip -4 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -4 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"-4 tunnel show"}} +{"id":"tunnel/ec-010","desc":"positive: opt=plain cmd=tnl4:-s_tunnel_show","cmd":"ip -s tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -s tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"-s tunnel show"}} +{"id":"tunnel/ec-011","desc":"corner: opt=plain cmd=tnl4:-d_tunnel_show","cmd":"ip -d tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -d tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"-d tunnel show"}} +{"id":"tunnel/ec-012","desc":"corner: opt=plain cmd=tnl4:-o_tunnel_show","cmd":"ip -o tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -o tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"-o tunnel show"}} +{"id":"tunnel/ec-013","desc":"corner: opt=plain cmd=tnl4:-p_tunnel_show","cmd":"ip -p tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -p tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"-p tunnel show"}} +{"id":"tunnel/ec-014","desc":"positive: opt=plain cmd=tnl4:tunnel_show_remote_198.51.100.2","cmd":"ip tunnel show remote 198.51.100.2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show remote 198.51.100.2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show remote 198.51.100.2"}} +{"id":"tunnel/ec-015","desc":"positive: opt=plain cmd=tnl4:tunnel_show_local_192.0.2.1","cmd":"ip tunnel show local 192.0.2.1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show local 192.0.2.1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show local 192.0.2.1"}} +{"id":"tunnel/ec-016","desc":"positive: opt=plain cmd=tnl4:tunnel_show_dev_d0","cmd":"ip tunnel show dev d0","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show dev d0"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show dev d0"}} +{"id":"tunnel/ec-017","desc":"corner: opt=plain cmd=tnl4:tunnel_show_isa1","cmd":"ip tunnel show isa1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show isa1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show isa1"}} +{"id":"tunnel/ec-018","desc":"corner: opt=plain cmd=tnl4:tunnel_show_isan","cmd":"ip tunnel show isan","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show isan"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show isan"}} +{"id":"tunnel/ec-019","desc":"positive: opt=plain cmd=tnl4:tunnel_show_sit2","cmd":"ip tunnel show sit2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show sit2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show sit2"}} +{"id":"tunnel/ec-020","desc":"corner: opt=plain cmd=tnl4:tunnel_show_nosuch","cmd":"ip tunnel show nosuch","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show nosuch"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show nosuch"}} +{"id":"tunnel/ec-021","desc":"corner: opt=plain cmd=tnl4:tunnel_show_name_ipip2","cmd":"ip tunnel show name ipip2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show name ipip2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show name ipip2"}} +{"id":"tunnel/ec-022","desc":"positive: opt=plain cmd=tnl4:tunnel_show_gre1","cmd":"ip tunnel show gre1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show gre1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show gre1"}} +{"id":"tunnel/ec-023","desc":"positive: opt=plain cmd=tnl4:tunnel_show_ipip1","cmd":"ip tunnel show ipip1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show ipip1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show ipip1"}} +{"id":"tunnel/ec-024","desc":"positive: opt=plain cmd=tnl4:tunnel_show_sit1","cmd":"ip tunnel show sit1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show sit1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show sit1"}} +{"id":"tunnel/ec-025","desc":"positive: opt=plain cmd=tnl4:tunnel_show_vti1","cmd":"ip tunnel show vti1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show vti1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show vti1"}} +{"id":"tunnel/ec-026","desc":"positive: opt=plain cmd=tnl4:tunnel_show_mode_gre","cmd":"ip tunnel show mode gre","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode gre"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode gre"}} +{"id":"tunnel/ec-027","desc":"positive: opt=plain cmd=tnl4:tunnel_show_mode_ipip","cmd":"ip tunnel show mode ipip","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode ipip"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode ipip"}} +{"id":"tunnel/ec-028","desc":"positive: opt=plain cmd=tnl4:tunnel_show_mode_sit","cmd":"ip tunnel show mode sit","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode sit"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode sit"}} +{"id":"tunnel/ec-029","desc":"positive: opt=plain cmd=tnl4:tunnel_show_mode_isatap","cmd":"ip tunnel show mode isatap","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode isatap"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode isatap"}} +{"id":"tunnel/ec-030","desc":"positive: opt=plain cmd=tnl4:tunnel_show_mode_vti","cmd":"ip tunnel show mode vti","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode vti"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode vti"}} +{"id":"tunnel/ec-031","desc":"corner: opt=plain cmd=tnl4:-s_tunnel_show_gre1","cmd":"ip -s tunnel show gre1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -s tunnel show gre1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"-s tunnel show gre1"}} +{"id":"tunnel/ec-032","desc":"corner: opt=plain cmd=tnl4:tunnel_show_mode_gre_remote_198.51.100.2_local_192.0.2.1_key_5","cmd":"ip tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5"}} +{"id":"tunnel/ec-033","desc":"corner: opt=plain cmd=tnl4:tunnel_show_mode_gre_remote_198.51.100.2","cmd":"ip tunnel show mode gre remote 198.51.100.2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode gre remote 198.51.100.2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode gre remote 198.51.100.2"}} +{"id":"tunnel/ec-034","desc":"corner: opt=plain cmd=tnl4:tunnel_show_mode_gre_remote_239.1.1.1_local_192.0.2.1","cmd":"ip tunnel show mode gre remote 239.1.1.1 local 192.0.2.1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode gre remote 239.1.1.1 local 192.0.2.1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode gre remote 239.1.1.1 local 192.0.2.1"}} +{"id":"tunnel/ec-035","desc":"corner: opt=plain cmd=tnl4:tunnel_show_mode_vti_remote_198.51.100.5_local_192.0.2.1_ikey_7_okey_8","cmd":"ip tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"}} +{"id":"tunnel/ec-036","desc":"corner: opt=plain cmd=tnl4:tunnel_show_mode_any","cmd":"ip tunnel show mode any","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode any"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show mode any"}} +{"id":"tunnel/ec-037","desc":"corner: opt=plain cmd=tnl4:-6_tunnel_show","cmd":"ip -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"0","words":"-6 tunnel show"}} +{"id":"tunnel/ec-038","desc":"positive: opt=plain cmd=prl16:tunnel_show_isa16","cmd":"ip tunnel show isa16","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip tunnel add isa16 mode isatap local 192.0.2.1","i=10; while [ $i -lt 26 ]; do ip tunnel prl dev isa16 prl-nodefault 192.0.2.$i || exit 1; i=$((i+1)); done"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show isa16"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prl16","json":"0","words":"tunnel show isa16"}} +{"id":"tunnel/ec-039","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show","cmd":"ip -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show"}} +{"id":"tunnel/ec-040","desc":"corner: opt=plain cmd=tnl6:-6_tunnel","cmd":"ip -6 tunnel","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel"}} +{"id":"tunnel/ec-041","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_list","cmd":"ip -6 tunnel list","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel list"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel list"}} +{"id":"tunnel/ec-042","desc":"positive: opt=plain cmd=tnl6:-s_-6_tunnel_show","cmd":"ip -s -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -s -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-s -6 tunnel show"}} +{"id":"tunnel/ec-043","desc":"corner: opt=plain cmd=tnl6:-o_-6_tunnel_show","cmd":"ip -o -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -o -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-o -6 tunnel show"}} +{"id":"tunnel/ec-044","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_ip6t1","cmd":"ip -6 tunnel show ip6t1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show ip6t1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show ip6t1"}} +{"id":"tunnel/ec-045","desc":"corner: opt=plain cmd=tnl6:-s_-6_tunnel_show_ip6t1","cmd":"ip -s -6 tunnel show ip6t1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -s -6 tunnel show ip6t1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-s -6 tunnel show ip6t1"}} +{"id":"tunnel/ec-046","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_name_ip6g1","cmd":"ip -6 tunnel show name ip6g1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show name ip6g1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show name ip6g1"}} +{"id":"tunnel/ec-047","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_ip6tnl0","cmd":"ip -6 tunnel show ip6tnl0","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show ip6tnl0"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show ip6tnl0"}} +{"id":"tunnel/ec-048","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_ip6gre","cmd":"ip -6 tunnel show mode ip6gre","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show mode ip6gre"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show mode ip6gre"}} +{"id":"tunnel/ec-049","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_ip6ip6","cmd":"ip -6 tunnel show mode ip6ip6","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show mode ip6ip6"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show mode ip6ip6"}} +{"id":"tunnel/ec-050","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_ipip6","cmd":"ip -6 tunnel show mode ipip6","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show mode ipip6"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show mode ipip6"}} +{"id":"tunnel/ec-051","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_vti6","cmd":"ip -6 tunnel show mode vti6","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show mode vti6"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show mode vti6"}} +{"id":"tunnel/ec-052","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_any","cmd":"ip -6 tunnel show mode any","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show mode any"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show mode any"}} +{"id":"tunnel/ec-053","desc":"corner: opt=plain cmd=tnl6:tunnel_show_mode_ip6ip6","cmd":"ip tunnel show mode ip6ip6","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode ip6ip6"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"tunnel show mode ip6ip6"}} +{"id":"tunnel/ec-054","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_remote_2001:db8::2","cmd":"ip -6 tunnel show remote 2001:db8::2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show remote 2001:db8::2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show remote 2001:db8::2"}} +{"id":"tunnel/ec-055","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_local_2001:db8::1","cmd":"ip -6 tunnel show local 2001:db8::1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show local 2001:db8::1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show local 2001:db8::1"}} +{"id":"tunnel/ec-056","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_dev_d0","cmd":"ip -6 tunnel show dev d0","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show dev d0"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show dev d0"}} +{"id":"tunnel/ec-057","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_encaplimit_none","cmd":"ip -6 tunnel show encaplimit none","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show encaplimit none"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show encaplimit none"}} +{"id":"tunnel/ec-058","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_hoplimit_1","cmd":"ip -6 tunnel show hoplimit 1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show hoplimit 1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show hoplimit 1"}} +{"id":"tunnel/ec-059","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_tclass_inherit","cmd":"ip -6 tunnel show tclass inherit","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show tclass inherit"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show tclass inherit"}} +{"id":"tunnel/ec-060","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_flowlabel_0x12345","cmd":"ip -6 tunnel show flowlabel 0x12345","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show flowlabel 0x12345"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show flowlabel 0x12345"}} +{"id":"tunnel/ec-061","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_key_9","cmd":"ip -6 tunnel show key 9","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show key 9"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show key 9"}} +{"id":"tunnel/ec-062","desc":"positive: opt=plain cmd=tnl6:-6_tunnel_show_allow-localremote","cmd":"ip -6 tunnel show allow-localremote","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show allow-localremote"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show allow-localremote"}} +{"id":"tunnel/ec-063","desc":"corner: opt=plain cmd=tnl6:-6_tunnel_show_encaplimit_300","cmd":"ip -6 tunnel show encaplimit 300","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show encaplimit 300"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show encaplimit 300"}} +{"id":"tunnel/ec-064","desc":"positive: opt=plain cmd=tnl6:tunnel_show","cmd":"ip tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"tunnel show"}} +{"id":"tunnel/ec-065","desc":"corner: opt=plain cmd=tnl6:tunnel_show_gre6x","cmd":"ip tunnel show gre6x","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show gre6x"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"0","words":"tunnel show gre6x"}} +{"id":"tunnel/ec-066","desc":"corner: opt=plain cmd=ext:tunnel_show","cmd":"ip tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipipx type ipip external","ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11","ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5","ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ext","json":"0","words":"tunnel show"}} +{"id":"tunnel/ec-067","desc":"corner: opt=plain cmd=ext:-6_tunnel_show","cmd":"ip -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipipx type ipip external","ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11","ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5","ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ext","json":"0","words":"-6 tunnel show"}} +{"id":"tunnel/ec-068","desc":"corner: opt=plain cmd=ext:tunnel_show_ipipx","cmd":"ip tunnel show ipipx","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipipx type ipip external","ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11","ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5","ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show ipipx"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ext","json":"0","words":"tunnel show ipipx"}} +{"id":"tunnel/ec-069","desc":"corner: opt=plain cmd=tnl4:batch:twice","cmd":"ip -batch b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8","printf '%s\\n' 'tunnel show' 'tunnel show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -batch b.txt"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"twice","fix":"tnl4","json":"0","words":"-batch b.txt"}} +{"id":"tunnel/ec-070","desc":"corner: opt=plain cmd=tnl4:batch:mode-then-list","cmd":"ip -batch b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8","printf '%s\\n' 'tunnel show mode gre' 'tunnel show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -batch b.txt"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"mode-then-list","fix":"tnl4","json":"0","words":"-batch b.txt"}} +{"id":"tunnel/ec-071","desc":"corner: opt=plain cmd=tnl4:batch:any-sticks","cmd":"ip -batch b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8","printf '%s\\n' 'tunnel show mode any' 'tunnel show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -batch b.txt"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"any-sticks","fix":"tnl4","json":"0","words":"-batch b.txt"}} +{"id":"tunnel/ec-072","desc":"corner: opt=plain cmd=tnl6:batch:v6-named-then-list","cmd":"ip -batch - < b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1","printf '%s\\n' 'tunnel show mode ip6ip6 ip6t1' 'tunnel show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -batch - < b.txt"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"v6-named-then-list","fix":"tnl6","json":"0","words":"-batch - < b.txt"}} +{"id":"tunnel/pw-001","desc":"boundary: opt=plain cmd=bare:-6_tunnel_show","cmd":"ip -6 tunnel show","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bare","json":"0","words":"-6 tunnel show"}} +{"id":"tunnel/pw-002","desc":"boundary: opt=json cmd=bare:tunnel_show","cmd":"ip -j tunnel show","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bare","json":"1","words":"tunnel show"}} +{"id":"tunnel/pw-003","desc":"positive: opt=json cmd=tnl4:tunnel_show","cmd":"ip -j tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show"}} +{"id":"tunnel/pw-004","desc":"corner: opt=json cmd=tnl4:tunnel","cmd":"ip -j tunnel","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel"}} +{"id":"tunnel/pw-005","desc":"positive: opt=json cmd=tnl4:tunnel_list","cmd":"ip -j tunnel list","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel list"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel list"}} +{"id":"tunnel/pw-006","desc":"positive: opt=json cmd=tnl4:tunnel_lst","cmd":"ip -j tunnel lst","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel lst"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel lst"}} +{"id":"tunnel/pw-007","desc":"corner: opt=json cmd=tnl4:tunnel_sh","cmd":"ip -j tunnel sh","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel sh"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel sh"}} +{"id":"tunnel/pw-008","desc":"corner: opt=json cmd=tnl4:tunl_show","cmd":"ip -j tunl show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunl show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunl show"}} +{"id":"tunnel/pw-009","desc":"positive: opt=json cmd=tnl4:-4_tunnel_show","cmd":"ip -j -4 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -4 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"-4 tunnel show"}} +{"id":"tunnel/pw-010","desc":"positive: opt=json cmd=tnl4:-s_tunnel_show","cmd":"ip -j -s tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -s tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"-s tunnel show"}} +{"id":"tunnel/pw-011","desc":"corner: opt=json cmd=tnl4:-d_tunnel_show","cmd":"ip -j -d tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -d tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"-d tunnel show"}} +{"id":"tunnel/pw-012","desc":"corner: opt=json cmd=tnl4:-o_tunnel_show","cmd":"ip -j -o tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -o tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"-o tunnel show"}} +{"id":"tunnel/pw-013","desc":"corner: opt=json cmd=tnl4:-p_tunnel_show","cmd":"ip -j -p tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -p tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"-p tunnel show"}} +{"id":"tunnel/pw-014","desc":"positive: opt=json cmd=tnl4:tunnel_show_remote_198.51.100.2","cmd":"ip -j tunnel show remote 198.51.100.2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show remote 198.51.100.2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show remote 198.51.100.2"}} +{"id":"tunnel/pw-015","desc":"positive: opt=json cmd=tnl4:tunnel_show_local_192.0.2.1","cmd":"ip -j tunnel show local 192.0.2.1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show local 192.0.2.1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show local 192.0.2.1"}} +{"id":"tunnel/pw-016","desc":"positive: opt=json cmd=tnl4:tunnel_show_dev_d0","cmd":"ip -j tunnel show dev d0","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show dev d0"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show dev d0"}} +{"id":"tunnel/pw-017","desc":"corner: opt=json cmd=tnl4:tunnel_show_isa1","cmd":"ip -j tunnel show isa1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show isa1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show isa1"}} +{"id":"tunnel/pw-018","desc":"corner: opt=json cmd=tnl4:tunnel_show_isan","cmd":"ip -j tunnel show isan","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show isan"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show isan"}} +{"id":"tunnel/pw-019","desc":"positive: opt=json cmd=tnl4:tunnel_show_sit2","cmd":"ip -j tunnel show sit2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show sit2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show sit2"}} +{"id":"tunnel/pw-020","desc":"corner: opt=json cmd=tnl4:tunnel_show_nosuch","cmd":"ip -j tunnel show nosuch","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show nosuch"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show nosuch"}} +{"id":"tunnel/pw-021","desc":"corner: opt=json cmd=tnl4:tunnel_show_name_ipip2","cmd":"ip -j tunnel show name ipip2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show name ipip2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show name ipip2"}} +{"id":"tunnel/pw-022","desc":"positive: opt=json cmd=tnl4:tunnel_show_gre1","cmd":"ip -j tunnel show gre1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show gre1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show gre1"}} +{"id":"tunnel/pw-023","desc":"positive: opt=json cmd=tnl4:tunnel_show_ipip1","cmd":"ip -j tunnel show ipip1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show ipip1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show ipip1"}} +{"id":"tunnel/pw-024","desc":"positive: opt=json cmd=tnl4:tunnel_show_sit1","cmd":"ip -j tunnel show sit1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show sit1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show sit1"}} +{"id":"tunnel/pw-025","desc":"positive: opt=json cmd=tnl4:tunnel_show_vti1","cmd":"ip -j tunnel show vti1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show vti1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show vti1"}} +{"id":"tunnel/pw-026","desc":"positive: opt=json cmd=tnl4:tunnel_show_mode_gre","cmd":"ip -j tunnel show mode gre","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode gre"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode gre"}} +{"id":"tunnel/pw-027","desc":"positive: opt=json cmd=tnl4:tunnel_show_mode_ipip","cmd":"ip -j tunnel show mode ipip","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode ipip"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode ipip"}} +{"id":"tunnel/pw-028","desc":"positive: opt=json cmd=tnl4:tunnel_show_mode_sit","cmd":"ip -j tunnel show mode sit","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode sit"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode sit"}} +{"id":"tunnel/pw-029","desc":"positive: opt=json cmd=tnl4:tunnel_show_mode_isatap","cmd":"ip -j tunnel show mode isatap","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode isatap"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode isatap"}} +{"id":"tunnel/pw-030","desc":"positive: opt=json cmd=tnl4:tunnel_show_mode_vti","cmd":"ip -j tunnel show mode vti","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode vti"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode vti"}} +{"id":"tunnel/pw-031","desc":"corner: opt=json cmd=tnl4:-s_tunnel_show_gre1","cmd":"ip -j -s tunnel show gre1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -s tunnel show gre1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"-s tunnel show gre1"}} +{"id":"tunnel/pw-032","desc":"corner: opt=json cmd=tnl4:tunnel_show_mode_gre_remote_198.51.100.2_local_192.0.2.1_key_5","cmd":"ip -j tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5"}} +{"id":"tunnel/pw-033","desc":"corner: opt=json cmd=tnl4:tunnel_show_mode_gre_remote_198.51.100.2","cmd":"ip -j tunnel show mode gre remote 198.51.100.2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode gre remote 198.51.100.2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode gre remote 198.51.100.2"}} +{"id":"tunnel/pw-034","desc":"corner: opt=json cmd=tnl4:tunnel_show_mode_gre_remote_239.1.1.1_local_192.0.2.1","cmd":"ip -j tunnel show mode gre remote 239.1.1.1 local 192.0.2.1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode gre remote 239.1.1.1 local 192.0.2.1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode gre remote 239.1.1.1 local 192.0.2.1"}} +{"id":"tunnel/pw-035","desc":"corner: opt=json cmd=tnl4:tunnel_show_mode_vti_remote_198.51.100.5_local_192.0.2.1_ikey_7_okey_8","cmd":"ip -j tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"}} +{"id":"tunnel/pw-036","desc":"corner: opt=json cmd=tnl4:tunnel_show_mode_any","cmd":"ip -j tunnel show mode any","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode any"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"tunnel show mode any"}} +{"id":"tunnel/pw-037","desc":"corner: opt=json cmd=tnl4:-6_tunnel_show","cmd":"ip -j -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl4","json":"1","words":"-6 tunnel show"}} +{"id":"tunnel/pw-038","desc":"positive: opt=json cmd=prl16:tunnel_show_isa16","cmd":"ip -j tunnel show isa16","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip tunnel add isa16 mode isatap local 192.0.2.1","i=10; while [ $i -lt 26 ]; do ip tunnel prl dev isa16 prl-nodefault 192.0.2.$i || exit 1; i=$((i+1)); done"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show isa16"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prl16","json":"1","words":"tunnel show isa16"}} +{"id":"tunnel/pw-039","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show","cmd":"ip -j -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show"}} +{"id":"tunnel/pw-040","desc":"corner: opt=json cmd=tnl6:-6_tunnel","cmd":"ip -j -6 tunnel","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel"}} +{"id":"tunnel/pw-041","desc":"positive: opt=json cmd=tnl6:-6_tunnel_list","cmd":"ip -j -6 tunnel list","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel list"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel list"}} +{"id":"tunnel/pw-042","desc":"positive: opt=json cmd=tnl6:-s_-6_tunnel_show","cmd":"ip -j -s -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -s -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-s -6 tunnel show"}} +{"id":"tunnel/pw-043","desc":"corner: opt=json cmd=tnl6:-o_-6_tunnel_show","cmd":"ip -j -o -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -o -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-o -6 tunnel show"}} +{"id":"tunnel/pw-044","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_ip6t1","cmd":"ip -j -6 tunnel show ip6t1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show ip6t1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show ip6t1"}} +{"id":"tunnel/pw-045","desc":"corner: opt=json cmd=tnl6:-s_-6_tunnel_show_ip6t1","cmd":"ip -j -s -6 tunnel show ip6t1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -s -6 tunnel show ip6t1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-s -6 tunnel show ip6t1"}} +{"id":"tunnel/pw-046","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_name_ip6g1","cmd":"ip -j -6 tunnel show name ip6g1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show name ip6g1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show name ip6g1"}} +{"id":"tunnel/pw-047","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_ip6tnl0","cmd":"ip -j -6 tunnel show ip6tnl0","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show ip6tnl0"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show ip6tnl0"}} +{"id":"tunnel/pw-048","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_mode_ip6gre","cmd":"ip -j -6 tunnel show mode ip6gre","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show mode ip6gre"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show mode ip6gre"}} +{"id":"tunnel/pw-049","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_mode_ip6ip6","cmd":"ip -j -6 tunnel show mode ip6ip6","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show mode ip6ip6"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show mode ip6ip6"}} +{"id":"tunnel/pw-050","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_mode_ipip6","cmd":"ip -j -6 tunnel show mode ipip6","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show mode ipip6"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show mode ipip6"}} +{"id":"tunnel/pw-051","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_mode_vti6","cmd":"ip -j -6 tunnel show mode vti6","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show mode vti6"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show mode vti6"}} +{"id":"tunnel/pw-052","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_mode_any","cmd":"ip -j -6 tunnel show mode any","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show mode any"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show mode any"}} +{"id":"tunnel/pw-053","desc":"corner: opt=json cmd=tnl6:tunnel_show_mode_ip6ip6","cmd":"ip -j tunnel show mode ip6ip6","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show mode ip6ip6"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"tunnel show mode ip6ip6"}} +{"id":"tunnel/pw-054","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_remote_2001:db8::2","cmd":"ip -j -6 tunnel show remote 2001:db8::2","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show remote 2001:db8::2"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show remote 2001:db8::2"}} +{"id":"tunnel/pw-055","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_local_2001:db8::1","cmd":"ip -j -6 tunnel show local 2001:db8::1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show local 2001:db8::1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show local 2001:db8::1"}} +{"id":"tunnel/pw-056","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_dev_d0","cmd":"ip -j -6 tunnel show dev d0","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show dev d0"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show dev d0"}} +{"id":"tunnel/pw-057","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_encaplimit_none","cmd":"ip -j -6 tunnel show encaplimit none","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show encaplimit none"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show encaplimit none"}} +{"id":"tunnel/pw-058","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_hoplimit_1","cmd":"ip -j -6 tunnel show hoplimit 1","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show hoplimit 1"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show hoplimit 1"}} +{"id":"tunnel/pw-059","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_tclass_inherit","cmd":"ip -j -6 tunnel show tclass inherit","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show tclass inherit"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show tclass inherit"}} +{"id":"tunnel/pw-060","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_flowlabel_0x12345","cmd":"ip -j -6 tunnel show flowlabel 0x12345","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show flowlabel 0x12345"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show flowlabel 0x12345"}} +{"id":"tunnel/pw-061","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_key_9","cmd":"ip -j -6 tunnel show key 9","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show key 9"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show key 9"}} +{"id":"tunnel/pw-062","desc":"positive: opt=json cmd=tnl6:-6_tunnel_show_allow-localremote","cmd":"ip -j -6 tunnel show allow-localremote","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show allow-localremote"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show allow-localremote"}} +{"id":"tunnel/pw-063","desc":"corner: opt=json cmd=tnl6:-6_tunnel_show_encaplimit_300","cmd":"ip -j -6 tunnel show encaplimit 300","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show encaplimit 300"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"-6 tunnel show encaplimit 300"}} +{"id":"tunnel/pw-064","desc":"positive: opt=json cmd=tnl6:tunnel_show","cmd":"ip -j tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"tunnel show"}} +{"id":"tunnel/pw-065","desc":"corner: opt=json cmd=tnl6:tunnel_show_gre6x","cmd":"ip -j tunnel show gre6x","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show gre6x"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tnl6","json":"1","words":"tunnel show gre6x"}} +{"id":"tunnel/pw-066","desc":"corner: opt=json cmd=ext:tunnel_show","cmd":"ip -j tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipipx type ipip external","ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11","ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5","ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ext","json":"1","words":"tunnel show"}} +{"id":"tunnel/pw-067","desc":"corner: opt=json cmd=ext:-6_tunnel_show","cmd":"ip -j -6 tunnel show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipipx type ipip external","ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11","ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5","ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ext","json":"1","words":"-6 tunnel show"}} +{"id":"tunnel/pw-068","desc":"corner: opt=json cmd=ext:tunnel_show_ipipx","cmd":"ip -j tunnel show ipipx","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipipx type ipip external","ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11","ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5","ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tunnel show ipipx"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ext","json":"1","words":"tunnel show ipipx"}} +{"id":"tunnel/pw-069","desc":"corner: opt=json cmd=tnl4:batch:twice","cmd":"ip -j -batch b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8","printf '%s\\n' 'tunnel show' 'tunnel show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -batch b.txt"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"twice","fix":"tnl4","json":"1","words":"-batch b.txt"}} +{"id":"tunnel/pw-070","desc":"corner: opt=json cmd=tnl4:batch:mode-then-list","cmd":"ip -j -batch b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8","printf '%s\\n' 'tunnel show mode gre' 'tunnel show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -batch b.txt"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"mode-then-list","fix":"tnl4","json":"1","words":"-batch b.txt"}} +{"id":"tunnel/pw-071","desc":"corner: opt=json cmd=tnl4:batch:any-sticks","cmd":"ip -j -batch b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8","printf '%s\\n' 'tunnel show mode any' 'tunnel show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -batch b.txt"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"any-sticks","fix":"tnl4","json":"1","words":"-batch b.txt"}} +{"id":"tunnel/pw-072","desc":"corner: opt=json cmd=tnl6:batch:v6-named-then-list","cmd":"ip -j -batch - < b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1","printf '%s\\n' 'tunnel show mode ip6ip6 ip6t1' 'tunnel show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -batch - < b.txt"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"v6-named-then-list","fix":"tnl6","json":"1","words":"-batch - < b.txt"}} +{"id":"tunnel/ng-001","desc":"negative: opt=plain cmd=ng:tnl4:tunnel_show_gre9: a gre name asks gre9 by ioctl: ENODEV, rc 1 (T5)","cmd":"ip tunnel show gre9","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show gre9"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show gre9"}} +{"id":"tunnel/ng-002","desc":"negative: opt=plain cmd=ng:tnl4:tunnel_show_key_5: keys without a gre or vti mode are refused (T6)","cmd":"ip tunnel show key 5","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0","ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit","ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32","ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum","ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1","ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64","ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16","ip tunnel add isa1 mode isatap local 192.0.2.1","ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11","ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12","ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show key 5"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"tnl4","json":"0","words":"tunnel show key 5"}} +{"id":"tunnel/ng-003","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_mode_bogus: Unknown tunnel mode, exit(-1)","cmd":"ip tunnel show mode bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode bogus"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show mode bogus"}} +{"id":"tunnel/ng-004","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_mode_gre_mode_ipip: more than one tunnel mode, exit(-1)","cmd":"ip tunnel show mode gre mode ipip","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode gre mode ipip"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show mode gre mode ipip"}} +{"id":"tunnel/ng-005","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_mode: mode with no value: the command is incomplete","cmd":"ip tunnel show mode","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show mode"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show mode"}} +{"id":"tunnel/ng-006","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_ttl_300: invarg(\"invalid TTL\\n\"): two newlines (T11)","cmd":"ip tunnel show ttl 300","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show ttl 300"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show ttl 300"}} +{"id":"tunnel/ng-007","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_ttl_bogus: invalid TTL","cmd":"ip tunnel show ttl bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show ttl bogus"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show ttl bogus"}} +{"id":"tunnel/ng-008","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_tos_bogus: bad TOS value","cmd":"ip tunnel show tos bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show tos bogus"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show tos bogus"}} +{"id":"tunnel/ng-009","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_key_bogus: tnl_parse_key: not an unsigned integer","cmd":"ip tunnel show key bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show key bogus"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show key bogus"}} +{"id":"tunnel/ng-010","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_remote_bogus: get_addr32: not an address, exit(1)","cmd":"ip tunnel show remote bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show remote bogus"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show remote bogus"}} +{"id":"tunnel/ng-011","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_name_a_name_b: duparg2 name","cmd":"ip tunnel show name a name b","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show name a name b"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show name a name b"}} +{"id":"tunnel/ng-012","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_help: a prefix of help in the words prints the usage","cmd":"ip tunnel show help","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show help"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel show help"}} +{"id":"tunnel/ng-013","desc":"negative: opt=plain cmd=ng:bare:tunnel_show_dev_nosuch: ll_name_to_index asks the kernel, then nodev","cmd":"ip tunnel show dev nosuch","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel show dev nosuch"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":1,"errno":"ENODEV","refused_by":"kernel"},"axes":{"fix":"bare","json":"0","words":"tunnel show dev nosuch"}} +{"id":"tunnel/ng-014","desc":"negative: opt=plain cmd=ng:bare:tunnel_bogus: an unknown tunnel command","cmd":"ip tunnel bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel bogus"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel bogus"}} +{"id":"tunnel/ng-015","desc":"negative: opt=plain cmd=ng:bare:tunnel_help: the usage, exit(-1)","cmd":"ip tunnel help","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel help"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel help"}} +{"id":"tunnel/ng-016","desc":"negative: opt=plain cmd=ng:bare:-0_tunnel_show: AF_PACKET: Unsupported protocol family","cmd":"ip -0 tunnel show","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -0 tunnel show"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"-0 tunnel show"}} +{"id":"tunnel/ng-017","desc":"negative: opt=plain cmd=ng:bare:tunnel_add: a write with no mode: cannot determine tunnel mode, before any ioctl","cmd":"ip tunnel add","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel add"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel add"}} +{"id":"tunnel/ng-018","desc":"negative: opt=plain cmd=ng:bare:tunnel_add_mode_gre_ttl_64_nopmtudisc: ttl and nopmtudisc refused before any ioctl","cmd":"ip tunnel add mode gre ttl 64 nopmtudisc","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel add mode gre ttl 64 nopmtudisc"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel add mode gre ttl 64 nopmtudisc"}} +{"id":"tunnel/ng-019","desc":"negative: opt=plain cmd=ng:bare:tunnel_prl: prl with no device: Must specify device","cmd":"ip tunnel prl","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel prl"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel prl"}} +{"id":"tunnel/ng-020","desc":"negative: opt=plain cmd=ng:bare:tunnel_6rd: 6rd with no device: Must specify device","cmd":"ip tunnel 6rd","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tunnel 6rd"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tunnel 6rd"}} +{"id":"tunnel/ng-021","desc":"negative: opt=plain cmd=ng:tnl6:-6_tunnel_show_nosuch: the v6 named path: ENODEV, rc 1","cmd":"ip -6 tunnel show nosuch","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad","ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0","ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit","ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum","ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4","ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show nosuch"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"tnl6","json":"0","words":"-6 tunnel show nosuch"}} +{"id":"tunnel/ng-022","desc":"negative: opt=plain cmd=ng:bare:-6_tunnel_show_mode_gre: gre is not a v6 mode: Unknown tunnel mode","cmd":"ip -6 tunnel show mode gre","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show mode gre"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"-6 tunnel show mode gre"}} +{"id":"tunnel/ng-023","desc":"negative: opt=plain cmd=ng:bare:-6_tunnel_show_ttl_300: invarg(\"invalid TTL\"): one newline (T11)","cmd":"ip -6 tunnel show ttl 300","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show ttl 300"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"-6 tunnel show ttl 300"}} +{"id":"tunnel/ng-024","desc":"negative: opt=plain cmd=ng:bare:-6_tunnel_show_flowlabel_0x100000: a 21-bit flowlabel: invalid Flowlabel","cmd":"ip -6 tunnel show flowlabel 0x100000","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show flowlabel 0x100000"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"-6 tunnel show flowlabel 0x100000"}} +{"id":"tunnel/ng-025","desc":"negative: opt=plain cmd=ng:bare:-6_tunnel_show_dscp_5: dscp takes only inherit","cmd":"ip -6 tunnel show dscp 5","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel show dscp 5"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"-6 tunnel show dscp 5"}} +{"id":"tunnel/ng-026","desc":"negative: opt=plain cmd=ng:bare:-6_tunnel_bogus: an unknown v6 tunnel command","cmd":"ip -6 tunnel bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel bogus"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"-6 tunnel bogus"}} +{"id":"tunnel/ng-027","desc":"negative: opt=plain cmd=ng:bare:-6_tunnel_help: the v6 usage, exit(-1)","cmd":"ip -6 tunnel help","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tunnel help"}],"modules":["ipip","ip_gre","sit","ip_vti","ip6_tunnel","ip6_gre","ip6_vti"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"-6 tunnel help"}} diff --git a/nix/microvms/workbench/tuntap.rows.jsonl b/nix/microvms/workbench/tuntap.rows.jsonl new file mode 100644 index 000000000..942c440fb --- /dev/null +++ b/nix/microvms/workbench/tuntap.rows.jsonl @@ -0,0 +1,49 @@ +# Generated by `nlcapgen matrix -family tuntap -seed 1 -random 0`. +# Do not edit; regenerate. tools/nlcapgen/matrix.go explains the strategies. +# 46 rows. +{"id":"tuntap/ec-001","desc":"boundary: opt=plain cmd=bare:tuntap_show","cmd":"ip tuntap show","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bare","json":"0","words":"tuntap show"}} +{"id":"tuntap/ec-002","desc":"positive: opt=json cmd=tun:tuntap_show","cmd":"ip -j tuntap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tuntap show"}} +{"id":"tuntap/ec-003","desc":"corner: opt=plain cmd=tun:tuntap","cmd":"ip tuntap","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tuntap"}} +{"id":"tuntap/ec-004","desc":"positive: opt=plain cmd=tun:tuntap_list","cmd":"ip tuntap list","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap list"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tuntap list"}} +{"id":"tuntap/ec-005","desc":"positive: opt=plain cmd=tun:tuntap_lst","cmd":"ip tuntap lst","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap lst"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tuntap lst"}} +{"id":"tuntap/ec-006","desc":"corner: opt=plain cmd=tun:tuntap_sh","cmd":"ip tuntap sh","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap sh"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tuntap sh"}} +{"id":"tuntap/ec-007","desc":"positive: opt=plain cmd=tun:tap_show","cmd":"ip tap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tap show"}} +{"id":"tuntap/ec-008","desc":"corner: opt=plain cmd=tun:tap","cmd":"ip tap","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tap"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tap"}} +{"id":"tuntap/ec-009","desc":"positive: opt=plain cmd=tun:-d_tuntap_show","cmd":"ip -d tuntap show","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -d tuntap show"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"-d tuntap show"}} +{"id":"tuntap/ec-010","desc":"corner: opt=plain cmd=tun:-o_tuntap_show","cmd":"ip -o tuntap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -o tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"-o tuntap show"}} +{"id":"tuntap/ec-011","desc":"corner: opt=plain cmd=tun:-s_tuntap_show","cmd":"ip -s tuntap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -s tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"-s tuntap show"}} +{"id":"tuntap/ec-012","desc":"corner: opt=plain cmd=tun:-6_tuntap_show","cmd":"ip -6 tuntap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -6 tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"-6 tuntap show"}} +{"id":"tuntap/ec-013","desc":"corner: opt=plain cmd=tun:tuntap_show_dev_tap0","cmd":"ip tuntap show dev tap0","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap show dev tap0"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tuntap show dev tap0"}} +{"id":"tuntap/ec-014","desc":"corner: opt=plain cmd=tun:tuntap_show_bogus_words","cmd":"ip tuntap show bogus words","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap show bogus words"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tuntap show bogus words"}} +{"id":"tuntap/ec-015","desc":"positive: opt=plain cmd=proc:-d_tuntap_show","cmd":"ip -d tuntap show","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py","setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -d tuntap show"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"proc","json":"0","words":"-d tuntap show"}} +{"id":"tuntap/ec-016","desc":"corner: opt=plain cmd=proc:-o_-d_tuntap_show","cmd":"ip -o -d tuntap show","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py","setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -o -d tuntap show"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"proc","json":"0","words":"-o -d tuntap show"}} +{"id":"tuntap/ec-017","desc":"corner: opt=plain cmd=proc:-d_tuntap","cmd":"ip -d tuntap","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py","setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -d tuntap"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"proc","json":"0","words":"-d tuntap"}} +{"id":"tuntap/ec-018","desc":"corner: opt=plain cmd=xns:-d_tuntap_show","cmd":"ip -d tuntap show","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py","setsid unshare -n sh -c 'ip tuntap add tap0 mode tap && exec python3 /run/tnlholder.py tap0 0x1002' /dev/null 2>&1 & sleep 1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -d tuntap show"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"xns","json":"0","words":"-d tuntap show"}} +{"id":"tuntap/ec-019","desc":"corner: opt=plain cmd=tun:batch:twice","cmd":"ip -batch b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'tuntap show' 'tuntap show dev tap0' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -batch b.txt"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"twice","fix":"tun","json":"0","words":"-batch b.txt"}} +{"id":"tuntap/ec-020","desc":"corner: opt=plain cmd=tun:batch:stdin","cmd":"ip -batch - < b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'tap show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -batch - < b.txt"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"stdin","fix":"tun","json":"0","words":"-batch - < b.txt"}} +{"id":"tuntap/pw-001","desc":"positive: opt=plain cmd=tun:tuntap_show","cmd":"ip tuntap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"0","words":"tuntap show"}} +{"id":"tuntap/pw-002","desc":"boundary: opt=json cmd=bare:tuntap_show","cmd":"ip -j tuntap show","readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bare","json":"1","words":"tuntap show"}} +{"id":"tuntap/pw-003","desc":"corner: opt=json cmd=tun:tuntap","cmd":"ip -j tuntap","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tuntap"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tuntap"}} +{"id":"tuntap/pw-004","desc":"positive: opt=json cmd=tun:tuntap_list","cmd":"ip -j tuntap list","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tuntap list"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tuntap list"}} +{"id":"tuntap/pw-005","desc":"positive: opt=json cmd=tun:tuntap_lst","cmd":"ip -j tuntap lst","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tuntap lst"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tuntap lst"}} +{"id":"tuntap/pw-006","desc":"corner: opt=json cmd=tun:tuntap_sh","cmd":"ip -j tuntap sh","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tuntap sh"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tuntap sh"}} +{"id":"tuntap/pw-007","desc":"positive: opt=json cmd=tun:tap_show","cmd":"ip -j tap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tap show"}} +{"id":"tuntap/pw-008","desc":"corner: opt=json cmd=tun:tap","cmd":"ip -j tap","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tap"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tap"}} +{"id":"tuntap/pw-009","desc":"positive: opt=json cmd=tun:-d_tuntap_show","cmd":"ip -j -d tuntap show","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -d tuntap show"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"-d tuntap show"}} +{"id":"tuntap/pw-010","desc":"corner: opt=json cmd=tun:-o_tuntap_show","cmd":"ip -j -o tuntap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -o tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"-o tuntap show"}} +{"id":"tuntap/pw-011","desc":"corner: opt=json cmd=tun:-s_tuntap_show","cmd":"ip -j -s tuntap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -s tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"-s tuntap show"}} +{"id":"tuntap/pw-012","desc":"corner: opt=json cmd=tun:-6_tuntap_show","cmd":"ip -j -6 tuntap show","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -6 tuntap show"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"-6 tuntap show"}} +{"id":"tuntap/pw-013","desc":"corner: opt=json cmd=tun:tuntap_show_dev_tap0","cmd":"ip -j tuntap show dev tap0","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tuntap show dev tap0"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tuntap show dev tap0"}} +{"id":"tuntap/pw-014","desc":"corner: opt=json cmd=tun:tuntap_show_bogus_words","cmd":"ip -j tuntap show bogus words","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j tuntap show bogus words"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tun","json":"1","words":"tuntap show bogus words"}} +{"id":"tuntap/pw-015","desc":"positive: opt=json cmd=proc:-d_tuntap_show","cmd":"ip -j -d tuntap show","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py","setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -d tuntap show"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"proc","json":"1","words":"-d tuntap show"}} +{"id":"tuntap/pw-016","desc":"corner: opt=json cmd=proc:-o_-d_tuntap_show","cmd":"ip -j -o -d tuntap show","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py","setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -o -d tuntap show"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"proc","json":"1","words":"-o -d tuntap show"}} +{"id":"tuntap/pw-017","desc":"corner: opt=json cmd=proc:-d_tuntap","cmd":"ip -j -d tuntap","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py","setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1","setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -d tuntap"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"proc","json":"1","words":"-d tuntap"}} +{"id":"tuntap/pw-018","desc":"corner: opt=json cmd=xns:-d_tuntap_show","cmd":"ip -j -d tuntap show","pre":["pkill -f '[t]nlholde[r]'; true","ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py","setsid unshare -n sh -c 'ip tuntap add tap0 mode tap && exec python3 /run/tnlholder.py tap0 0x1002' /dev/null 2>&1 & sleep 1"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -d tuntap show"}],"modules":["tun"],"proto":"route","serial":true,"expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"xns","json":"1","words":"-d tuntap show"}} +{"id":"tuntap/pw-019","desc":"corner: opt=json cmd=tun:batch:twice","cmd":"ip -j -batch b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'tuntap show' 'tuntap show dev tap0' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -batch b.txt"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"twice","fix":"tun","json":"1","words":"-batch b.txt"}} +{"id":"tuntap/pw-020","desc":"corner: opt=json cmd=tun:batch:stdin","cmd":"ip -j -batch - < b.txt","pre":["ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none","ip tuntap add tap0 mode tap user 1000 group 100 one_queue","ip tuntap add tun1 mode tun multi_queue vnet_hdr","ip tuntap add tap2 mode tap pi","printf '%s\\n' 'tap show' > b.txt"],"readback":[{"name":"tnlsys","cmd":"tnlsnap -- -j -batch - < b.txt"}],"modules":["tun"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"stdin","fix":"tun","json":"1","words":"-batch - < b.txt"}} +{"id":"tuntap/ng-001","desc":"negative: opt=plain cmd=ng:bare:tuntap_bogus: an unknown tuntap command","cmd":"ip tuntap bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap bogus"}],"modules":["tun"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tuntap bogus"}} +{"id":"tuntap/ng-002","desc":"negative: opt=plain cmd=ng:bare:tuntap_help: the usage, exit(-1)","cmd":"ip tuntap help","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap help"}],"modules":["tun"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tuntap help"}} +{"id":"tuntap/ng-003","desc":"negative: opt=plain cmd=ng:bare:tuntap_add: a write with no mode: refused before any ioctl","cmd":"ip tuntap add","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap add"}],"modules":["tun"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tuntap add"}} +{"id":"tuntap/ng-004","desc":"negative: opt=plain cmd=ng:bare:tuntap_add_mode_bogus: Unknown tunnel mode, before any ioctl","cmd":"ip tuntap add mode bogus","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap add mode bogus"}],"modules":["tun"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tuntap add mode bogus"}} +{"id":"tuntap/ng-005","desc":"negative: opt=plain cmd=ng:bare:tuntap_add_mode_tap_user_nosuchuser: invalid user, before any ioctl","cmd":"ip tuntap add mode tap user nosuchuser","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap add mode tap user nosuchuser"}],"modules":["tun"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tuntap add mode tap user nosuchuser"}} +{"id":"tuntap/ng-006","desc":"negative: opt=plain cmd=ng:bare:tuntap_del: a delete with no mode: refused before any ioctl","cmd":"ip tuntap del","readback":[{"name":"tnlsys","cmd":"tnlsnap -- tuntap del"}],"modules":["tun"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"bare","json":"0","words":"tuntap del"}} diff --git a/pkg/cint/cint.go b/pkg/cint/cint.go index 876a01e15..3a57132df 100644 --- a/pkg/cint/cint.go +++ b/pkg/cint/cint.go @@ -48,6 +48,24 @@ func Int64(v uint64) (int64, bool) { return int64(v), true } +// LongLong is (long long)v: a u64's bits read as a C long long, so +// MaxUint64 is -1, as printf's %lld prints a __u64 counter. +func LongLong(v uint64) int64 { + if v <= math.MaxInt64 { + return int64(v) + } + return -int64(math.MaxUint64-v) - 1 +} + +// U64Bits is (unsigned long long)l: a long's two's-complement bits, so -1 +// is MaxUint64. It is LongLong's inverse. +func U64Bits(l int64) uint64 { + if l >= 0 { + return uint64(l) + } + return math.MaxUint64 - uint64(-(l + 1)) +} + // NegInt64 is -mag as an int64; false past 1<<63, MinInt64's magnitude. func NegInt64(mag uint64) (int64, bool) { if mag == 1<<63 { diff --git a/pkg/cint/cint_test.go b/pkg/cint/cint_test.go index 6aed3d605..c3fe9b5a4 100644 --- a/pkg/cint/cint_test.go +++ b/pkg/cint/cint_test.go @@ -127,6 +127,34 @@ func TestInt64(t *testing.T) { } } +// TestLongLong is LongLong, a u64's two's-complement bits as an int64, +// and U64Bits, its inverse. +// +// go test ./pkg/cint/ -run TestLongLong +func TestLongLong(t *testing.T) { + tests := []struct { + description string + v uint64 + expected int64 + }{ + {"positive: a small counter", 42, 42}, + {"negative: MaxUint64 is -1", math.MaxUint64, -1}, + {"boundary: MaxInt64 stays", math.MaxInt64, math.MaxInt64}, + {"boundary: 1<<63 is MinInt64", 1 << 63, math.MinInt64}, + {"corner: zero", 0, 0}, + } + for _, tt := range tests { + t.Run(tt.description, func(t *testing.T) { + if got := LongLong(tt.v); got != tt.expected { + t.Fatalf("LongLong(%d) = %d, expected %d", tt.v, got, tt.expected) + } + if back := U64Bits(tt.expected); back != tt.v { + t.Fatalf("U64Bits(%d) = %d, expected %d", tt.expected, back, tt.v) + } + }) + } +} + // TestNarrowInt is U8, U16 and U32 of an int: in range, or false. // // go test ./pkg/cint/ -run TestNarrowInt diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/cmd.json new file mode 100644 index 000000000..0a7255d18 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show" + }, + "cmd": "ip tunnel show", + "desc": "boundary: opt=plain cmd=bare:tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-001", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show", + "name": "tnlsys" + } + ], + "result": { + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.out new file mode 100644 index 000000000..3d386ef27 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.out @@ -0,0 +1,4 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.pcap new file mode 100644 index 000000000..79eecb577 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..339604ba1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/tnlsys.out new file mode 100644 index 000000000..e7382be6b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-001/tnlsys.out @@ -0,0 +1,49 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/cmd.json new file mode 100644 index 000000000..0a21c5af7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "1", + "words": "-6 tunnel show" + }, + "cmd": "ip -j -6 tunnel show", + "desc": "boundary: opt=json cmd=bare:-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-002", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.out new file mode 100644 index 000000000..f869f26aa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.out @@ -0,0 +1,4 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.pcap new file mode 100644 index 000000000..53912a230 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..31e97dff7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/tnlsys.out new file mode 100644 index 000000000..86e154737 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-002/tnlsys.out @@ -0,0 +1,37 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/cmd.json new file mode 100644 index 000000000..2889dfe51 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show" + }, + "cmd": "ip tunnel show", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-003", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.pcap new file mode 100644 index 000000000..a9acf9d02 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..671fe3de7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/tnlsys.out new file mode 100644 index 000000000..d5fbf4374 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-003/tnlsys.out @@ -0,0 +1,140 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/cmd.json new file mode 100644 index 000000000..d835ae136 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel" + }, + "cmd": "ip tunnel", + "desc": "corner: opt=plain cmd=tnl4:tunnel", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-004", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.pcap new file mode 100644 index 000000000..8bdcb88e6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..d90b0aa8e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/tnlsys.out new file mode 100644 index 000000000..1617490d9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-004/tnlsys.out @@ -0,0 +1,139 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/cmd.json new file mode 100644 index 000000000..47da86a94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel list" + }, + "cmd": "ip tunnel list", + "desc": "positive: opt=plain cmd=tnl4:tunnel_list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-005", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel list", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.pcap new file mode 100644 index 000000000..7fd85e3e2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..7d3b560d5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/tnlsys.out new file mode 100644 index 000000000..e73525fbb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-005/tnlsys.out @@ -0,0 +1,140 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "list" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/cmd.json new file mode 100644 index 000000000..723a15d13 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel lst" + }, + "cmd": "ip tunnel lst", + "desc": "positive: opt=plain cmd=tnl4:tunnel_lst", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-006", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel lst", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.pcap new file mode 100644 index 000000000..d359a671c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..4df3ce9ce Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/tnlsys.out new file mode 100644 index 000000000..96bfbc207 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-006/tnlsys.out @@ -0,0 +1,140 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "lst" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/cmd.json new file mode 100644 index 000000000..892c69fab --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel sh" + }, + "cmd": "ip tunnel sh", + "desc": "corner: opt=plain cmd=tnl4:tunnel_sh", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-007", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel sh", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.pcap new file mode 100644 index 000000000..dc8d5c2cf Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8add27c45 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/tnlsys.out new file mode 100644 index 000000000..2dec41280 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-007/tnlsys.out @@ -0,0 +1,140 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "sh" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/cmd.json new file mode 100644 index 000000000..1e43071aa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunl show" + }, + "cmd": "ip tunl show", + "desc": "corner: opt=plain cmd=tnl4:tunl_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-008", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunl show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.pcap new file mode 100644 index 000000000..765851238 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..13775bb98 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/tnlsys.out new file mode 100644 index 000000000..37629be96 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-008/tnlsys.out @@ -0,0 +1,140 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunl", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/cmd.json new file mode 100644 index 000000000..8373ef0dc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "-4 tunnel show" + }, + "cmd": "ip -4 tunnel show", + "desc": "positive: opt=plain cmd=tnl4:-4_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-009", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -4 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.pcap new file mode 100644 index 000000000..b12db223e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..50333b443 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/tnlsys.out new file mode 100644 index 000000000..0de9d8b6d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-009/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-4", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/cmd.json new file mode 100644 index 000000000..ea0dc941c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "-s tunnel show" + }, + "cmd": "ip -s tunnel show", + "desc": "positive: opt=plain cmd=tnl4:-s_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-010", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -s tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.out new file mode 100644 index 000000000..bd648f6ca --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.out @@ -0,0 +1,76 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +isan: any/ip remote any local 192.0.2.2 ttl inherit +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.pcap new file mode 100644 index 000000000..4230e846e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..03df497ef Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/tnlsys.out new file mode 100644 index 000000000..2885da7d4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-010/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-s", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nisan: any/ip remote any local 192.0.2.2 ttl inherit\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/cmd.json new file mode 100644 index 000000000..966ab672d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "-d tunnel show" + }, + "cmd": "ip -d tunnel show", + "desc": "corner: opt=plain cmd=tnl4:-d_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-011", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -d tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.pcap new file mode 100644 index 000000000..6b2460f70 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..e3d035f99 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/tnlsys.out new file mode 100644 index 000000000..42c10c9d1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-011/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-d", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/cmd.json new file mode 100644 index 000000000..ca61a51bc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "-o tunnel show" + }, + "cmd": "ip -o tunnel show", + "desc": "corner: opt=plain cmd=tnl4:-o_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-012", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -o tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.out new file mode 100644 index 000000000..0785405c3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.out @@ -0,0 +1,14 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\ Drop packets out of sequence.\ Checksum in received packet is required.\ Sequence packets on output.\ Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\ Drop packets out of sequence.\ Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.pcap new file mode 100644 index 000000000..cbb311073 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ca87d3bc9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/tnlsys.out new file mode 100644 index 000000000..2c73d79b7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-012/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-o", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\\ Drop packets out of sequence.\\ Checksum in received packet is required.\\ Sequence packets on output.\\ Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\\ Drop packets out of sequence.\\ Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/cmd.json new file mode 100644 index 000000000..09af9fdf6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "-p tunnel show" + }, + "cmd": "ip -p tunnel show", + "desc": "corner: opt=plain cmd=tnl4:-p_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-013", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -p tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.out new file mode 100644 index 000000000..c059fa042 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.out @@ -0,0 +1,20 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.pcap new file mode 100644 index 000000000..c8c799ce1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..bd0918b63 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/tnlsys.out new file mode 100644 index 000000000..3f774cbb8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-013/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-p", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/cmd.json new file mode 100644 index 000000000..55dbe34da --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show remote 198.51.100.2" + }, + "cmd": "ip tunnel show remote 198.51.100.2", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_remote_198.51.100.2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-014", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show remote 198.51.100.2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.out new file mode 100644 index 000000000..82ed56e84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.out @@ -0,0 +1,5 @@ +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.pcap new file mode 100644 index 000000000..0f87c8407 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..65dc9a24d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/tnlsys.out new file mode 100644 index 000000000..e4dd5fb88 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-014/tnlsys.out @@ -0,0 +1,114 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "remote", + "198.51.100.2" + ], + "rc": 0, + "stdout": "gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/cmd.json new file mode 100644 index 000000000..74a2bc6e4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show local 192.0.2.1" + }, + "cmd": "ip tunnel show local 192.0.2.1", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_local_192.0.2.1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-015", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show local 192.0.2.1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.out new file mode 100644 index 000000000..07ca94c84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.out @@ -0,0 +1,14 @@ +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.pcap new file mode 100644 index 000000000..7ca14e13b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ba7d35dc4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/tnlsys.out new file mode 100644 index 000000000..b029cbf62 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-015/tnlsys.out @@ -0,0 +1,135 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "local", + "192.0.2.1" + ], + "rc": 0, + "stdout": "ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/cmd.json new file mode 100644 index 000000000..244e2ff74 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show dev d0" + }, + "cmd": "ip tunnel show dev d0", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-016", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show dev d0", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.out new file mode 100644 index 000000000..f2ca07cfb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.out @@ -0,0 +1 @@ +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.pcap new file mode 100644 index 000000000..942896de1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..73dcf7555 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/tnlsys.out new file mode 100644 index 000000000..92f387519 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-016/tnlsys.out @@ -0,0 +1,114 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "dev", + "d0" + ], + "rc": 0, + "stdout": "ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/cmd.json new file mode 100644 index 000000000..737e87dd5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show isa1" + }, + "cmd": "ip tunnel show isa1", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_isa1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-017", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show isa1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.out new file mode 100644 index 000000000..9aa20d0ef --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.out @@ -0,0 +1 @@ +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.pcap new file mode 100644 index 000000000..ed8cdad04 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..83a70aec7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/tnlsys.out new file mode 100644 index 000000000..43956ee8b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-017/tnlsys.out @@ -0,0 +1,36 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "isa1" + ], + "rc": 0, + "stdout": "isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/cmd.json new file mode 100644 index 000000000..d12a0e2e9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show isan" + }, + "cmd": "ip tunnel show isan", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_isan", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-018", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show isan", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.out new file mode 100644 index 000000000..2d18634d3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.out @@ -0,0 +1 @@ +isan: any/ip remote any local 192.0.2.2 ttl inherit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.pcap new file mode 100644 index 000000000..ca21a398c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..71fe0afd4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/tnlsys.out new file mode 100644 index 000000000..4f6b5cc09 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-018/tnlsys.out @@ -0,0 +1,22 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "isan" + ], + "rc": 0, + "stdout": "isan: any/ip remote any local 192.0.2.2 ttl inherit\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/cmd.json new file mode 100644 index 000000000..acb4696e5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show sit2" + }, + "cmd": "ip tunnel show sit2", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_sit2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-019", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show sit2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.out new file mode 100644 index 000000000..9af091b48 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.out @@ -0,0 +1 @@ +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/tnlsys.out new file mode 100644 index 000000000..603a286f3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-019/tnlsys.out @@ -0,0 +1,29 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "73697432000000000000000000000000000000000000000000000000000000004500000000004000002900000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "sit2" + ], + "rc": 0, + "stdout": "sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/cmd.json new file mode 100644 index 000000000..6db7cb84b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show nosuch" + }, + "cmd": "ip tunnel show nosuch", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_nosuch", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-020", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show nosuch", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.pcap new file mode 100644 index 000000000..2a1458a7f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..b49a56a87 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/tnlsys.out new file mode 100644 index 000000000..5c5f00c1b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-020/tnlsys.out @@ -0,0 +1,13 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "nosuch" + ], + "rc": 0, + "stdout": "", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/cmd.json new file mode 100644 index 000000000..7fefd940c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show name ipip2" + }, + "cmd": "ip tunnel show name ipip2", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_name_ipip2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-021", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show name ipip2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.out new file mode 100644 index 000000000..0cc537495 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.out @@ -0,0 +1 @@ +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/tnlsys.out new file mode 100644 index 000000000..49e8ce8a7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-021/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "69706970320000000000000000000000000000000000000000000000000000004500000000004000000400000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "name", + "ipip2" + ], + "rc": 0, + "stdout": "ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/cmd.json new file mode 100644 index 000000000..43d33b8e5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show gre1" + }, + "cmd": "ip tunnel show gre1", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_gre1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-022", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show gre1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.out new file mode 100644 index 000000000..82ed56e84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.out @@ -0,0 +1,5 @@ +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/tnlsys.out new file mode 100644 index 000000000..5c2ac5499 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-022/tnlsys.out @@ -0,0 +1,22 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "67726531000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "gre1" + ], + "rc": 0, + "stdout": "gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/cmd.json new file mode 100644 index 000000000..e8e610e0d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show ipip1" + }, + "cmd": "ip tunnel show ipip1", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_ipip1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-023", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show ipip1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.out new file mode 100644 index 000000000..f2ca07cfb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.out @@ -0,0 +1 @@ +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.pcap new file mode 100644 index 000000000..6e8c28b4d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..2ee2bd402 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/tnlsys.out new file mode 100644 index 000000000..dc848c494 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-023/tnlsys.out @@ -0,0 +1,22 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "69706970310000000000000000000000000000000000000000000000000000004500000000004000000400000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "ipip1" + ], + "rc": 0, + "stdout": "ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/cmd.json new file mode 100644 index 000000000..68c4bff93 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show sit1" + }, + "cmd": "ip tunnel show sit1", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_sit1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-024", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show sit1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.out new file mode 100644 index 000000000..7fd168b4d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.out @@ -0,0 +1 @@ +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/tnlsys.out new file mode 100644 index 000000000..992521fae --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-024/tnlsys.out @@ -0,0 +1,22 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "73697431000000000000000000000000000000000000000000000000000000004500000000004000002900000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "sit1" + ], + "rc": 0, + "stdout": "sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/cmd.json new file mode 100644 index 000000000..0ff17d978 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show vti1" + }, + "cmd": "ip tunnel show vti1", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_vti1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-025", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show vti1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.out new file mode 100644 index 000000000..0a985d176 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.out @@ -0,0 +1 @@ +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/tnlsys.out new file mode 100644 index 000000000..1a5963118 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-025/tnlsys.out @@ -0,0 +1,22 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "76746931000000000000000000000000000000000100000000000000000000004500000000004000000400000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "vti1" + ], + "rc": 0, + "stdout": "vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/cmd.json new file mode 100644 index 000000000..d33660954 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode gre" + }, + "cmd": "ip tunnel show mode gre", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_mode_gre", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-026", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode gre", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.out new file mode 100644 index 000000000..3b0214d75 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.out @@ -0,0 +1 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/tnlsys.out new file mode 100644 index 000000000..7193fcfca --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-026/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "gre" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/cmd.json new file mode 100644 index 000000000..2cf7f2698 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode ipip" + }, + "cmd": "ip tunnel show mode ipip", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_mode_ipip", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-027", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode ipip", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.out new file mode 100644 index 000000000..1c06b9a3d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.out @@ -0,0 +1 @@ +tunl0: any/ip remote any local any ttl inherit nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/tnlsys.out new file mode 100644 index 000000000..d71d70a81 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-027/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000000400000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "ipip" + ], + "rc": 0, + "stdout": "tunl0: any/ip remote any local any ttl inherit nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/cmd.json new file mode 100644 index 000000000..215ca71e7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode sit" + }, + "cmd": "ip tunnel show mode sit", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_mode_sit", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-028", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode sit", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.out new file mode 100644 index 000000000..6e2f8f415 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.out @@ -0,0 +1 @@ +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/tnlsys.out new file mode 100644 index 000000000..b2a60f934 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-028/tnlsys.out @@ -0,0 +1,30 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000002900000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "sit" + ], + "rc": 0, + "stdout": "sit0: ipv6/ip remote any local any ttl 64 nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/cmd.json new file mode 100644 index 000000000..3563d79e5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode isatap" + }, + "cmd": "ip tunnel show mode isatap", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_mode_isatap", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-029", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode isatap", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.out new file mode 100644 index 000000000..6e2f8f415 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.out @@ -0,0 +1 @@ +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/tnlsys.out new file mode 100644 index 000000000..0a3e5dfcd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-029/tnlsys.out @@ -0,0 +1,30 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000100000000000000000000004500000000004000002900000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "isatap" + ], + "rc": 0, + "stdout": "sit0: ipv6/ip remote any local any ttl 64 nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/cmd.json new file mode 100644 index 000000000..5cf28e9d4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode vti" + }, + "cmd": "ip tunnel show mode vti", + "desc": "positive: opt=plain cmd=tnl4:tunnel_show_mode_vti", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-030", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode vti", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.out new file mode 100644 index 000000000..ab6c8e600 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.out @@ -0,0 +1 @@ +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/tnlsys.out new file mode 100644 index 000000000..6c93d413f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-030/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000100000000000000000000004500000000004000000400000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "vti" + ], + "rc": 0, + "stdout": "ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/cmd.json new file mode 100644 index 000000000..4dfdbafe7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "-s tunnel show gre1" + }, + "cmd": "ip -s tunnel show gre1", + "desc": "corner: opt=plain cmd=tnl4:-s_tunnel_show_gre1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-031", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -s tunnel show gre1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.out new file mode 100644 index 000000000..82ed56e84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.out @@ -0,0 +1,5 @@ +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/tnlsys.out new file mode 100644 index 000000000..cd5cbd625 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-031/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "67726531000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + } + ], + "run": { + "argv": [ + "ip", + "-s", + "tunnel", + "show", + "gre1" + ], + "rc": 0, + "stdout": "gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/cmd.json new file mode 100644 index 000000000..0924b9923 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5" + }, + "cmd": "ip tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_mode_gre_remote_198.51.100.2_local_192.0.2.1_key_5", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-032", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.out new file mode 100644 index 000000000..82ed56e84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.out @@ -0,0 +1,5 @@ +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/tnlsys.out new file mode 100644 index 000000000..b0ab05938 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-032/tnlsys.out @@ -0,0 +1,29 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000002000200000000005000000054500000000004000002f0000c0000201c6336402", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "gre", + "remote", + "198.51.100.2", + "local", + "192.0.2.1", + "key", + "5" + ], + "rc": 0, + "stdout": "gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/cmd.json new file mode 100644 index 000000000..65fb3a96a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode gre remote 198.51.100.2" + }, + "cmd": "ip tunnel show mode gre remote 198.51.100.2", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_mode_gre_remote_198.51.100.2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-033", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode gre remote 198.51.100.2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.out new file mode 100644 index 000000000..3b0214d75 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.out @@ -0,0 +1 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/tnlsys.out new file mode 100644 index 000000000..64cf093ce --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-033/tnlsys.out @@ -0,0 +1,25 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000002f000000000000c6336402", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "gre", + "remote", + "198.51.100.2" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/cmd.json new file mode 100644 index 000000000..aba53cf85 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode gre remote 239.1.1.1 local 192.0.2.1" + }, + "cmd": "ip tunnel show mode gre remote 239.1.1.1 local 192.0.2.1", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_mode_gre_remote_239.1.1.1_local_192.0.2.1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-034", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode gre remote 239.1.1.1 local 192.0.2.1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.out new file mode 100644 index 000000000..4362e79a1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.out @@ -0,0 +1 @@ +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/tnlsys.out new file mode 100644 index 000000000..668841386 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-034/tnlsys.out @@ -0,0 +1,27 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "000000000000000000000000000000000000000020002000ef010101ef0101014500000000004000002f0000c0000201ef010101", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "gre", + "remote", + "239.1.1.1", + "local", + "192.0.2.1" + ], + "rc": 0, + "stdout": "gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/cmd.json new file mode 100644 index 000000000..67f412022 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + }, + "cmd": "ip tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_mode_vti_remote_198.51.100.5_local_192.0.2.1_ikey_7_okey_8", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-035", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.out new file mode 100644 index 000000000..0a985d176 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.out @@ -0,0 +1 @@ +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/tnlsys.out new file mode 100644 index 000000000..8bd0bec31 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-035/tnlsys.out @@ -0,0 +1,31 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "0000000000000000000000000000000000000000210020000000000700000008450000000000400000040000c0000201c6336405", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "vti", + "remote", + "198.51.100.5", + "local", + "192.0.2.1", + "ikey", + "7", + "okey", + "8" + ], + "rc": 0, + "stdout": "vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/cmd.json new file mode 100644 index 000000000..5f89cfbbc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show mode any" + }, + "cmd": "ip tunnel show mode any", + "desc": "corner: opt=plain cmd=tnl4:tunnel_show_mode_any", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-036", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode any", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.out new file mode 100644 index 000000000..6c1de7c74 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.out @@ -0,0 +1,3 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.pcap new file mode 100644 index 000000000..6783b2811 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..981f8b99d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/tnlsys.out new file mode 100644 index 000000000..df1c77e69 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-036/tnlsys.out @@ -0,0 +1,37 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "any" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/cmd.json new file mode 100644 index 000000000..0815c11d9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "-6 tunnel show" + }, + "cmd": "ip -6 tunnel show", + "desc": "corner: opt=plain cmd=tnl4:-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-037", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.out new file mode 100644 index 000000000..6c1de7c74 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.out @@ -0,0 +1,3 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.pcap new file mode 100644 index 000000000..fc8704473 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..d34a0004c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/tnlsys.out new file mode 100644 index 000000000..70f510056 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-037/tnlsys.out @@ -0,0 +1,36 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/cmd.json new file mode 100644 index 000000000..df2bb7990 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "prl16", + "json": "0", + "words": "tunnel show isa16" + }, + "cmd": "ip tunnel show isa16", + "desc": "positive: opt=plain cmd=prl16:tunnel_show_isa16", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-038", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip tunnel add isa16 mode isatap local 192.0.2.1", + "i=10; while [ $i -lt 26 ]; do ip tunnel prl dev isa16 prl-nodefault 192.0.2.$i || exit 1; i=$((i+1)); done" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show isa16", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa16 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "i=10; while [ $i -lt 26 ]; do ip tunnel prl dev isa16 prl-nodefault 192.0.2.$i || exit 1; i=$((i+1)); done", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.out new file mode 100644 index 000000000..9b44812ed --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.out @@ -0,0 +1 @@ +isa16: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.25 pr 192.0.2.24 pr 192.0.2.23 pr 192.0.2.22 pr 192.0.2.21 pr 192.0.2.20 pr 192.0.2.19 pr 192.0.2.18 pr 192.0.2.17 pr 192.0.2.16 pr 192.0.2.15 pr 192.0.2.14 pr 192.0.2.13 pr 192.0.2.12 pr 192.0.2.11 ttl inherit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.pcap new file mode 100644 index 000000000..872876b62 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..76f502308 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/tnlsys.out new file mode 100644 index 000000000..df10a29a1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-038/tnlsys.out @@ -0,0 +1,36 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa16", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613136000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa16", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "0000000000000000f000000000000000c0000219000000000000000000000000c0000218000000000000000000000000c0000217000000000000000000000000c0000216000000000000000000000000c0000215000000000000000000000000c0000214000000000000000000000000c0000213000000000000000000000000c0000212000000000000000000000000c0000211000000000000000000000000c0000210000000000000000000000000c000020f000000000000000000000000c000020e000000000000000000000000c000020d000000000000000000000000c000020c000000000000000000000000c000020b000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa16", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "isa16" + ], + "rc": 0, + "stdout": "isa16: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.25 pr 192.0.2.24 pr 192.0.2.23 pr 192.0.2.22 pr 192.0.2.21 pr 192.0.2.20 pr 192.0.2.19 pr 192.0.2.18 pr 192.0.2.17 pr 192.0.2.16 pr 192.0.2.15 pr 192.0.2.14 pr 192.0.2.13 pr 192.0.2.12 pr 192.0.2.11 ttl inherit\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/cmd.json new file mode 100644 index 000000000..37031f0e3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show" + }, + "cmd": "ip -6 tunnel show", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-039", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.out new file mode 100644 index 000000000..076238745 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.out @@ -0,0 +1,12 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.pcap new file mode 100644 index 000000000..9c7d3fd63 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..d8465fa83 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/tnlsys.out new file mode 100644 index 000000000..4bff532e8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-039/tnlsys.out @@ -0,0 +1,71 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/cmd.json new file mode 100644 index 000000000..b45ba890d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel" + }, + "cmd": "ip -6 tunnel", + "desc": "corner: opt=plain cmd=tnl6:-6_tunnel", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-040", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.out new file mode 100644 index 000000000..076238745 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.out @@ -0,0 +1,12 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.pcap new file mode 100644 index 000000000..98d8aca7d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..924e41416 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/tnlsys.out new file mode 100644 index 000000000..50f30be23 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-040/tnlsys.out @@ -0,0 +1,70 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/cmd.json new file mode 100644 index 000000000..768c42236 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel list" + }, + "cmd": "ip -6 tunnel list", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-041", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel list", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.out new file mode 100644 index 000000000..076238745 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.out @@ -0,0 +1,12 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.pcap new file mode 100644 index 000000000..cd5139e79 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..e2dc0898a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/tnlsys.out new file mode 100644 index 000000000..7fd31608d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-041/tnlsys.out @@ -0,0 +1,71 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "list" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/cmd.json new file mode 100644 index 000000000..33332b799 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-s -6 tunnel show" + }, + "cmd": "ip -s -6 tunnel show", + "desc": "positive: opt=plain cmd=tnl6:-s_-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-042", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -s -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.out new file mode 100644 index 000000000..f8f24f2a5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.out @@ -0,0 +1,44 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.pcap new file mode 100644 index 000000000..64110c50f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..5fcd8b7a9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/tnlsys.out new file mode 100644 index 000000000..4dbc433ff --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-042/tnlsys.out @@ -0,0 +1,72 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-s", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/cmd.json new file mode 100644 index 000000000..e0c477c0a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-o -6 tunnel show" + }, + "cmd": "ip -o -6 tunnel show", + "desc": "corner: opt=plain cmd=tnl6:-o_-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-043", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -o -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.out new file mode 100644 index 000000000..94968692a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.out @@ -0,0 +1,8 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\ Drop packets out of sequence.\ Checksum in received packet is required.\ Sequence packets on output.\ Checksum output packets. +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.pcap new file mode 100644 index 000000000..81e752279 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ed7a5f78d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/tnlsys.out new file mode 100644 index 000000000..35e683169 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-043/tnlsys.out @@ -0,0 +1,72 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-o", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\\ Drop packets out of sequence.\\ Checksum in received packet is required.\\ Sequence packets on output.\\ Checksum output packets.\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/cmd.json new file mode 100644 index 000000000..d7402638a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show ip6t1" + }, + "cmd": "ip -6 tunnel show ip6t1", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_ip6t1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-044", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show ip6t1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.out new file mode 100644 index 000000000..10c4b5ee9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.pcap new file mode 100644 index 000000000..0a836a186 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..4b50a7e8b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/tnlsys.out new file mode 100644 index 000000000..5b70ca222 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-044/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "69703674310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "ip6t1" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/cmd.json new file mode 100644 index 000000000..a9e9dd46b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-s -6 tunnel show ip6t1" + }, + "cmd": "ip -s -6 tunnel show ip6t1", + "desc": "corner: opt=plain cmd=tnl6:-s_-6_tunnel_show_ip6t1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-045", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -s -6 tunnel show ip6t1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.out new file mode 100644 index 000000000..5dc990eea --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.out @@ -0,0 +1,5 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.pcap new file mode 100644 index 000000000..39b322928 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..36954f54f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/tnlsys.out new file mode 100644 index 000000000..39585b9f2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-045/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "697036743100000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-s", + "-6", + "tunnel", + "show", + "ip6t1" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/cmd.json new file mode 100644 index 000000000..9b76537f8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show name ip6g1" + }, + "cmd": "ip -6 tunnel show name ip6g1", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_name_ip6g1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-046", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show name ip6g1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.out new file mode 100644 index 000000000..ec69252af --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.out @@ -0,0 +1,5 @@ +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/tnlsys.out new file mode 100644 index 000000000..0694a8694 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-046/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "69703667310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "name", + "ip6g1" + ], + "rc": 0, + "stdout": "ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/cmd.json new file mode 100644 index 000000000..84eed9299 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show ip6tnl0" + }, + "cmd": "ip -6 tunnel show ip6tnl0", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_ip6tnl0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-047", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show ip6tnl0", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.out new file mode 100644 index 000000000..9c9c2b1db --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.out @@ -0,0 +1 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/tnlsys.out new file mode 100644 index 000000000..da575c0ba --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-047/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "697036746e6c30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "ip6tnl0" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/cmd.json new file mode 100644 index 000000000..6652b6a14 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show mode ip6gre" + }, + "cmd": "ip -6 tunnel show mode ip6gre", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_ip6gre", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-048", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show mode ip6gre", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.out new file mode 100644 index 000000000..d7d1e0cdb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.out @@ -0,0 +1,7 @@ +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.pcap new file mode 100644 index 000000000..1ace1c3fe Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ea88e85d0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/tnlsys.out new file mode 100644 index 000000000..6932fcc7b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-048/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "mode", + "ip6gre" + ], + "rc": 0, + "stdout": "ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/cmd.json new file mode 100644 index 000000000..7ac0bf429 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show mode ip6ip6" + }, + "cmd": "ip -6 tunnel show mode ip6ip6", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_ip6ip6", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-049", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show mode ip6ip6", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.out new file mode 100644 index 000000000..1f207508f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.out @@ -0,0 +1,4 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.pcap new file mode 100644 index 000000000..b2fd54289 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..445af3802 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/tnlsys.out new file mode 100644 index 000000000..b6e132b1f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-049/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "mode", + "ip6ip6" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/cmd.json new file mode 100644 index 000000000..1e2c87e14 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show mode ipip6" + }, + "cmd": "ip -6 tunnel show mode ipip6", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_ipip6", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-050", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show mode ipip6", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.out new file mode 100644 index 000000000..34a6ea2fb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.out @@ -0,0 +1 @@ +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.pcap new file mode 100644 index 000000000..c8968694f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ae0e642e6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/tnlsys.out new file mode 100644 index 000000000..7df5147b4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-050/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "mode", + "ipip6" + ], + "rc": 0, + "stdout": "ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/cmd.json new file mode 100644 index 000000000..7d787808f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show mode vti6" + }, + "cmd": "ip -6 tunnel show mode vti6", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_vti6", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-051", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show mode vti6", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.out new file mode 100644 index 000000000..1f207508f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.out @@ -0,0 +1,4 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.pcap new file mode 100644 index 000000000..d31e217e1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..24503345a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/tnlsys.out new file mode 100644 index 000000000..ed33bbb3c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-051/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "mode", + "vti6" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/cmd.json new file mode 100644 index 000000000..81f7d41d0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show mode any" + }, + "cmd": "ip -6 tunnel show mode any", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_mode_any", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-052", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show mode any", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.out new file mode 100644 index 000000000..076238745 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.out @@ -0,0 +1,12 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.pcap new file mode 100644 index 000000000..c68c07e39 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ddd7422d1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/tnlsys.out new file mode 100644 index 000000000..7e6729433 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-052/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "mode", + "any" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/cmd.json new file mode 100644 index 000000000..fdf40d9cf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "tunnel show mode ip6ip6" + }, + "cmd": "ip tunnel show mode ip6ip6", + "desc": "corner: opt=plain cmd=tnl6:tunnel_show_mode_ip6ip6", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-053", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode ip6ip6", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.out new file mode 100644 index 000000000..1f207508f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.out @@ -0,0 +1,4 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.pcap new file mode 100644 index 000000000..8f12ae717 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..a4116034d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/tnlsys.out new file mode 100644 index 000000000..60d2a9fcf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-053/tnlsys.out @@ -0,0 +1,72 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "ip6ip6" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/cmd.json new file mode 100644 index 000000000..fd86ff4f1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show remote 2001:db8::2" + }, + "cmd": "ip -6 tunnel show remote 2001:db8::2", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_remote_2001:db8::2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-054", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show remote 2001:db8::2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.out new file mode 100644 index 000000000..470b4c71f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.pcap new file mode 100644 index 000000000..052d147fc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..873df320a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/tnlsys.out new file mode 100644 index 000000000..ffe9b86db --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-054/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "remote", + "2001:db8::2" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/cmd.json new file mode 100644 index 000000000..bd69b1c98 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show local 2001:db8::1" + }, + "cmd": "ip -6 tunnel show local 2001:db8::1", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_local_2001:db8::1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-055", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show local 2001:db8::1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.out new file mode 100644 index 000000000..dd3176d9b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.out @@ -0,0 +1,9 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.pcap new file mode 100644 index 000000000..459ba07c4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..52b3669be Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/tnlsys.out new file mode 100644 index 000000000..a8d547137 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-055/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "local", + "2001:db8::1" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/cmd.json new file mode 100644 index 000000000..5b18ef290 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show dev d0" + }, + "cmd": "ip -6 tunnel show dev d0", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-056", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show dev d0", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.out new file mode 100644 index 000000000..470b4c71f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.pcap new file mode 100644 index 000000000..8d88662a9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ea67bbe6d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/tnlsys.out new file mode 100644 index 000000000..ba92472c5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-056/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "dev", + "d0" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/cmd.json new file mode 100644 index 000000000..86b1b6d00 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show encaplimit none" + }, + "cmd": "ip -6 tunnel show encaplimit none", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_encaplimit_none", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-057", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show encaplimit none", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.out new file mode 100644 index 000000000..470b4c71f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.pcap new file mode 100644 index 000000000..40ca9a471 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..0a875bd62 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/tnlsys.out new file mode 100644 index 000000000..297695852 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-057/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "encaplimit", + "none" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/cmd.json new file mode 100644 index 000000000..47f513f8d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show hoplimit 1" + }, + "cmd": "ip -6 tunnel show hoplimit 1", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_hoplimit_1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-058", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show hoplimit 1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.out new file mode 100644 index 000000000..470b4c71f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.pcap new file mode 100644 index 000000000..aca186457 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..59c92f80c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/tnlsys.out new file mode 100644 index 000000000..fc359a8e2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-058/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "hoplimit", + "1" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/cmd.json new file mode 100644 index 000000000..a4555cff5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show tclass inherit" + }, + "cmd": "ip -6 tunnel show tclass inherit", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_tclass_inherit", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-059", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show tclass inherit", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.out new file mode 100644 index 000000000..470b4c71f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.pcap new file mode 100644 index 000000000..3dda08a4d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dc6fb18f0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/tnlsys.out new file mode 100644 index 000000000..b732ebe98 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-059/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "tclass", + "inherit" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/cmd.json new file mode 100644 index 000000000..d473a3ac2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show flowlabel 0x12345" + }, + "cmd": "ip -6 tunnel show flowlabel 0x12345", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_flowlabel_0x12345", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-060", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show flowlabel 0x12345", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.out new file mode 100644 index 000000000..470b4c71f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.pcap new file mode 100644 index 000000000..3911ba1f3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f834fb851 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/tnlsys.out new file mode 100644 index 000000000..cbf6211de --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-060/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "flowlabel", + "0x12345" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/cmd.json new file mode 100644 index 000000000..ee6f6d186 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show key 9" + }, + "cmd": "ip -6 tunnel show key 9", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_key_9", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-061", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show key 9", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.out new file mode 100644 index 000000000..076238745 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.out @@ -0,0 +1,12 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.pcap new file mode 100644 index 000000000..37151c89c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..6c2eacacb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/tnlsys.out new file mode 100644 index 000000000..0e77a7c64 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-061/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "key", + "9" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/cmd.json new file mode 100644 index 000000000..e80ae10ff --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show allow-localremote" + }, + "cmd": "ip -6 tunnel show allow-localremote", + "desc": "positive: opt=plain cmd=tnl6:-6_tunnel_show_allow-localremote", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-062", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show allow-localremote", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.out new file mode 100644 index 000000000..470b4c71f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.pcap new file mode 100644 index 000000000..80e8f0d3a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f3c5f4c0a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/tnlsys.out new file mode 100644 index 000000000..ec1da529f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-062/tnlsys.out @@ -0,0 +1,72 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "allow-localremote" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/cmd.json new file mode 100644 index 000000000..3ce7d088b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show encaplimit 300" + }, + "cmd": "ip -6 tunnel show encaplimit 300", + "desc": "corner: opt=plain cmd=tnl6:-6_tunnel_show_encaplimit_300", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-063", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show encaplimit 300", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.out new file mode 100644 index 000000000..076238745 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.out @@ -0,0 +1,12 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote +ip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +vti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4 +gre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.pcap new file mode 100644 index 000000000..bc617717d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..536a0de1b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/tnlsys.out new file mode 100644 index 000000000..c65dd9c5b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-063/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "encaplimit", + "300" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote\nip6t2: ip/ipv6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit (flowinfo 0x02000000) dscp inherit\nip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\nvti61: ipv6/ipv6 remote 2001:db8::5 local 2001:db8::1 encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) ikey 3 okey 4\ngre6x: gre/ipv6 remote 2001:db8::6 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/cmd.json new file mode 100644 index 000000000..a579a417a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "tunnel show" + }, + "cmd": "ip tunnel show", + "desc": "positive: opt=plain cmd=tnl6:tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-064", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.out new file mode 100644 index 000000000..3d386ef27 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.out @@ -0,0 +1,4 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.pcap new file mode 100644 index 000000000..8ea2fdc5c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..96b6cb1b9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/tnlsys.out new file mode 100644 index 000000000..e7382be6b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-064/tnlsys.out @@ -0,0 +1,49 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/cmd.json new file mode 100644 index 000000000..68412493f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "tunnel show gre6x" + }, + "cmd": "ip tunnel show gre6x", + "desc": "corner: opt=plain cmd=tnl6:tunnel_show_gre6x", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-065", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show gre6x", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.out new file mode 100644 index 000000000..b4f320308 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.out @@ -0,0 +1 @@ +gre6x: any/ip remote 32.1.13.184 local 0.0.0.1 ttl inherit tos inherit nopmtudisc ikey 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/tnlsys.out new file mode 100644 index 000000000..014215e5d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-065/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "67726536780000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8", + "spill": "000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "gre6x" + ], + "rc": 0, + "stdout": "gre6x: any/ip remote 32.1.13.184 local 0.0.0.1 ttl inherit tos inherit nopmtudisc ikey 0\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/cmd.json new file mode 100644 index 000000000..8dc0edbe1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/cmd.json @@ -0,0 +1,74 @@ +{ + "axes": { + "fix": "ext", + "json": "0", + "words": "tunnel show" + }, + "cmd": "ip tunnel show", + "desc": "corner: opt=plain cmd=ext:tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-066", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipipx type ipip external", + "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipipx type ipip external", + "rc": 0 + }, + { + "cmd": "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "rc": 0 + }, + { + "cmd": "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "rc": 0 + }, + { + "cmd": "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.out new file mode 100644 index 000000000..3cd235cab --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.out @@ -0,0 +1,5 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +ipipx: any/ip remote any local any ttl inherit +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipipx: any/ip remote any local any ttl inherit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.pcap new file mode 100644 index 000000000..55023aaf1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f057c0c1e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/tnlsys.out new file mode 100644 index 000000000..c12e5b9d6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-066/tnlsys.out @@ -0,0 +1,56 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69706970780000000000000000000000000000000000000000000000000000004500000000004000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipipx", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69706970780000000000000000000000000000000000000000000000000000004500000000004000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\nipipx: any/ip remote any local any ttl inherit\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipipx: any/ip remote any local any ttl inherit\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/cmd.json new file mode 100644 index 000000000..986cd6326 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/cmd.json @@ -0,0 +1,74 @@ +{ + "axes": { + "fix": "ext", + "json": "0", + "words": "-6 tunnel show" + }, + "cmd": "ip -6 tunnel show", + "desc": "corner: opt=plain cmd=ext:-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-067", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipipx type ipip external", + "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipipx type ipip external", + "rc": 0 + }, + { + "cmd": "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "rc": 0 + }, + { + "cmd": "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "rc": 0 + }, + { + "cmd": "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.out new file mode 100644 index 000000000..6c1de7c74 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.out @@ -0,0 +1,3 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.pcap new file mode 100644 index 000000000..4941063a1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..5d88b7907 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/tnlsys.out new file mode 100644 index 000000000..70f510056 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-067/tnlsys.out @@ -0,0 +1,36 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/cmd.json new file mode 100644 index 000000000..f4294ce9b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/cmd.json @@ -0,0 +1,74 @@ +{ + "axes": { + "fix": "ext", + "json": "0", + "words": "tunnel show ipipx" + }, + "cmd": "ip tunnel show ipipx", + "desc": "corner: opt=plain cmd=ext:tunnel_show_ipipx", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-068", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipipx type ipip external", + "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show ipipx", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipipx type ipip external", + "rc": 0 + }, + { + "cmd": "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "rc": 0 + }, + { + "cmd": "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "rc": 0 + }, + { + "cmd": "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.out new file mode 100644 index 000000000..e553d036f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.out @@ -0,0 +1 @@ +ipipx: any/ip remote any local any ttl inherit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/tnlsys.out new file mode 100644 index 000000000..966294530 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-068/tnlsys.out @@ -0,0 +1,22 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipipx", + "in": "69706970780000000000000000000000000000000000000000000000000000004500000000004000000400000000000000000000", + "out": "69706970780000000000000000000000000000000000000000000000000000004500000000004000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "ipipx" + ], + "rc": 0, + "stdout": "ipipx: any/ip remote any local any ttl inherit\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/b.txt new file mode 100644 index 000000000..2fd4f2701 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/b.txt @@ -0,0 +1,2 @@ +tunnel show +tunnel show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/cmd.json new file mode 100644 index 000000000..e33f32a71 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/cmd.json @@ -0,0 +1,115 @@ +{ + "axes": { + "batch": "twice", + "fix": "tnl4", + "json": "0", + "words": "-batch b.txt" + }, + "cmd": "ip -batch b.txt", + "desc": "corner: opt=plain cmd=tnl4:batch:twice", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-069", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "printf '%s\\n' 'tunnel show' 'tunnel show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -batch b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tunnel show' 'tunnel show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.out new file mode 100644 index 000000000..cef32cc8c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.out @@ -0,0 +1,40 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.pcap new file mode 100644 index 000000000..1166af8ae Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f10e7b988 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/tnlsys.out new file mode 100644 index 000000000..75da72b7d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-069/tnlsys.out @@ -0,0 +1,266 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-batch", + "b.txt" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\ngre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/b.txt new file mode 100644 index 000000000..e4af75bf5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/b.txt @@ -0,0 +1,2 @@ +tunnel show mode gre +tunnel show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/cmd.json new file mode 100644 index 000000000..9d36e7f64 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/cmd.json @@ -0,0 +1,115 @@ +{ + "axes": { + "batch": "mode-then-list", + "fix": "tnl4", + "json": "0", + "words": "-batch b.txt" + }, + "cmd": "ip -batch b.txt", + "desc": "corner: opt=plain cmd=tnl4:batch:mode-then-list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-070", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "printf '%s\\n' 'tunnel show mode gre' 'tunnel show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -batch b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tunnel show mode gre' 'tunnel show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.out new file mode 100644 index 000000000..c8f59394f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.out @@ -0,0 +1,21 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.pcap new file mode 100644 index 000000000..96ae36a98 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..84c51f51c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/tnlsys.out new file mode 100644 index 000000000..e53966494 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-070/tnlsys.out @@ -0,0 +1,147 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-batch", + "b.txt" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\ngre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/b.txt new file mode 100644 index 000000000..fe9b980b9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/b.txt @@ -0,0 +1,2 @@ +tunnel show mode any +tunnel show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/cmd.json new file mode 100644 index 000000000..5b50311a2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/cmd.json @@ -0,0 +1,115 @@ +{ + "axes": { + "batch": "any-sticks", + "fix": "tnl4", + "json": "0", + "words": "-batch b.txt" + }, + "cmd": "ip -batch b.txt", + "desc": "corner: opt=plain cmd=tnl4:batch:any-sticks", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-071", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "printf '%s\\n' 'tunnel show mode any' 'tunnel show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -batch b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tunnel show mode any' 'tunnel show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.out new file mode 100644 index 000000000..0285bee94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.out @@ -0,0 +1,23 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +gre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. +gre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2 + Drop packets out of sequence. + Checksum output packets. +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 +isa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit +isan: any/ip remote any local 192.0.2.2 ttl inherit +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.pcap new file mode 100644 index 000000000..b6966279b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..223dda1a7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/tnlsys.out new file mode 100644 index 000000000..c1db921f3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-071/tnlsys.out @@ -0,0 +1,161 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-batch", + "b.txt" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\ngre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\nipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\nipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\ngre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\ngre2: gre/ip remote 198.51.100.3 local 192.0.2.1 ttl inherit ikey 1 okey 2\n Drop packets out of sequence.\n Checksum output packets.\ngre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\nsit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\nsit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\nisa1: ipv6/ip remote any local 192.0.2.1 pr 192.0.2.11 pdr 192.0.2.10 ttl inherit\nisan: any/ip remote any local 192.0.2.2 ttl inherit\nvti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/b.txt new file mode 100644 index 000000000..3fb03a0f8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/b.txt @@ -0,0 +1,2 @@ +tunnel show mode ip6ip6 ip6t1 +tunnel show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/cmd.json new file mode 100644 index 000000000..c11c2efb3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/cmd.json @@ -0,0 +1,85 @@ +{ + "axes": { + "batch": "v6-named-then-list", + "fix": "tnl6", + "json": "0", + "words": "-batch - < b.txt" + }, + "cmd": "ip -batch - < b.txt", + "desc": "corner: opt=plain cmd=tnl6:batch:v6-named-then-list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/ec-072", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "printf '%s\\n' 'tunnel show mode ip6ip6 ip6t1' 'tunnel show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -batch - < b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tunnel show mode ip6ip6 ip6t1' 'tunnel show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.out new file mode 100644 index 000000000..0929a9a3a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.out @@ -0,0 +1,4 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremotegre0: gre/ip remote any local any ttl inherit nopmtudisc +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 +tunl0: any/ip remote any local any ttl inherit nopmtudisc +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.pcap new file mode 100644 index 000000000..d7f09883c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..acbf18028 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/tnlsys.out new file mode 100644 index 000000000..dd3d6161a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ec-072/tnlsys.out @@ -0,0 +1,56 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "69703674310000000000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-batch", + "-" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremotegre0: gre/ip remote any local any ttl inherit nopmtudisc\nip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\ntunl0: any/ip remote any local any ttl inherit nopmtudisc\nsit0: ipv6/ip remote any local any ttl 64 nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/cmd.json new file mode 100644 index 000000000..64540f6e0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show gre9" + }, + "cmd": "ip tunnel show gre9", + "desc": "negative: opt=plain cmd=ng:tnl4:tunnel_show_gre9: a gre name asks gre9 by ioctl: ENODEV, rc 1 (T5)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 1, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-001", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show gre9", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.err new file mode 100644 index 000000000..ff72a2a5e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.err @@ -0,0 +1 @@ +get tunnel "gre9" failed: No such device diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/tnlsys.out new file mode 100644 index 000000000..1ecc92fd0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-001/tnlsys.out @@ -0,0 +1,22 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre9", + "in": "67726539000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "errno": 19 + } + ], + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "gre9" + ], + "rc": 1, + "stdout": "", + "stderr": "get tunnel \"gre9\" failed: No such device\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/cmd.json new file mode 100644 index 000000000..078d6639c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "0", + "words": "tunnel show key 5" + }, + "cmd": "ip tunnel show key 5", + "desc": "negative: opt=plain cmd=ng:tnl4:tunnel_show_key_5: keys without a gre or vti mode are refused (T6)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 1, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-002", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show key 5", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.err new file mode 100644 index 000000000..6715a6be8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.err @@ -0,0 +1 @@ +Keys are not allowed with ipip and sit tunnels diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/tnlsys.out new file mode 100644 index 000000000..fd2090a92 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-002/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "key", + "5" + ], + "rc": 1, + "stdout": "", + "stderr": "Keys are not allowed with ipip and sit tunnels\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/cmd.json new file mode 100644 index 000000000..a81df3a70 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show mode bogus" + }, + "cmd": "ip tunnel show mode bogus", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_mode_bogus: Unknown tunnel mode, exit(-1)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-003", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.err new file mode 100644 index 000000000..63aaef1de --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.err @@ -0,0 +1 @@ +Unknown tunnel mode "bogus" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/tnlsys.out new file mode 100644 index 000000000..0fa7a4a77 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-003/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "bogus" + ], + "rc": 255, + "stdout": "", + "stderr": "Unknown tunnel mode \"bogus\"\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/cmd.json new file mode 100644 index 000000000..4837e12f3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show mode gre mode ipip" + }, + "cmd": "ip tunnel show mode gre mode ipip", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_mode_gre_mode_ipip: more than one tunnel mode, exit(-1)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-004", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode gre mode ipip", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.err new file mode 100644 index 000000000..e9dbc543e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.err @@ -0,0 +1 @@ +You managed to ask for more than one tunnel mode. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/tnlsys.out new file mode 100644 index 000000000..f3aa26814 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-004/tnlsys.out @@ -0,0 +1,16 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode", + "gre", + "mode", + "ipip" + ], + "rc": 255, + "stdout": "", + "stderr": "You managed to ask for more than one tunnel mode.\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/cmd.json new file mode 100644 index 000000000..26970e9f7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show mode" + }, + "cmd": "ip tunnel show mode", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_mode: mode with no value: the command is incomplete", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-005", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show mode", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.err new file mode 100644 index 000000000..f7d546177 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.err @@ -0,0 +1 @@ +Command line is not complete. Try option "help" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/tnlsys.out new file mode 100644 index 000000000..21038ccc8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-005/tnlsys.out @@ -0,0 +1,13 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "mode" + ], + "rc": 255, + "stdout": "", + "stderr": "Command line is not complete. Try option \"help\"\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/cmd.json new file mode 100644 index 000000000..1181d3f9c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show ttl 300" + }, + "cmd": "ip tunnel show ttl 300", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_ttl_300: invarg(\"invalid TTL\\n\"): two newlines (T11)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-006", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show ttl 300", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.err new file mode 100644 index 000000000..c044886d1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.err @@ -0,0 +1,2 @@ +Error: argument "300" is wrong: invalid TTL + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/tnlsys.out new file mode 100644 index 000000000..73778d21d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-006/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "ttl", + "300" + ], + "rc": 255, + "stdout": "", + "stderr": "Error: argument \"300\" is wrong: invalid TTL\n\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/cmd.json new file mode 100644 index 000000000..006eb2695 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show ttl bogus" + }, + "cmd": "ip tunnel show ttl bogus", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_ttl_bogus: invalid TTL", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-007", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show ttl bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.err new file mode 100644 index 000000000..a9d1bb64f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.err @@ -0,0 +1,2 @@ +Error: argument "bogus" is wrong: invalid TTL + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/tnlsys.out new file mode 100644 index 000000000..e548cc145 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-007/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "ttl", + "bogus" + ], + "rc": 255, + "stdout": "", + "stderr": "Error: argument \"bogus\" is wrong: invalid TTL\n\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/cmd.json new file mode 100644 index 000000000..6a9dd3147 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show tos bogus" + }, + "cmd": "ip tunnel show tos bogus", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_tos_bogus: bad TOS value", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-008", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show tos bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.err new file mode 100644 index 000000000..c531ea75d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.err @@ -0,0 +1 @@ +Error: argument "bogus" is wrong: bad TOS value diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/tnlsys.out new file mode 100644 index 000000000..f4938cf54 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-008/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "tos", + "bogus" + ], + "rc": 255, + "stdout": "", + "stderr": "Error: argument \"bogus\" is wrong: bad TOS value\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/cmd.json new file mode 100644 index 000000000..be4af299f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show key bogus" + }, + "cmd": "ip tunnel show key bogus", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_key_bogus: tnl_parse_key: not an unsigned integer", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-009", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show key bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.err new file mode 100644 index 000000000..0c8676c24 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.err @@ -0,0 +1 @@ +invalid value for "key": "bogus"; it should be an unsigned integer diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/tnlsys.out new file mode 100644 index 000000000..178bb17ff --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-009/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "key", + "bogus" + ], + "rc": 255, + "stdout": "", + "stderr": "invalid value for \"key\": \"bogus\"; it should be an unsigned integer\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/cmd.json new file mode 100644 index 000000000..002648aeb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show remote bogus" + }, + "cmd": "ip tunnel show remote bogus", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_remote_bogus: get_addr32: not an address, exit(1)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 1, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-010", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show remote bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.err new file mode 100644 index 000000000..58f95f5af --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.err @@ -0,0 +1 @@ +Error: an IP address is expected rather than "bogus" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/tnlsys.out new file mode 100644 index 000000000..a84256da9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-010/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "remote", + "bogus" + ], + "rc": 1, + "stdout": "", + "stderr": "Error: an IP address is expected rather than \"bogus\"\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/cmd.json new file mode 100644 index 000000000..2719d7552 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show name a name b" + }, + "cmd": "ip tunnel show name a name b", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_name_a_name_b: duparg2 name", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-011", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show name a name b", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.err new file mode 100644 index 000000000..5ea613400 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.err @@ -0,0 +1 @@ +Error: either "name" is duplicate, or "b" is garbage. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/tnlsys.out new file mode 100644 index 000000000..91dd7a83d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-011/tnlsys.out @@ -0,0 +1,16 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "name", + "a", + "name", + "b" + ], + "rc": 255, + "stdout": "", + "stderr": "Error: either \"name\" is duplicate, or \"b\" is garbage.\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/cmd.json new file mode 100644 index 000000000..a9eae0343 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show help" + }, + "cmd": "ip tunnel show help", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_help: a prefix of help in the words prints the usage", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-012", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show help", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.err new file mode 100644 index 000000000..3fda70040 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.err @@ -0,0 +1,13 @@ +Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ] + [ mode { gre | ipip | isatap | sit | vti } ] + [ remote ADDR ] [ local ADDR ] + [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ] + [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ] + [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ] + [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ] + +Where: NAME := STRING + ADDR := { IP_ADDRESS | any } + TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff } + TTL := { 1..255 | inherit } + KEY := { DOTTED_QUAD | NUMBER } diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/tnlsys.out new file mode 100644 index 000000000..44d1e4a35 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-012/tnlsys.out @@ -0,0 +1,13 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "help" + ], + "rc": 255, + "stdout": "", + "stderr": "Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]\n [ mode { gre | ipip | isatap | sit | vti } ]\n [ remote ADDR ] [ local ADDR ]\n [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n\nWhere: NAME := STRING\n ADDR := { IP_ADDRESS | any }\n TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff }\n TTL := { 1..255 | inherit }\n KEY := { DOTTED_QUAD | NUMBER }\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/cmd.json new file mode 100644 index 000000000..9c826730e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/cmd.json @@ -0,0 +1,46 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel show dev nosuch" + }, + "cmd": "ip tunnel show dev nosuch", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_show_dev_nosuch: ll_name_to_index asks the kernel, then nodev", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "errno": "ENODEV", + "rc": 1, + "refused_by": "kernel" + }, + "id": "tunnel/ng-013", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel show dev nosuch", + "name": "tnlsys" + } + ], + "result": { + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.err new file mode 100644 index 000000000..11be93da0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.err @@ -0,0 +1 @@ +Cannot find device "nosuch" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.pcap new file mode 100644 index 000000000..5ddb0fb31 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..b87d303bf Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/tnlsys.out new file mode 100644 index 000000000..f20eb5d54 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-013/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "show", + "dev", + "nosuch" + ], + "rc": 1, + "stdout": "", + "stderr": "Cannot find device \"nosuch\"\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/cmd.json new file mode 100644 index 000000000..3c5d5e91b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel bogus" + }, + "cmd": "ip tunnel bogus", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_bogus: an unknown tunnel command", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-014", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.err new file mode 100644 index 000000000..411732c9a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.err @@ -0,0 +1 @@ +Command "bogus" is unknown, try "ip tunnel help" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/tnlsys.out new file mode 100644 index 000000000..66b70ba21 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-014/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "bogus" + ], + "rc": 255, + "stdout": "", + "stderr": "Command \"bogus\" is unknown, try \"ip tunnel help\"\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/cmd.json new file mode 100644 index 000000000..55d5a858c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel help" + }, + "cmd": "ip tunnel help", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_help: the usage, exit(-1)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-015", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel help", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.err new file mode 100644 index 000000000..3fda70040 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.err @@ -0,0 +1,13 @@ +Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ] + [ mode { gre | ipip | isatap | sit | vti } ] + [ remote ADDR ] [ local ADDR ] + [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ] + [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ] + [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ] + [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ] + +Where: NAME := STRING + ADDR := { IP_ADDRESS | any } + TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff } + TTL := { 1..255 | inherit } + KEY := { DOTTED_QUAD | NUMBER } diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/tnlsys.out new file mode 100644 index 000000000..1e6ef051b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-015/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "help" + ], + "rc": 255, + "stdout": "", + "stderr": "Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]\n [ mode { gre | ipip | isatap | sit | vti } ]\n [ remote ADDR ] [ local ADDR ]\n [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n\nWhere: NAME := STRING\n ADDR := { IP_ADDRESS | any }\n TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff }\n TTL := { 1..255 | inherit }\n KEY := { DOTTED_QUAD | NUMBER }\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/cmd.json new file mode 100644 index 000000000..be3b11ad2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "-0 tunnel show" + }, + "cmd": "ip -0 tunnel show", + "desc": "negative: opt=plain cmd=ng:bare:-0_tunnel_show: AF_PACKET: Unsupported protocol family", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-016", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -0 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.err new file mode 100644 index 000000000..662046ab3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.err @@ -0,0 +1 @@ +Unsupported protocol family: 17 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/tnlsys.out new file mode 100644 index 000000000..829154ce0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-016/tnlsys.out @@ -0,0 +1,13 @@ +{ + "run": { + "argv": [ + "ip", + "-0", + "tunnel", + "show" + ], + "rc": 255, + "stdout": "", + "stderr": "Unsupported protocol family: 17\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/cmd.json new file mode 100644 index 000000000..f1d4ab726 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel add" + }, + "cmd": "ip tunnel add", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_add: a write with no mode: cannot determine tunnel mode, before any ioctl", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 1, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-017", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel add", + "name": "tnlsys" + } + ], + "result": { + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.err new file mode 100644 index 000000000..75f7c3724 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.err @@ -0,0 +1 @@ +cannot determine tunnel mode (ipip, gre, vti or sit) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/tnlsys.out new file mode 100644 index 000000000..50841eb43 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-017/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "add" + ], + "rc": 1, + "stdout": "", + "stderr": "cannot determine tunnel mode (ipip, gre, vti or sit)\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/cmd.json new file mode 100644 index 000000000..6d925881b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel add mode gre ttl 64 nopmtudisc" + }, + "cmd": "ip tunnel add mode gre ttl 64 nopmtudisc", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_add_mode_gre_ttl_64_nopmtudisc: ttl and nopmtudisc refused before any ioctl", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 1, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-018", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel add mode gre ttl 64 nopmtudisc", + "name": "tnlsys" + } + ], + "result": { + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.err new file mode 100644 index 000000000..2e64e1a4e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.err @@ -0,0 +1 @@ +ttl != 0 and nopmtudisc are incompatible diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/tnlsys.out new file mode 100644 index 000000000..cb1c3de28 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-018/tnlsys.out @@ -0,0 +1,17 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "add", + "mode", + "gre", + "ttl", + "64", + "nopmtudisc" + ], + "rc": 1, + "stdout": "", + "stderr": "ttl != 0 and nopmtudisc are incompatible\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/cmd.json new file mode 100644 index 000000000..4d66919bf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel prl" + }, + "cmd": "ip tunnel prl", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_prl: prl with no device: Must specify device", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-019", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel prl", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.err new file mode 100644 index 000000000..ec083f138 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.err @@ -0,0 +1 @@ +Must specify device diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/tnlsys.out new file mode 100644 index 000000000..959e29c1a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-019/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "prl" + ], + "rc": 255, + "stdout": "", + "stderr": "Must specify device\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/cmd.json new file mode 100644 index 000000000..5a757717f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tunnel 6rd" + }, + "cmd": "ip tunnel 6rd", + "desc": "negative: opt=plain cmd=ng:bare:tunnel_6rd: 6rd with no device: Must specify device", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-020", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tunnel 6rd", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.err new file mode 100644 index 000000000..ec083f138 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.err @@ -0,0 +1 @@ +Must specify device diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/tnlsys.out new file mode 100644 index 000000000..51fe51f42 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-020/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tunnel", + "6rd" + ], + "rc": 255, + "stdout": "", + "stderr": "Must specify device\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/cmd.json new file mode 100644 index 000000000..97b627328 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "0", + "words": "-6 tunnel show nosuch" + }, + "cmd": "ip -6 tunnel show nosuch", + "desc": "negative: opt=plain cmd=ng:tnl6:-6_tunnel_show_nosuch: the v6 named path: ENODEV, rc 1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 1, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-021", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show nosuch", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.err new file mode 100644 index 000000000..d47f259cb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.err @@ -0,0 +1 @@ +get tunnel "nosuch" failed: No such device diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/tnlsys.out new file mode 100644 index 000000000..9a637ea8e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-021/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "nosuch", + "in": "6e6f7375636800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "errno": 19 + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "nosuch" + ], + "rc": 1, + "stdout": "", + "stderr": "get tunnel \"nosuch\" failed: No such device\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/cmd.json new file mode 100644 index 000000000..08c66f989 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "-6 tunnel show mode gre" + }, + "cmd": "ip -6 tunnel show mode gre", + "desc": "negative: opt=plain cmd=ng:bare:-6_tunnel_show_mode_gre: gre is not a v6 mode: Unknown tunnel mode", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-022", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show mode gre", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.err new file mode 100644 index 000000000..aade6c391 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.err @@ -0,0 +1 @@ +Unknown tunnel mode "gre" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/tnlsys.out new file mode 100644 index 000000000..8b132ebfa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-022/tnlsys.out @@ -0,0 +1,15 @@ +{ + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "mode", + "gre" + ], + "rc": 255, + "stdout": "", + "stderr": "Unknown tunnel mode \"gre\"\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/cmd.json new file mode 100644 index 000000000..c23b734ae --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "-6 tunnel show ttl 300" + }, + "cmd": "ip -6 tunnel show ttl 300", + "desc": "negative: opt=plain cmd=ng:bare:-6_tunnel_show_ttl_300: invarg(\"invalid TTL\"): one newline (T11)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-023", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show ttl 300", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.err new file mode 100644 index 000000000..541518ee7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.err @@ -0,0 +1 @@ +Error: argument "300" is wrong: invalid TTL diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/tnlsys.out new file mode 100644 index 000000000..569345aa6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-023/tnlsys.out @@ -0,0 +1,15 @@ +{ + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "ttl", + "300" + ], + "rc": 255, + "stdout": "", + "stderr": "Error: argument \"300\" is wrong: invalid TTL\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/cmd.json new file mode 100644 index 000000000..188bfb350 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "-6 tunnel show flowlabel 0x100000" + }, + "cmd": "ip -6 tunnel show flowlabel 0x100000", + "desc": "negative: opt=plain cmd=ng:bare:-6_tunnel_show_flowlabel_0x100000: a 21-bit flowlabel: invalid Flowlabel", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-024", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show flowlabel 0x100000", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.err new file mode 100644 index 000000000..ab34c778c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.err @@ -0,0 +1 @@ +Error: argument "0x100000" is wrong: invalid Flowlabel diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/tnlsys.out new file mode 100644 index 000000000..363186399 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-024/tnlsys.out @@ -0,0 +1,15 @@ +{ + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "flowlabel", + "0x100000" + ], + "rc": 255, + "stdout": "", + "stderr": "Error: argument \"0x100000\" is wrong: invalid Flowlabel\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/cmd.json new file mode 100644 index 000000000..25b3a609d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "-6 tunnel show dscp 5" + }, + "cmd": "ip -6 tunnel show dscp 5", + "desc": "negative: opt=plain cmd=ng:bare:-6_tunnel_show_dscp_5: dscp takes only inherit", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-025", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show dscp 5", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.err new file mode 100644 index 000000000..f8049f117 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.err @@ -0,0 +1 @@ +Error: argument "5" is wrong: not inherit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/tnlsys.out new file mode 100644 index 000000000..003e7845d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-025/tnlsys.out @@ -0,0 +1,15 @@ +{ + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show", + "dscp", + "5" + ], + "rc": 255, + "stdout": "", + "stderr": "Error: argument \"5\" is wrong: not inherit\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/cmd.json new file mode 100644 index 000000000..6399162c5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "-6 tunnel bogus" + }, + "cmd": "ip -6 tunnel bogus", + "desc": "negative: opt=plain cmd=ng:bare:-6_tunnel_bogus: an unknown v6 tunnel command", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-026", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.err new file mode 100644 index 000000000..522b50ab3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.err @@ -0,0 +1 @@ +Command "bogus" is unknown, try "ip -f inet6 tunnel help". diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/tnlsys.out new file mode 100644 index 000000000..0353ed8c5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-026/tnlsys.out @@ -0,0 +1,13 @@ +{ + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "bogus" + ], + "rc": 255, + "stdout": "", + "stderr": "Command \"bogus\" is unknown, try \"ip -f inet6 tunnel help\".\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/cmd.json new file mode 100644 index 000000000..17eaf2dd3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "-6 tunnel help" + }, + "cmd": "ip -6 tunnel help", + "desc": "negative: opt=plain cmd=ng:bare:-6_tunnel_help: the v6 usage, exit(-1)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tunnel/ng-027", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel help", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.err new file mode 100644 index 000000000..8f83c4176 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.err @@ -0,0 +1,16 @@ +Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ] + [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ] + [ remote ADDR local ADDR ] [ dev PHYS_DEV ] + [ encaplimit ELIM ] + [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ] + [ dscp inherit ] + [ [no]allow-localremote ] + [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ] + +Where: NAME := STRING + ADDR := IPV6_ADDRESS + ELIM := { none | 0..255 }(default=4) + TTL := 0..255 (default=64) + TCLASS := { 0x0..0xff | inherit } + FLOWLABEL := { 0x0..0xfffff | inherit } + KEY := { DOTTED_QUAD | NUMBER } diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/tnlsys.out new file mode 100644 index 000000000..7a16360a4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/ng-027/tnlsys.out @@ -0,0 +1,13 @@ +{ + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "help" + ], + "rc": 255, + "stdout": "", + "stderr": "Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]\n [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ]\n [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n [ encaplimit ELIM ]\n [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n [ dscp inherit ]\n [ [no]allow-localremote ]\n [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n\nWhere: NAME := STRING\n ADDR := IPV6_ADDRESS\n ELIM := { none | 0..255 }(default=4)\n TTL := 0..255 (default=64)\n TCLASS := { 0x0..0xff | inherit }\n FLOWLABEL := { 0x0..0xfffff | inherit }\n KEY := { DOTTED_QUAD | NUMBER }\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/cmd.json new file mode 100644 index 000000000..3d0a399c4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "-6 tunnel show" + }, + "cmd": "ip -6 tunnel show", + "desc": "boundary: opt=plain cmd=bare:-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-001", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.out new file mode 100644 index 000000000..6c1de7c74 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.out @@ -0,0 +1,3 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) +ip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.pcap new file mode 100644 index 000000000..c55f4498d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..43544b05c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/tnlsys.out new file mode 100644 index 000000000..70f510056 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-001/tnlsys.out @@ -0,0 +1,36 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6gre0: gre/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\nip6_vti0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/cmd.json new file mode 100644 index 000000000..6a105c6c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/cmd.json @@ -0,0 +1,45 @@ +{ + "axes": { + "fix": "bare", + "json": "1", + "words": "tunnel show" + }, + "cmd": "ip -j tunnel show", + "desc": "boundary: opt=json cmd=bare:tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-002", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show", + "name": "tnlsys" + } + ], + "result": { + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.out new file mode 100644 index 000000000..3773e32f2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.out @@ -0,0 +1,5 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.pcap new file mode 100644 index 000000000..a8fad4de1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ea26c3645 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/tnlsys.out new file mode 100644 index 000000000..d490b3a52 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-002/tnlsys.out @@ -0,0 +1,50 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/cmd.json new file mode 100644 index 000000000..65690f450 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show" + }, + "cmd": "ip -j tunnel show", + "desc": "positive: opt=json cmd=tnl4:tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-003", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.pcap new file mode 100644 index 000000000..8bbd51a6a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..b0383b417 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/tnlsys.out new file mode 100644 index 000000000..4466d96d5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-003/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/cmd.json new file mode 100644 index 000000000..72cfe918a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel" + }, + "cmd": "ip -j tunnel", + "desc": "corner: opt=json cmd=tnl4:tunnel", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-004", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.pcap new file mode 100644 index 000000000..df3d82214 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..5bef3418e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/tnlsys.out new file mode 100644 index 000000000..3572ec412 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-004/tnlsys.out @@ -0,0 +1,140 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/cmd.json new file mode 100644 index 000000000..9d4fdaf61 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel list" + }, + "cmd": "ip -j tunnel list", + "desc": "positive: opt=json cmd=tnl4:tunnel_list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-005", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel list", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.pcap new file mode 100644 index 000000000..245c8d845 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..11534eead Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/tnlsys.out new file mode 100644 index 000000000..c190be6d2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-005/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "list" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/cmd.json new file mode 100644 index 000000000..9d9d94d42 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel lst" + }, + "cmd": "ip -j tunnel lst", + "desc": "positive: opt=json cmd=tnl4:tunnel_lst", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-006", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel lst", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.pcap new file mode 100644 index 000000000..03437dd33 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..081793eb3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/tnlsys.out new file mode 100644 index 000000000..108a93966 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-006/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "lst" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/cmd.json new file mode 100644 index 000000000..97d41308b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel sh" + }, + "cmd": "ip -j tunnel sh", + "desc": "corner: opt=json cmd=tnl4:tunnel_sh", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-007", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel sh", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.pcap new file mode 100644 index 000000000..f89d3b497 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ad4738fb5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/tnlsys.out new file mode 100644 index 000000000..007e615e2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-007/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "sh" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/cmd.json new file mode 100644 index 000000000..8555f96ea --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunl show" + }, + "cmd": "ip -j tunl show", + "desc": "corner: opt=json cmd=tnl4:tunl_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-008", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunl show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.pcap new file mode 100644 index 000000000..cecc23725 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..c02a0151a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/tnlsys.out new file mode 100644 index 000000000..0c18bef27 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-008/tnlsys.out @@ -0,0 +1,141 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunl", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/cmd.json new file mode 100644 index 000000000..d582abc35 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "-4 tunnel show" + }, + "cmd": "ip -j -4 tunnel show", + "desc": "positive: opt=json cmd=tnl4:-4_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-009", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -4 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.pcap new file mode 100644 index 000000000..507b3d732 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..2c20985b7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/tnlsys.out new file mode 100644 index 000000000..045232c15 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-009/tnlsys.out @@ -0,0 +1,142 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-4", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/cmd.json new file mode 100644 index 000000000..e30703bb5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "-s tunnel show" + }, + "cmd": "ip -j -s tunnel show", + "desc": "positive: opt=json cmd=tnl4:-s_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-010", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -s tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.out new file mode 100644 index 000000000..27270b56a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.out @@ -0,0 +1,71 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.pcap new file mode 100644 index 000000000..ccbe30485 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ac6cdce3b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/tnlsys.out new file mode 100644 index 000000000..fc6ea2f15 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-010/tnlsys.out @@ -0,0 +1,142 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-s", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/cmd.json new file mode 100644 index 000000000..9d9490c3f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "-d tunnel show" + }, + "cmd": "ip -j -d tunnel show", + "desc": "corner: opt=json cmd=tnl4:-d_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-011", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -d tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.pcap new file mode 100644 index 000000000..837643507 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8a451c99a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/tnlsys.out new file mode 100644 index 000000000..214de265a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-011/tnlsys.out @@ -0,0 +1,142 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-d", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/cmd.json new file mode 100644 index 000000000..34c8d7759 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "-o tunnel show" + }, + "cmd": "ip -j -o tunnel show", + "desc": "corner: opt=json cmd=tnl4:-o_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-012", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -o tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.out new file mode 100644 index 000000000..2cf90c8c6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.out @@ -0,0 +1,15 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.pcap new file mode 100644 index 000000000..01245f7ad Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..761d846f1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/tnlsys.out new file mode 100644 index 000000000..100bbfe35 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-012/tnlsys.out @@ -0,0 +1,142 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-o", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/cmd.json new file mode 100644 index 000000000..1826a2acd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "-p tunnel show" + }, + "cmd": "ip -j -p tunnel show", + "desc": "corner: opt=json cmd=tnl4:-p_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-013", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -p tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.out new file mode 100644 index 000000000..371523a27 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.out @@ -0,0 +1,112 @@ +[ { + "ifname": "gre0", + "mode": "gre/ip", + "remote": "0.0.0.0", + "local": "0.0.0.0", + "nopmtudisc": null, + "flags": [ ] + } +,{ + "ifname": "ip_vti0", + "mode": "ip/ip", + "remote": "0.0.0.0", + "local": "0.0.0.0", + "nopmtudisc": null, + "key": 0 + } +,{ + "ifname": "tunl0", + "mode": "any/ip", + "remote": "0.0.0.0", + "local": "0.0.0.0", + "nopmtudisc": null + } +,{ + "ifname": "sit0", + "mode": "ipv6/ip", + "remote": "0.0.0.0", + "local": "0.0.0.0", + "ttl": 64, + "nopmtudisc": null + } +,{ + "ifname": "ipip1", + "mode": "any/ip", + "remote": "198.51.100.1", + "local": "192.0.2.1", + "dev": "d0", + "ttl": 64, + "tos": "0x10" + } +,{ + "ifname": "ipip2", + "mode": "any/ip", + "remote": "198.51.100.9", + "local": "0.0.0.0", + "nopmtudisc": null + } +,{ + "ifname": "gre1", + "mode": "gre/ip", + "remote": "198.51.100.2", + "local": "192.0.2.1", + "ttl": 32, + "key": 5, + "flags": [ "rx_drop_ooseq","rx_csum","tx_seq","tx_csum" ] + } +,{ + "ifname": "gre2", + "mode": "gre/ip", + "remote": "198.51.100.3", + "local": "192.0.2.1", + "ikey": 1, + "okey": 2, + "flags": [ "rx_drop_ooseq","tx_csum" ] + } +,{ + "ifname": "gre3", + "mode": "gre/ip", + "remote": "239.1.1.1", + "local": "192.0.2.1", + "ttl": 1, + "key": 4009820417, + "flags": [ ] + } +,{ + "ifname": "sit1", + "mode": "any/ip", + "remote": "198.51.100.4", + "local": "192.0.2.1", + "ttl": 64 + } +,{ + "ifname": "sit2", + "mode": "ipv6/ip", + "remote": "198.51.100.8", + "local": "192.0.2.1", + "ttl": 16 + } +,{ + "ifname": "isa1", + "mode": "ipv6/ip", + "remote": "0.0.0.0", + "local": "192.0.2.1", + "pr": "192.0.2.11", + "pdr": "192.0.2.10" + } +,{ + "ifname": "isan", + "mode": "any/ip", + "remote": "0.0.0.0", + "local": "192.0.2.2" + } +,{ + "ifname": "vti1", + "mode": "ip/ip", + "remote": "198.51.100.5", + "local": "192.0.2.1", + "nopmtudisc": null, + "ikey": 7, + "okey": 8 + } + ] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.pcap new file mode 100644 index 000000000..ef1df355c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..280916925 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/tnlsys.out new file mode 100644 index 000000000..f4d5879b9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-013/tnlsys.out @@ -0,0 +1,142 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-p", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[ {\n \"ifname\": \"gre0\",\n \"mode\": \"gre/ip\",\n \"remote\": \"0.0.0.0\",\n \"local\": \"0.0.0.0\",\n \"nopmtudisc\": null,\n \"flags\": [ ]\n }\n,{\n \"ifname\": \"ip_vti0\",\n \"mode\": \"ip/ip\",\n \"remote\": \"0.0.0.0\",\n \"local\": \"0.0.0.0\",\n \"nopmtudisc\": null,\n \"key\": 0\n }\n,{\n \"ifname\": \"tunl0\",\n \"mode\": \"any/ip\",\n \"remote\": \"0.0.0.0\",\n \"local\": \"0.0.0.0\",\n \"nopmtudisc\": null\n }\n,{\n \"ifname\": \"sit0\",\n \"mode\": \"ipv6/ip\",\n \"remote\": \"0.0.0.0\",\n \"local\": \"0.0.0.0\",\n \"ttl\": 64,\n \"nopmtudisc\": null\n }\n,{\n \"ifname\": \"ipip1\",\n \"mode\": \"any/ip\",\n \"remote\": \"198.51.100.1\",\n \"local\": \"192.0.2.1\",\n \"dev\": \"d0\",\n \"ttl\": 64,\n \"tos\": \"0x10\"\n }\n,{\n \"ifname\": \"ipip2\",\n \"mode\": \"any/ip\",\n \"remote\": \"198.51.100.9\",\n \"local\": \"0.0.0.0\",\n \"nopmtudisc\": null\n }\n,{\n \"ifname\": \"gre1\",\n \"mode\": \"gre/ip\",\n \"remote\": \"198.51.100.2\",\n \"local\": \"192.0.2.1\",\n \"ttl\": 32,\n \"key\": 5,\n \"flags\": [ \"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\" ]\n }\n,{\n \"ifname\": \"gre2\",\n \"mode\": \"gre/ip\",\n \"remote\": \"198.51.100.3\",\n \"local\": \"192.0.2.1\",\n \"ikey\": 1,\n \"okey\": 2,\n \"flags\": [ \"rx_drop_ooseq\",\"tx_csum\" ]\n }\n,{\n \"ifname\": \"gre3\",\n \"mode\": \"gre/ip\",\n \"remote\": \"239.1.1.1\",\n \"local\": \"192.0.2.1\",\n \"ttl\": 1,\n \"key\": 4009820417,\n \"flags\": [ ]\n }\n,{\n \"ifname\": \"sit1\",\n \"mode\": \"any/ip\",\n \"remote\": \"198.51.100.4\",\n \"local\": \"192.0.2.1\",\n \"ttl\": 64\n }\n,{\n \"ifname\": \"sit2\",\n \"mode\": \"ipv6/ip\",\n \"remote\": \"198.51.100.8\",\n \"local\": \"192.0.2.1\",\n \"ttl\": 16\n }\n,{\n \"ifname\": \"isa1\",\n \"mode\": \"ipv6/ip\",\n \"remote\": \"0.0.0.0\",\n \"local\": \"192.0.2.1\",\n \"pr\": \"192.0.2.11\",\n \"pdr\": \"192.0.2.10\"\n }\n,{\n \"ifname\": \"isan\",\n \"mode\": \"any/ip\",\n \"remote\": \"0.0.0.0\",\n \"local\": \"192.0.2.2\"\n }\n,{\n \"ifname\": \"vti1\",\n \"mode\": \"ip/ip\",\n \"remote\": \"198.51.100.5\",\n \"local\": \"192.0.2.1\",\n \"nopmtudisc\": null,\n \"ikey\": 7,\n \"okey\": 8\n }\n ]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/cmd.json new file mode 100644 index 000000000..4744827a7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show remote 198.51.100.2" + }, + "cmd": "ip -j tunnel show remote 198.51.100.2", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_remote_198.51.100.2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-014", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show remote 198.51.100.2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.out new file mode 100644 index 000000000..f21a8e844 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.pcap new file mode 100644 index 000000000..fb6cff0f1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ddacc6d7e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/tnlsys.out new file mode 100644 index 000000000..15b7b5355 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-014/tnlsys.out @@ -0,0 +1,115 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "remote", + "198.51.100.2" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/cmd.json new file mode 100644 index 000000000..913c30a92 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show local 192.0.2.1" + }, + "cmd": "ip -j tunnel show local 192.0.2.1", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_local_192.0.2.1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-015", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show local 192.0.2.1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.out new file mode 100644 index 000000000..f77b61240 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.out @@ -0,0 +1,9 @@ +[{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.pcap new file mode 100644 index 000000000..9bab0eb2a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..4185980ed Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/tnlsys.out new file mode 100644 index 000000000..ec7ffd68f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-015/tnlsys.out @@ -0,0 +1,136 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "local", + "192.0.2.1" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/cmd.json new file mode 100644 index 000000000..e185d1eb2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show dev d0" + }, + "cmd": "ip -j tunnel show dev d0", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-016", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show dev d0", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.out new file mode 100644 index 000000000..a46ed6ec2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.pcap new file mode 100644 index 000000000..7d244b3d9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..eb6d0730f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/tnlsys.out new file mode 100644 index 000000000..03f13bb04 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-016/tnlsys.out @@ -0,0 +1,115 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "dev", + "d0" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/cmd.json new file mode 100644 index 000000000..d21c17a8b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show isa1" + }, + "cmd": "ip -j tunnel show isa1", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_isa1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-017", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show isa1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.out new file mode 100644 index 000000000..31229c683 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.pcap new file mode 100644 index 000000000..ccaeebd07 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..6956b193c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/tnlsys.out new file mode 100644 index 000000000..c1f395361 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-017/tnlsys.out @@ -0,0 +1,37 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "isa1" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/cmd.json new file mode 100644 index 000000000..077542c1b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show isan" + }, + "cmd": "ip -j tunnel show isan", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_isan", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-018", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show isan", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.out new file mode 100644 index 000000000..97c0b579a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.pcap new file mode 100644 index 000000000..6d826037d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..05c3d1e66 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/tnlsys.out new file mode 100644 index 000000000..dbf8b0475 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-018/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "isan" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/cmd.json new file mode 100644 index 000000000..fcb9ac71c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show sit2" + }, + "cmd": "ip -j tunnel show sit2", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_sit2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-019", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show sit2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.out new file mode 100644 index 000000000..9af091b48 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.out @@ -0,0 +1 @@ +sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/tnlsys.out new file mode 100644 index 000000000..fb1ee795c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-019/tnlsys.out @@ -0,0 +1,30 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "73697432000000000000000000000000000000000000000000000000000000004500000000004000002900000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "sit2" + ], + "rc": 0, + "stdout": "sit2: ipv6/ip remote 198.51.100.8 local 192.0.2.1 ttl 16\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/cmd.json new file mode 100644 index 000000000..19aea169a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show nosuch" + }, + "cmd": "ip -j tunnel show nosuch", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_nosuch", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-020", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show nosuch", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.out new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.out @@ -0,0 +1 @@ +[] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.pcap new file mode 100644 index 000000000..0fb306821 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..7a2858524 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/tnlsys.out new file mode 100644 index 000000000..51cb9eb32 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-020/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "nosuch" + ], + "rc": 0, + "stdout": "[]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/cmd.json new file mode 100644 index 000000000..b5108faf3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show name ipip2" + }, + "cmd": "ip -j tunnel show name ipip2", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_name_ipip2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-021", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show name ipip2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.out new file mode 100644 index 000000000..0cc537495 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.out @@ -0,0 +1 @@ +ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/tnlsys.out new file mode 100644 index 000000000..ce2f4b8b6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-021/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "69706970320000000000000000000000000000000000000000000000000000004500000000004000000400000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "name", + "ipip2" + ], + "rc": 0, + "stdout": "ipip2: any/ip remote 198.51.100.9 local any ttl inherit tos inherit nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/cmd.json new file mode 100644 index 000000000..e70f66588 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show gre1" + }, + "cmd": "ip -j tunnel show gre1", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_gre1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-022", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show gre1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.out new file mode 100644 index 000000000..82ed56e84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.out @@ -0,0 +1,5 @@ +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/tnlsys.out new file mode 100644 index 000000000..b1a0dc724 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-022/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "67726531000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "gre1" + ], + "rc": 0, + "stdout": "gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/cmd.json new file mode 100644 index 000000000..c67786ed0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show ipip1" + }, + "cmd": "ip -j tunnel show ipip1", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_ipip1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-023", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show ipip1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.out new file mode 100644 index 000000000..f2ca07cfb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.out @@ -0,0 +1 @@ +ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.pcap new file mode 100644 index 000000000..74b3c4450 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..1ec0b6e5a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/tnlsys.out new file mode 100644 index 000000000..9c87a5138 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-023/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "69706970310000000000000000000000000000000000000000000000000000004500000000004000000400000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "ipip1" + ], + "rc": 0, + "stdout": "ipip1: any/ip remote 198.51.100.1 local 192.0.2.1 dev d0 ttl 64 tos 0x10\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/cmd.json new file mode 100644 index 000000000..6642fdbe5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show sit1" + }, + "cmd": "ip -j tunnel show sit1", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_sit1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-024", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show sit1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.out new file mode 100644 index 000000000..7fd168b4d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.out @@ -0,0 +1 @@ +sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/tnlsys.out new file mode 100644 index 000000000..b044146d1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-024/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "73697431000000000000000000000000000000000000000000000000000000004500000000004000002900000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "sit1" + ], + "rc": 0, + "stdout": "sit1: any/ip remote 198.51.100.4 local 192.0.2.1 ttl 64\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/cmd.json new file mode 100644 index 000000000..31a8c84a5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show vti1" + }, + "cmd": "ip -j tunnel show vti1", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_vti1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-025", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show vti1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.out new file mode 100644 index 000000000..0a985d176 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.out @@ -0,0 +1 @@ +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/tnlsys.out new file mode 100644 index 000000000..b8bf3bf46 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-025/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "76746931000000000000000000000000000000000100000000000000000000004500000000004000000400000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "vti1" + ], + "rc": 0, + "stdout": "vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/cmd.json new file mode 100644 index 000000000..419af7ba4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode gre" + }, + "cmd": "ip -j tunnel show mode gre", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_mode_gre", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-026", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode gre", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.out new file mode 100644 index 000000000..3b0214d75 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.out @@ -0,0 +1 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/tnlsys.out new file mode 100644 index 000000000..e16ae3336 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-026/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "gre" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/cmd.json new file mode 100644 index 000000000..a88e58b16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode ipip" + }, + "cmd": "ip -j tunnel show mode ipip", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_mode_ipip", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-027", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode ipip", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.out new file mode 100644 index 000000000..1c06b9a3d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.out @@ -0,0 +1 @@ +tunl0: any/ip remote any local any ttl inherit nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/tnlsys.out new file mode 100644 index 000000000..5e46137b4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-027/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000000400000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "ipip" + ], + "rc": 0, + "stdout": "tunl0: any/ip remote any local any ttl inherit nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/cmd.json new file mode 100644 index 000000000..a1fe27a67 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode sit" + }, + "cmd": "ip -j tunnel show mode sit", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_mode_sit", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-028", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode sit", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.out new file mode 100644 index 000000000..6e2f8f415 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.out @@ -0,0 +1 @@ +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/tnlsys.out new file mode 100644 index 000000000..478e1ea4d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-028/tnlsys.out @@ -0,0 +1,31 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000002900000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "sit" + ], + "rc": 0, + "stdout": "sit0: ipv6/ip remote any local any ttl 64 nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/cmd.json new file mode 100644 index 000000000..6fe9c83e4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode isatap" + }, + "cmd": "ip -j tunnel show mode isatap", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_mode_isatap", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-029", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode isatap", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.out new file mode 100644 index 000000000..6e2f8f415 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.out @@ -0,0 +1 @@ +sit0: ipv6/ip remote any local any ttl 64 nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/tnlsys.out new file mode 100644 index 000000000..2caa65550 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-029/tnlsys.out @@ -0,0 +1,31 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000100000000000000000000004500000000004000002900000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "isatap" + ], + "rc": 0, + "stdout": "sit0: ipv6/ip remote any local any ttl 64 nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/cmd.json new file mode 100644 index 000000000..3873fcce2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode vti" + }, + "cmd": "ip -j tunnel show mode vti", + "desc": "positive: opt=json cmd=tnl4:tunnel_show_mode_vti", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-030", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode vti", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.out new file mode 100644 index 000000000..ab6c8e600 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.out @@ -0,0 +1 @@ +ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/tnlsys.out new file mode 100644 index 000000000..f5ecb7458 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-030/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000100000000000000000000004500000000004000000400000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "vti" + ], + "rc": 0, + "stdout": "ip_vti0: ip/ip remote any local any ttl inherit nopmtudisc key 0\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/cmd.json new file mode 100644 index 000000000..078700501 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "-s tunnel show gre1" + }, + "cmd": "ip -j -s tunnel show gre1", + "desc": "corner: opt=json cmd=tnl4:-s_tunnel_show_gre1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-031", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -s tunnel show gre1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.out new file mode 100644 index 000000000..82ed56e84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.out @@ -0,0 +1,5 @@ +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/tnlsys.out new file mode 100644 index 000000000..50d76b004 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-031/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "67726531000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-s", + "tunnel", + "show", + "gre1" + ], + "rc": 0, + "stdout": "gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/cmd.json new file mode 100644 index 000000000..c4cfc30ac --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5" + }, + "cmd": "ip -j tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_mode_gre_remote_198.51.100.2_local_192.0.2.1_key_5", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-032", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.out new file mode 100644 index 000000000..82ed56e84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.out @@ -0,0 +1,5 @@ +gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/tnlsys.out new file mode 100644 index 000000000..f632f560c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-032/tnlsys.out @@ -0,0 +1,30 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000002000200000000005000000054500000000004000002f0000c0000201c6336402", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "gre", + "remote", + "198.51.100.2", + "local", + "192.0.2.1", + "key", + "5" + ], + "rc": 0, + "stdout": "gre1: gre/ip remote 198.51.100.2 local 192.0.2.1 ttl 32 key 5\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/cmd.json new file mode 100644 index 000000000..29e945630 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode gre remote 198.51.100.2" + }, + "cmd": "ip -j tunnel show mode gre remote 198.51.100.2", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_mode_gre_remote_198.51.100.2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-033", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode gre remote 198.51.100.2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.out new file mode 100644 index 000000000..3b0214d75 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.out @@ -0,0 +1 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/tnlsys.out new file mode 100644 index 000000000..4f4c89d7e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-033/tnlsys.out @@ -0,0 +1,26 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000002f000000000000c6336402", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "gre", + "remote", + "198.51.100.2" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/cmd.json new file mode 100644 index 000000000..e00c9a03f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode gre remote 239.1.1.1 local 192.0.2.1" + }, + "cmd": "ip -j tunnel show mode gre remote 239.1.1.1 local 192.0.2.1", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_mode_gre_remote_239.1.1.1_local_192.0.2.1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-034", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode gre remote 239.1.1.1 local 192.0.2.1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.out new file mode 100644 index 000000000..4362e79a1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.out @@ -0,0 +1 @@ +gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/tnlsys.out new file mode 100644 index 000000000..19bac4d88 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-034/tnlsys.out @@ -0,0 +1,28 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "000000000000000000000000000000000000000020002000ef010101ef0101014500000000004000002f0000c0000201ef010101", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "gre", + "remote", + "239.1.1.1", + "local", + "192.0.2.1" + ], + "rc": 0, + "stdout": "gre3: gre/ip remote 239.1.1.1 local 192.0.2.1 ttl 1 key 4009820417\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/cmd.json new file mode 100644 index 000000000..5b0a2ed2a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + }, + "cmd": "ip -j tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_mode_vti_remote_198.51.100.5_local_192.0.2.1_ikey_7_okey_8", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-035", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.out new file mode 100644 index 000000000..0a985d176 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.out @@ -0,0 +1 @@ +vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/tnlsys.out new file mode 100644 index 000000000..56dfa0b06 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-035/tnlsys.out @@ -0,0 +1,32 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "0000000000000000000000000000000000000000210020000000000700000008450000000000400000040000c0000201c6336405", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "vti", + "remote", + "198.51.100.5", + "local", + "192.0.2.1", + "ikey", + "7", + "okey", + "8" + ], + "rc": 0, + "stdout": "vti1: ip/ip remote 198.51.100.5 local 192.0.2.1 ttl inherit nopmtudisc ikey 7 okey 8\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/cmd.json new file mode 100644 index 000000000..273a129fc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "tunnel show mode any" + }, + "cmd": "ip -j tunnel show mode any", + "desc": "corner: opt=json cmd=tnl4:tunnel_show_mode_any", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-036", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode any", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.out new file mode 100644 index 000000000..f869f26aa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.out @@ -0,0 +1,4 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.pcap new file mode 100644 index 000000000..0e5bba0d0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..71ee8d165 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/tnlsys.out new file mode 100644 index 000000000..61fc50725 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-036/tnlsys.out @@ -0,0 +1,38 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "any" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/cmd.json new file mode 100644 index 000000000..c6636566b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/cmd.json @@ -0,0 +1,109 @@ +{ + "axes": { + "fix": "tnl4", + "json": "1", + "words": "-6 tunnel show" + }, + "cmd": "ip -j -6 tunnel show", + "desc": "corner: opt=json cmd=tnl4:-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-037", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.out new file mode 100644 index 000000000..f869f26aa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.out @@ -0,0 +1,4 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.pcap new file mode 100644 index 000000000..888dc03a6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..2ee5f61f1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/tnlsys.out new file mode 100644 index 000000000..86e154737 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-037/tnlsys.out @@ -0,0 +1,37 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/cmd.json new file mode 100644 index 000000000..6d7520e84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "prl16", + "json": "1", + "words": "tunnel show isa16" + }, + "cmd": "ip -j tunnel show isa16", + "desc": "positive: opt=json cmd=prl16:tunnel_show_isa16", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-038", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip tunnel add isa16 mode isatap local 192.0.2.1", + "i=10; while [ $i -lt 26 ]; do ip tunnel prl dev isa16 prl-nodefault 192.0.2.$i || exit 1; i=$((i+1)); done" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show isa16", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa16 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "i=10; while [ $i -lt 26 ]; do ip tunnel prl dev isa16 prl-nodefault 192.0.2.$i || exit 1; i=$((i+1)); done", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.out new file mode 100644 index 000000000..969cc98cd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"isa16","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.25","pr":"192.0.2.24","pr":"192.0.2.23","pr":"192.0.2.22","pr":"192.0.2.21","pr":"192.0.2.20","pr":"192.0.2.19","pr":"192.0.2.18","pr":"192.0.2.17","pr":"192.0.2.16","pr":"192.0.2.15","pr":"192.0.2.14","pr":"192.0.2.13","pr":"192.0.2.12","pr":"192.0.2.11"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.pcap new file mode 100644 index 000000000..9ef6bb450 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..de973ccef Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/tnlsys.out new file mode 100644 index 000000000..5879053c2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-038/tnlsys.out @@ -0,0 +1,37 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa16", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613136000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa16", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "0000000000000000f000000000000000c0000219000000000000000000000000c0000218000000000000000000000000c0000217000000000000000000000000c0000216000000000000000000000000c0000215000000000000000000000000c0000214000000000000000000000000c0000213000000000000000000000000c0000212000000000000000000000000c0000211000000000000000000000000c0000210000000000000000000000000c000020f000000000000000000000000c000020e000000000000000000000000c000020d000000000000000000000000c000020c000000000000000000000000c000020b000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa16", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "isa16" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"isa16\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.25\",\"pr\":\"192.0.2.24\",\"pr\":\"192.0.2.23\",\"pr\":\"192.0.2.22\",\"pr\":\"192.0.2.21\",\"pr\":\"192.0.2.20\",\"pr\":\"192.0.2.19\",\"pr\":\"192.0.2.18\",\"pr\":\"192.0.2.17\",\"pr\":\"192.0.2.16\",\"pr\":\"192.0.2.15\",\"pr\":\"192.0.2.14\",\"pr\":\"192.0.2.13\",\"pr\":\"192.0.2.12\",\"pr\":\"192.0.2.11\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/cmd.json new file mode 100644 index 000000000..394e132af --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show" + }, + "cmd": "ip -j -6 tunnel show", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-039", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.out new file mode 100644 index 000000000..a0bc78e6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.out @@ -0,0 +1,9 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.pcap new file mode 100644 index 000000000..00d3d35eb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f4ec1a274 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/tnlsys.out new file mode 100644 index 000000000..36ce0df1f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-039/tnlsys.out @@ -0,0 +1,72 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/cmd.json new file mode 100644 index 000000000..5a9d24c01 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel" + }, + "cmd": "ip -j -6 tunnel", + "desc": "corner: opt=json cmd=tnl6:-6_tunnel", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-040", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.out new file mode 100644 index 000000000..a0bc78e6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.out @@ -0,0 +1,9 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.pcap new file mode 100644 index 000000000..cb695c4e9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dee0f9a53 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/tnlsys.out new file mode 100644 index 000000000..dc05d0454 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-040/tnlsys.out @@ -0,0 +1,71 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/cmd.json new file mode 100644 index 000000000..a59b60e78 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel list" + }, + "cmd": "ip -j -6 tunnel list", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-041", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel list", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.out new file mode 100644 index 000000000..a0bc78e6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.out @@ -0,0 +1,9 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.pcap new file mode 100644 index 000000000..99a2ff2d4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..c0217dff2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/tnlsys.out new file mode 100644 index 000000000..a64e308b3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-041/tnlsys.out @@ -0,0 +1,72 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "list" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/cmd.json new file mode 100644 index 000000000..835fbb205 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-s -6 tunnel show" + }, + "cmd": "ip -j -s -6 tunnel show", + "desc": "positive: opt=json cmd=tnl6:-s_-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-042", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -s -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.out new file mode 100644 index 000000000..98c5137df --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.out @@ -0,0 +1,41 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.pcap new file mode 100644 index 000000000..03ac51160 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..9a5a76f91 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/tnlsys.out new file mode 100644 index 000000000..410aa1f20 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-042/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-s", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/cmd.json new file mode 100644 index 000000000..9a9a480e4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-o -6 tunnel show" + }, + "cmd": "ip -j -o -6 tunnel show", + "desc": "corner: opt=json cmd=tnl6:-o_-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-043", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -o -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.out new file mode 100644 index 000000000..a0bc78e6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.out @@ -0,0 +1,9 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.pcap new file mode 100644 index 000000000..7ecaeee3f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..477a563e7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/tnlsys.out new file mode 100644 index 000000000..c9f247ad3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-043/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-o", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/cmd.json new file mode 100644 index 000000000..326f503e8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show ip6t1" + }, + "cmd": "ip -j -6 tunnel show ip6t1", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_ip6t1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-044", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show ip6t1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.out new file mode 100644 index 000000000..10c4b5ee9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.out @@ -0,0 +1 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.pcap new file mode 100644 index 000000000..d045c313b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..9a5d893f8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/tnlsys.out new file mode 100644 index 000000000..fe188839d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-044/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "69703674310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "ip6t1" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/cmd.json new file mode 100644 index 000000000..bc5e6ca6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-s -6 tunnel show ip6t1" + }, + "cmd": "ip -j -s -6 tunnel show ip6t1", + "desc": "corner: opt=json cmd=tnl6:-s_-6_tunnel_show_ip6t1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-045", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -s -6 tunnel show ip6t1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.out new file mode 100644 index 000000000..a8d561063 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.out @@ -0,0 +1,6 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts + 0 0 0 0 0 0 +TX: Packets Bytes Errors DeadLoop NoRoute NoBufs + 0 0 0 0 0 0 +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.pcap new file mode 100644 index 000000000..da7fb7e31 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..668a9f6f2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/tnlsys.out new file mode 100644 index 000000000..46d0cd11a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-045/tnlsys.out @@ -0,0 +1,25 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "697036743100000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-s", + "-6", + "tunnel", + "show", + "ip6t1" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\nRX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n 0 0 0 0 0 0 \nTX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n 0 0 0 0 0 0 \n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/cmd.json new file mode 100644 index 000000000..f6e4dd01f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show name ip6g1" + }, + "cmd": "ip -j -6 tunnel show name ip6g1", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_name_ip6g1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-046", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show name ip6g1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.out new file mode 100644 index 000000000..ec69252af --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.out @@ -0,0 +1,5 @@ +ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9 + Drop packets out of sequence. + Checksum in received packet is required. + Sequence packets on output. + Checksum output packets. \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/tnlsys.out new file mode 100644 index 000000000..7b3e67deb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-046/tnlsys.out @@ -0,0 +1,25 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "69703667310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "name", + "ip6g1" + ], + "rc": 0, + "stdout": "ip6g1: gre/ipv6 remote 2001:db8::4 local 2001:db8::1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) key 9\n Drop packets out of sequence.\n Checksum in received packet is required.\n Sequence packets on output.\n Checksum output packets.", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/cmd.json new file mode 100644 index 000000000..0d621f9bd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show ip6tnl0" + }, + "cmd": "ip -j -6 tunnel show ip6tnl0", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_ip6tnl0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-047", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show ip6tnl0", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.out new file mode 100644 index 000000000..9c9c2b1db --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.out @@ -0,0 +1 @@ +ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/tnlsys.out new file mode 100644 index 000000000..352408846 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-047/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "697036746e6c30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "ip6tnl0" + ], + "rc": 0, + "stdout": "ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit inherit tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/cmd.json new file mode 100644 index 000000000..4264fd8e2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show mode ip6gre" + }, + "cmd": "ip -j -6 tunnel show mode ip6gre", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_mode_ip6gre", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-048", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show mode ip6gre", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.out new file mode 100644 index 000000000..712cd5293 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.out @@ -0,0 +1,4 @@ +[{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.pcap new file mode 100644 index 000000000..63436c305 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..3fb9ecf8f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/tnlsys.out new file mode 100644 index 000000000..19d708a14 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-048/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "mode", + "ip6gre" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/cmd.json new file mode 100644 index 000000000..b0949ac4c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show mode ip6ip6" + }, + "cmd": "ip -j -6 tunnel show mode ip6ip6", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_mode_ip6ip6", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-049", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show mode ip6ip6", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.out new file mode 100644 index 000000000..977822143 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.out @@ -0,0 +1,5 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.pcap new file mode 100644 index 000000000..3e0392010 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..db41736ed Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/tnlsys.out new file mode 100644 index 000000000..60bd55540 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-049/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "mode", + "ip6ip6" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/cmd.json new file mode 100644 index 000000000..b60891f84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show mode ipip6" + }, + "cmd": "ip -j -6 tunnel show mode ipip6", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_mode_ipip6", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-050", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show mode ipip6", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.out new file mode 100644 index 000000000..86f2a943f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.pcap new file mode 100644 index 000000000..80716f791 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..fd4bca18b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/tnlsys.out new file mode 100644 index 000000000..233dcbf42 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-050/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "mode", + "ipip6" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/cmd.json new file mode 100644 index 000000000..1457d2428 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show mode vti6" + }, + "cmd": "ip -j -6 tunnel show mode vti6", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_mode_vti6", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-051", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show mode vti6", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.out new file mode 100644 index 000000000..977822143 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.out @@ -0,0 +1,5 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.pcap new file mode 100644 index 000000000..c0399e196 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f30f7ec31 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/tnlsys.out new file mode 100644 index 000000000..1cd12f18b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-051/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "mode", + "vti6" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/cmd.json new file mode 100644 index 000000000..dbfc84f79 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show mode any" + }, + "cmd": "ip -j -6 tunnel show mode any", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_mode_any", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-052", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show mode any", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.out new file mode 100644 index 000000000..a0bc78e6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.out @@ -0,0 +1,9 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.pcap new file mode 100644 index 000000000..03a0db3b5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..fb6a9d6ab Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/tnlsys.out new file mode 100644 index 000000000..c46821e77 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-052/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "mode", + "any" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/cmd.json new file mode 100644 index 000000000..c9b028f9a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "tunnel show mode ip6ip6" + }, + "cmd": "ip -j tunnel show mode ip6ip6", + "desc": "corner: opt=json cmd=tnl6:tunnel_show_mode_ip6ip6", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-053", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show mode ip6ip6", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.out new file mode 100644 index 000000000..977822143 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.out @@ -0,0 +1,5 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.pcap new file mode 100644 index 000000000..5541aea4b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f90fd057b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/tnlsys.out new file mode 100644 index 000000000..f2fe5c889 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-053/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "mode", + "ip6ip6" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/cmd.json new file mode 100644 index 000000000..c774c7072 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show remote 2001:db8::2" + }, + "cmd": "ip -j -6 tunnel show remote 2001:db8::2", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_remote_2001:db8::2", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-054", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show remote 2001:db8::2", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.out new file mode 100644 index 000000000..b98c5bd87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.pcap new file mode 100644 index 000000000..fdf960d69 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..68cd58dba Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/tnlsys.out new file mode 100644 index 000000000..62cfb3408 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-054/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "remote", + "2001:db8::2" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/cmd.json new file mode 100644 index 000000000..84042f0a3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show local 2001:db8::1" + }, + "cmd": "ip -j -6 tunnel show local 2001:db8::1", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_local_2001:db8::1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-055", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show local 2001:db8::1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.out new file mode 100644 index 000000000..c2df30d2a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.out @@ -0,0 +1,6 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.pcap new file mode 100644 index 000000000..33af04806 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..3c4f09198 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/tnlsys.out new file mode 100644 index 000000000..3c4fcb3c2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-055/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "local", + "2001:db8::1" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/cmd.json new file mode 100644 index 000000000..b1f490637 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show dev d0" + }, + "cmd": "ip -j -6 tunnel show dev d0", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-056", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show dev d0", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.out new file mode 100644 index 000000000..b98c5bd87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.pcap new file mode 100644 index 000000000..fe74ecabc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..3b28aba88 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/tnlsys.out new file mode 100644 index 000000000..48afee3ff --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-056/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "dev", + "d0" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/cmd.json new file mode 100644 index 000000000..f127772a8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show encaplimit none" + }, + "cmd": "ip -j -6 tunnel show encaplimit none", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_encaplimit_none", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-057", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show encaplimit none", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.out new file mode 100644 index 000000000..b98c5bd87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.pcap new file mode 100644 index 000000000..3b3ead420 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..9d41cc17c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/tnlsys.out new file mode 100644 index 000000000..8a2332f94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-057/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "encaplimit", + "none" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/cmd.json new file mode 100644 index 000000000..2032dc941 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show hoplimit 1" + }, + "cmd": "ip -j -6 tunnel show hoplimit 1", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_hoplimit_1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-058", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show hoplimit 1", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.out new file mode 100644 index 000000000..b98c5bd87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.pcap new file mode 100644 index 000000000..f06575dbc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..fff77e0b8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/tnlsys.out new file mode 100644 index 000000000..aaf209c08 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-058/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "hoplimit", + "1" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/cmd.json new file mode 100644 index 000000000..9b5720dab --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show tclass inherit" + }, + "cmd": "ip -j -6 tunnel show tclass inherit", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_tclass_inherit", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-059", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show tclass inherit", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.out new file mode 100644 index 000000000..b98c5bd87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.pcap new file mode 100644 index 000000000..087b1739e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..d956ede78 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/tnlsys.out new file mode 100644 index 000000000..be6972ca9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-059/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "tclass", + "inherit" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/cmd.json new file mode 100644 index 000000000..f1eeebe4a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show flowlabel 0x12345" + }, + "cmd": "ip -j -6 tunnel show flowlabel 0x12345", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_flowlabel_0x12345", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-060", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show flowlabel 0x12345", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.out new file mode 100644 index 000000000..b98c5bd87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.pcap new file mode 100644 index 000000000..6184df72a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..fd8d85c30 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/tnlsys.out new file mode 100644 index 000000000..db2d9b202 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-060/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "flowlabel", + "0x12345" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/cmd.json new file mode 100644 index 000000000..19449489d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show key 9" + }, + "cmd": "ip -j -6 tunnel show key 9", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_key_9", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-061", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show key 9", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.out new file mode 100644 index 000000000..a0bc78e6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.out @@ -0,0 +1,9 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.pcap new file mode 100644 index 000000000..d23386e72 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..624519125 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/tnlsys.out new file mode 100644 index 000000000..e948e2f87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-061/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "key", + "9" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/cmd.json new file mode 100644 index 000000000..a2d3dd66c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show allow-localremote" + }, + "cmd": "ip -j -6 tunnel show allow-localremote", + "desc": "positive: opt=json cmd=tnl6:-6_tunnel_show_allow-localremote", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-062", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show allow-localremote", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.out new file mode 100644 index 000000000..b98c5bd87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.pcap new file mode 100644 index 000000000..ab3f99801 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..96d14f8f6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/tnlsys.out new file mode 100644 index 000000000..e5181c09a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-062/tnlsys.out @@ -0,0 +1,73 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "allow-localremote" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/cmd.json new file mode 100644 index 000000000..82c70764d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "-6 tunnel show encaplimit 300" + }, + "cmd": "ip -j -6 tunnel show encaplimit 300", + "desc": "corner: opt=json cmd=tnl6:-6_tunnel_show_encaplimit_300", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-063", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show encaplimit 300", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.out new file mode 100644 index 000000000..a0bc78e6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.out @@ -0,0 +1,9 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6t1","mode":"ipv6/ipv6","remote":"2001:db8::2","local":"2001:db8::1","link":"d0","ip6_tnl_f_ign_encap_limit":null,"hoplimit":1,"ip6_tnl_f_use_orig_tclass":null,"flowlabel":"0x12345","flowinfo":"0x00012345","ip6_tnl_f_allow_local_remote":null} +,{"ifname":"ip6t2","mode":"ip/ipv6","remote":"2001:db8::3","local":"2001:db8::1","encap_limit":2,"hoplimit":64,"tclass":"0x20","ip6_tnl_f_use_orig_flowlabel":null,"flowinfo":"0x02000000","ip6_tnl_f_rcv_dscp_copy":null} +,{"ifname":"ip6g1","mode":"gre/ipv6","remote":"2001:db8::4","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","key":9,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"vti61","mode":"ipv6/ipv6","remote":"2001:db8::5","local":"2001:db8::1","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","ikey":3,"okey":4} +,{"ifname":"gre6x","mode":"gre/ipv6","remote":"2001:db8::6","local":"2001:db8::1","encap_limit":4,"hoplimit":64,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.pcap new file mode 100644 index 000000000..e02ba155c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..44e1b18ec Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/tnlsys.out new file mode 100644 index 000000000..45c00ccc1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-063/tnlsys.out @@ -0,0 +1,74 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "000000000000000000000000000000000d0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t2", + "in": "000000000000000000000000000000000e0000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743200000000000000000000000000000004024000020000001400030020010db800000000000000000000000120010db8000000000000000000000003000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6g1", + "in": "000000000000000000000000000000000f0000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667310000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000004b000b0000000000900000009" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "vti61", + "in": "00000000000000000000000000000000100000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "767469363100000000000000000000000000000029000000000000000000000020010db800000000000000000000000120010db8000000000000000000000005200020000000000300000004" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "00000000000000000000000000000000110000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show", + "encaplimit", + "300" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6t1\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::2\",\"local\":\"2001:db8::1\",\"link\":\"d0\",\"ip6_tnl_f_ign_encap_limit\":null,\"hoplimit\":1,\"ip6_tnl_f_use_orig_tclass\":null,\"flowlabel\":\"0x12345\",\"flowinfo\":\"0x00012345\",\"ip6_tnl_f_allow_local_remote\":null}\n,{\"ifname\":\"ip6t2\",\"mode\":\"ip/ipv6\",\"remote\":\"2001:db8::3\",\"local\":\"2001:db8::1\",\"encap_limit\":2,\"hoplimit\":64,\"tclass\":\"0x20\",\"ip6_tnl_f_use_orig_flowlabel\":null,\"flowinfo\":\"0x02000000\",\"ip6_tnl_f_rcv_dscp_copy\":null}\n,{\"ifname\":\"ip6g1\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::4\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"key\":9,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"vti61\",\"mode\":\"ipv6/ipv6\",\"remote\":\"2001:db8::5\",\"local\":\"2001:db8::1\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"ikey\":3,\"okey\":4}\n,{\"ifname\":\"gre6x\",\"mode\":\"gre/ipv6\",\"remote\":\"2001:db8::6\",\"local\":\"2001:db8::1\",\"encap_limit\":4,\"hoplimit\":64,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/cmd.json new file mode 100644 index 000000000..f993a297f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "tunnel show" + }, + "cmd": "ip -j tunnel show", + "desc": "positive: opt=json cmd=tnl6:tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-064", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.out new file mode 100644 index 000000000..3773e32f2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.out @@ -0,0 +1,5 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.pcap new file mode 100644 index 000000000..3230ea777 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..728b26d82 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/tnlsys.out new file mode 100644 index 000000000..d490b3a52 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-064/tnlsys.out @@ -0,0 +1,50 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/cmd.json new file mode 100644 index 000000000..35f8e0d96 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "tnl6", + "json": "1", + "words": "tunnel show gre6x" + }, + "cmd": "ip -j tunnel show gre6x", + "desc": "corner: opt=json cmd=tnl6:tunnel_show_gre6x", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-065", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show gre6x", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.out new file mode 100644 index 000000000..b4f320308 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.out @@ -0,0 +1 @@ +gre6x: any/ip remote 32.1.13.184 local 0.0.0.1 ttl inherit tos inherit nopmtudisc ikey 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/tnlsys.out new file mode 100644 index 000000000..720130f43 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-065/tnlsys.out @@ -0,0 +1,24 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre6x", + "in": "67726536780000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "67726536780000000000000000000000000000002f044000000000000000030020010db800000000000000000000000120010db8", + "spill": "000000000000000000000006000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "gre6x" + ], + "rc": 0, + "stdout": "gre6x: any/ip remote 32.1.13.184 local 0.0.0.1 ttl inherit tos inherit nopmtudisc ikey 0\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/cmd.json new file mode 100644 index 000000000..b937a44cc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/cmd.json @@ -0,0 +1,74 @@ +{ + "axes": { + "fix": "ext", + "json": "1", + "words": "tunnel show" + }, + "cmd": "ip -j tunnel show", + "desc": "corner: opt=json cmd=ext:tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-066", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipipx type ipip external", + "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipipx type ipip external", + "rc": 0 + }, + { + "cmd": "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "rc": 0 + }, + { + "cmd": "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "rc": 0 + }, + { + "cmd": "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.out new file mode 100644 index 000000000..48dae6b95 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.out @@ -0,0 +1,6 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"ipipx","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0"} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipipx","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.pcap new file mode 100644 index 000000000..f73649dec Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..40fd4c7a0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/tnlsys.out new file mode 100644 index 000000000..980ceaada --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-066/tnlsys.out @@ -0,0 +1,57 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69706970780000000000000000000000000000000000000000000000000000004500000000004000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipipx", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69706970780000000000000000000000000000000000000000000000000000004500000000004000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"ipipx\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\"}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipipx\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/cmd.json new file mode 100644 index 000000000..5c9172fba --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/cmd.json @@ -0,0 +1,74 @@ +{ + "axes": { + "fix": "ext", + "json": "1", + "words": "-6 tunnel show" + }, + "cmd": "ip -j -6 tunnel show", + "desc": "corner: opt=json cmd=ext:-6_tunnel_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-067", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipipx type ipip external", + "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tunnel show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipipx type ipip external", + "rc": 0 + }, + { + "cmd": "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "rc": 0 + }, + { + "cmd": "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "rc": 0 + }, + { + "cmd": "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.out new file mode 100644 index 000000000..f869f26aa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.out @@ -0,0 +1,4 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.pcap new file mode 100644 index 000000000..03c40c780 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8ff1f059e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/tnlsys.out new file mode 100644 index 000000000..86e154737 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-067/tnlsys.out @@ -0,0 +1,37 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tunnel", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/cmd.json new file mode 100644 index 000000000..61fbdad9b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/cmd.json @@ -0,0 +1,74 @@ +{ + "axes": { + "fix": "ext", + "json": "1", + "words": "tunnel show ipipx" + }, + "cmd": "ip -j tunnel show ipipx", + "desc": "corner: opt=json cmd=ext:tunnel_show_ipipx", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-068", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipipx type ipip external", + "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tunnel show ipipx", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipipx type ipip external", + "rc": 0 + }, + { + "cmd": "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "rc": 0 + }, + { + "cmd": "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "rc": 0 + }, + { + "cmd": "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.out new file mode 100644 index 000000000..e553d036f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.out @@ -0,0 +1 @@ +ipipx: any/ip remote any local any ttl inherit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/tnlsys.out new file mode 100644 index 000000000..8f7202584 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-068/tnlsys.out @@ -0,0 +1,23 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipipx", + "in": "69706970780000000000000000000000000000000000000000000000000000004500000000004000000400000000000000000000", + "out": "69706970780000000000000000000000000000000000000000000000000000004500000000004000000000000000000000000000" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tunnel", + "show", + "ipipx" + ], + "rc": 0, + "stdout": "ipipx: any/ip remote any local any ttl inherit\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/b.txt new file mode 100644 index 000000000..2fd4f2701 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/b.txt @@ -0,0 +1,2 @@ +tunnel show +tunnel show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/cmd.json new file mode 100644 index 000000000..a0269fa50 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/cmd.json @@ -0,0 +1,115 @@ +{ + "axes": { + "batch": "twice", + "fix": "tnl4", + "json": "1", + "words": "-batch b.txt" + }, + "cmd": "ip -j -batch b.txt", + "desc": "corner: opt=json cmd=tnl4:batch:twice", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-069", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "printf '%s\\n' 'tunnel show' 'tunnel show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -batch b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tunnel show' 'tunnel show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.out new file mode 100644 index 000000000..067fcea4b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.out @@ -0,0 +1,30 @@ +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.pcap new file mode 100644 index 000000000..c7e4f6370 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..760f798ae Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/tnlsys.out new file mode 100644 index 000000000..abf604c0c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-069/tnlsys.out @@ -0,0 +1,267 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-batch", + "b.txt" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/b.txt new file mode 100644 index 000000000..e4af75bf5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/b.txt @@ -0,0 +1,2 @@ +tunnel show mode gre +tunnel show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/cmd.json new file mode 100644 index 000000000..a9784cd80 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/cmd.json @@ -0,0 +1,115 @@ +{ + "axes": { + "batch": "mode-then-list", + "fix": "tnl4", + "json": "1", + "words": "-batch b.txt" + }, + "cmd": "ip -j -batch b.txt", + "desc": "corner: opt=json cmd=tnl4:batch:mode-then-list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-070", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "printf '%s\\n' 'tunnel show mode gre' 'tunnel show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -batch b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tunnel show mode gre' 'tunnel show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.out new file mode 100644 index 000000000..b5a59c6cf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.out @@ -0,0 +1,16 @@ +gre0: gre/ip remote any local any ttl inherit nopmtudisc +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.pcap new file mode 100644 index 000000000..c83db7450 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8f20778d9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/tnlsys.out new file mode 100644 index 000000000..19fad408d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-070/tnlsys.out @@ -0,0 +1,148 @@ +{ + "ioctls": [ + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000004500000000004000002f00000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-batch", + "b.txt" + ], + "rc": 0, + "stdout": "gre0: gre/ip remote any local any ttl inherit nopmtudisc\n[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/b.txt new file mode 100644 index 000000000..fe9b980b9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/b.txt @@ -0,0 +1,2 @@ +tunnel show mode any +tunnel show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/cmd.json new file mode 100644 index 000000000..bad2a1458 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/cmd.json @@ -0,0 +1,115 @@ +{ + "axes": { + "batch": "any-sticks", + "fix": "tnl4", + "json": "1", + "words": "-batch b.txt" + }, + "cmd": "ip -j -batch b.txt", + "desc": "corner: opt=json cmd=tnl4:batch:any-sticks", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-071", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "printf '%s\\n' 'tunnel show mode any' 'tunnel show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -batch b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "rc": 0 + }, + { + "cmd": "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "rc": 0 + }, + { + "cmd": "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "rc": 0 + }, + { + "cmd": "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "rc": 0 + }, + { + "cmd": "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "rc": 0 + }, + { + "cmd": "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "rc": 0 + }, + { + "cmd": "ip tunnel add isa1 mode isatap local 192.0.2.1", + "rc": 0 + }, + { + "cmd": "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "rc": 0 + }, + { + "cmd": "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "rc": 0 + }, + { + "cmd": "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tunnel show mode any' 'tunnel show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.out new file mode 100644 index 000000000..1b78ced4f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.out @@ -0,0 +1,19 @@ +[{"ifname":"ip6tnl0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +,{"ifname":"ip6gre0","mode":"gre/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000","flags":[]} +,{"ifname":"ip6_vti0","mode":"ipv6/ipv6","remote":"::","local":"::","encap_limit":0,"tclass":"0x00","flowlabel":"0x00000","flowinfo":"0x00000000"} +] +[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +,{"ifname":"ipip1","mode":"any/ip","remote":"198.51.100.1","local":"192.0.2.1","dev":"d0","ttl":64,"tos":"0x10"} +,{"ifname":"ipip2","mode":"any/ip","remote":"198.51.100.9","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"gre1","mode":"gre/ip","remote":"198.51.100.2","local":"192.0.2.1","ttl":32,"key":5,"flags":["rx_drop_ooseq","rx_csum","tx_seq","tx_csum"]} +,{"ifname":"gre2","mode":"gre/ip","remote":"198.51.100.3","local":"192.0.2.1","ikey":1,"okey":2,"flags":["rx_drop_ooseq","tx_csum"]} +,{"ifname":"gre3","mode":"gre/ip","remote":"239.1.1.1","local":"192.0.2.1","ttl":1,"key":4009820417,"flags":[]} +,{"ifname":"sit1","mode":"any/ip","remote":"198.51.100.4","local":"192.0.2.1","ttl":64} +,{"ifname":"sit2","mode":"ipv6/ip","remote":"198.51.100.8","local":"192.0.2.1","ttl":16} +,{"ifname":"isa1","mode":"ipv6/ip","remote":"0.0.0.0","local":"192.0.2.1","pr":"192.0.2.11","pdr":"192.0.2.10"} +,{"ifname":"isan","mode":"any/ip","remote":"0.0.0.0","local":"192.0.2.2"} +,{"ifname":"vti1","mode":"ip/ip","remote":"198.51.100.5","local":"192.0.2.1","nopmtudisc":null,"ikey":7,"okey":8} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.pcap new file mode 100644 index 000000000..8bb7b8a8e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..b0552797a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/tnlsys.out new file mode 100644 index 000000000..434bdc47b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-071/tnlsys.out @@ -0,0 +1,162 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6tnl0", + "in": "00000000000000000000000000000000020000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036746e6c30000000000000000000000000002900000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6gre0", + "in": "00000000000000000000000000000000030000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69703667726530000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6_vti0", + "in": "00000000000000000000000000000000040000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6970365f767469300000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703100000000000000000000000c000000000000000000000000000000451000000000400040000000c0000201c6336401" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ipip2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697069703200000000000000000000000000000000000000000000000000000045010000000000000000000000000000c6336409" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6772653100000000000000000000000000000000b000b00000000005000000054500000000004000202f0000c0000201c6336402" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726532000000000000000000000000000000003000a00000000001000000024500000000004000002f0000c0000201c6336403" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre3", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "677265330000000000000000000000000000000020002000ef010101ef0101014500000000004000012f0000c0000201ef010101" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743100000000000000000000000000000000000000000000000000000000450000000000400040000000c0000201c6336404" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit2", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7369743200000000000000000000000000000000000000000000000000000000450000000000400010290000c0000201c6336408" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit2", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isa1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973613100000000000000000000000000000000010000000000000000000000450000000000400000290000c000020100000000" + }, + { + "family": 2, + "req": "SIOCGETPRL", + "name": "isa1", + "in": "0000000000000000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "00000000000000002000000000000000c000020b000000000000000000000000c000020a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "isa1", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "isan", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "6973616e00000000000000000000000000000000010000000000000000000000450000000000400000000000c000020200000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "vti1", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "7674693100000000000000000000000000000000210020000000000700000008450000000000000000040000c0000201c6336405" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-batch", + "b.txt" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"ip6tnl0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n,{\"ifname\":\"ip6gre0\",\"mode\":\"gre/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\",\"flags\":[]}\n,{\"ifname\":\"ip6_vti0\",\"mode\":\"ipv6/ipv6\",\"remote\":\"::\",\"local\":\"::\",\"encap_limit\":0,\"tclass\":\"0x00\",\"flowlabel\":\"0x00000\",\"flowinfo\":\"0x00000000\"}\n]\n[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n,{\"ifname\":\"ipip1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.1\",\"local\":\"192.0.2.1\",\"dev\":\"d0\",\"ttl\":64,\"tos\":\"0x10\"}\n,{\"ifname\":\"ipip2\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.9\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"gre1\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.2\",\"local\":\"192.0.2.1\",\"ttl\":32,\"key\":5,\"flags\":[\"rx_drop_ooseq\",\"rx_csum\",\"tx_seq\",\"tx_csum\"]}\n,{\"ifname\":\"gre2\",\"mode\":\"gre/ip\",\"remote\":\"198.51.100.3\",\"local\":\"192.0.2.1\",\"ikey\":1,\"okey\":2,\"flags\":[\"rx_drop_ooseq\",\"tx_csum\"]}\n,{\"ifname\":\"gre3\",\"mode\":\"gre/ip\",\"remote\":\"239.1.1.1\",\"local\":\"192.0.2.1\",\"ttl\":1,\"key\":4009820417,\"flags\":[]}\n,{\"ifname\":\"sit1\",\"mode\":\"any/ip\",\"remote\":\"198.51.100.4\",\"local\":\"192.0.2.1\",\"ttl\":64}\n,{\"ifname\":\"sit2\",\"mode\":\"ipv6/ip\",\"remote\":\"198.51.100.8\",\"local\":\"192.0.2.1\",\"ttl\":16}\n,{\"ifname\":\"isa1\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.1\",\"pr\":\"192.0.2.11\",\"pdr\":\"192.0.2.10\"}\n,{\"ifname\":\"isan\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"192.0.2.2\"}\n,{\"ifname\":\"vti1\",\"mode\":\"ip/ip\",\"remote\":\"198.51.100.5\",\"local\":\"192.0.2.1\",\"nopmtudisc\":null,\"ikey\":7,\"okey\":8}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/b.txt new file mode 100644 index 000000000..3fb03a0f8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/b.txt @@ -0,0 +1,2 @@ +tunnel show mode ip6ip6 ip6t1 +tunnel show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/cmd.json new file mode 100644 index 000000000..53c0b0840 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/cmd.json @@ -0,0 +1,85 @@ +{ + "axes": { + "batch": "v6-named-then-list", + "fix": "tnl6", + "json": "1", + "words": "-batch - < b.txt" + }, + "cmd": "ip -j -batch - < b.txt", + "desc": "corner: opt=json cmd=tnl6:batch:v6-named-then-list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tunnel/pw-072", + "modules": [ + "ipip", + "ip_gre", + "sit", + "ip_vti", + "ip6_tunnel", + "ip6_gre", + "ip6_vti" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "printf '%s\\n' 'tunnel show mode ip6ip6 ip6t1' 'tunnel show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -batch - < b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad", + "rc": 0 + }, + { + "cmd": "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "rc": 0 + }, + { + "cmd": "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2 hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "rc": 0 + }, + { + "cmd": "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "rc": 0 + }, + { + "cmd": "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "rc": 0 + }, + { + "cmd": "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tunnel show mode ip6ip6 ip6t1' 'tunnel show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.out new file mode 100644 index 000000000..25c19f33c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.out @@ -0,0 +1,5 @@ +ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote[{"ifname":"gre0","mode":"gre/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"flags":[]} +,{"ifname":"ip_vti0","mode":"ip/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null,"key":0} +,{"ifname":"tunl0","mode":"any/ip","remote":"0.0.0.0","local":"0.0.0.0","nopmtudisc":null} +,{"ifname":"sit0","mode":"ipv6/ip","remote":"0.0.0.0","local":"0.0.0.0","ttl":64,"nopmtudisc":null} +] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.pcap new file mode 100644 index 000000000..d3f30419a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..118f2257f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/tnlsys.out new file mode 100644 index 000000000..6a8e1c0eb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tunnel/pw-072/tnlsys.out @@ -0,0 +1,57 @@ +{ + "ioctls": [ + { + "family": 10, + "req": "SIOCGETTUNNEL", + "name": "ip6t1", + "in": "69703674310000000000000000000000000000002900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "697036743100000000000000000000000c00000029040100000123454300030020010db800000000000000000000000120010db8000000000000000000000002000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "gre0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "67726530000000000000000000000000000000000000000000000000000000004500000000000000002f00000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "ip_vti0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "69705f76746930000000000000000000000000002000200000000000000000004500000000000000000400000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "tunl0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "74756e6c300000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000" + }, + { + "family": 2, + "req": "SIOCGETTUNNEL", + "name": "sit0", + "in": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "out": "73697430000000000000000000000000000000000000000000000000000000004500000000000000402900000000000000000000" + }, + { + "family": 2, + "req": "SIOCGET6RD", + "name": "sit0", + "in": "000000000000000000000000000000000000000000000000", + "errno": 22 + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-batch", + "-" + ], + "rc": 0, + "stdout": "ip6t1: ipv6/ipv6 remote 2001:db8::2 local 2001:db8::1 dev d0 encaplimit none hoplimit 1 tclass inherit flowlabel 0x12345 (flowinfo 0x00012345) allow-localremote[{\"ifname\":\"gre0\",\"mode\":\"gre/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"flags\":[]}\n,{\"ifname\":\"ip_vti0\",\"mode\":\"ip/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null,\"key\":0}\n,{\"ifname\":\"tunl0\",\"mode\":\"any/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"nopmtudisc\":null}\n,{\"ifname\":\"sit0\",\"mode\":\"ipv6/ip\",\"remote\":\"0.0.0.0\",\"local\":\"0.0.0.0\",\"ttl\":64,\"nopmtudisc\":null}\n]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/cmd.json new file mode 100644 index 000000000..fc4825d4b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/cmd.json @@ -0,0 +1,39 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tuntap show" + }, + "cmd": "ip tuntap show", + "desc": "boundary: opt=plain cmd=bare:tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-001", + "modules": [ + "tun" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap show", + "name": "tnlsys" + } + ], + "result": { + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.pcap new file mode 100644 index 000000000..5d18a7d6a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..618661e09 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/tnlsys.out new file mode 100644 index 000000000..100df1562 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-001/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/cmd.json new file mode 100644 index 000000000..891f11872 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tuntap show" + }, + "cmd": "ip -j tuntap show", + "desc": "positive: opt=json cmd=tun:tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-002", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.pcap new file mode 100644 index 000000000..fe3e94951 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..4162cbc2e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/tnlsys.out new file mode 100644 index 000000000..d358fdb92 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-002/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/cmd.json new file mode 100644 index 000000000..502cf0915 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tuntap" + }, + "cmd": "ip tuntap", + "desc": "corner: opt=plain cmd=tun:tuntap", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-003", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.pcap new file mode 100644 index 000000000..481b28efa Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..57f2c327e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/tnlsys.out new file mode 100644 index 000000000..71cf8af5a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-003/tnlsys.out @@ -0,0 +1,58 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tuntap" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/cmd.json new file mode 100644 index 000000000..0f6a59079 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tuntap list" + }, + "cmd": "ip tuntap list", + "desc": "positive: opt=plain cmd=tun:tuntap_list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-004", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap list", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.pcap new file mode 100644 index 000000000..345c9439b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..07f187974 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/tnlsys.out new file mode 100644 index 000000000..b390d5b2c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-004/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tuntap", + "list" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/cmd.json new file mode 100644 index 000000000..426ccaa97 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tuntap lst" + }, + "cmd": "ip tuntap lst", + "desc": "positive: opt=plain cmd=tun:tuntap_lst", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-005", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap lst", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.pcap new file mode 100644 index 000000000..312829540 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ba1bd484c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/tnlsys.out new file mode 100644 index 000000000..ed93e3059 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-005/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tuntap", + "lst" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/cmd.json new file mode 100644 index 000000000..cec02cdfc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tuntap sh" + }, + "cmd": "ip tuntap sh", + "desc": "corner: opt=plain cmd=tun:tuntap_sh", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-006", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap sh", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.pcap new file mode 100644 index 000000000..e431eeba8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..edd312b4f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/tnlsys.out new file mode 100644 index 000000000..76bf2efb4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-006/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tuntap", + "sh" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/cmd.json new file mode 100644 index 000000000..6d4314c74 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tap show" + }, + "cmd": "ip tap show", + "desc": "positive: opt=plain cmd=tun:tap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-007", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.pcap new file mode 100644 index 000000000..f7f27381f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..e775d9128 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/tnlsys.out new file mode 100644 index 000000000..820b7a349 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-007/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/cmd.json new file mode 100644 index 000000000..d18ab21bb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tap" + }, + "cmd": "ip tap", + "desc": "corner: opt=plain cmd=tun:tap", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-008", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tap", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.pcap new file mode 100644 index 000000000..33a8adf72 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..ac0ae52f0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/tnlsys.out new file mode 100644 index 000000000..3dbe373db --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-008/tnlsys.out @@ -0,0 +1,58 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tap" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/cmd.json new file mode 100644 index 000000000..3fc8f8886 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "-d tuntap show" + }, + "cmd": "ip -d tuntap show", + "desc": "positive: opt=plain cmd=tun:-d_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-009", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -d tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.out new file mode 100644 index 000000000..7a28bab8b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.out @@ -0,0 +1,6 @@ +tap0: tap one_queue persist user 1000 group 100 + Attached to processes: +tun1: tun multi_queue vnet_hdr persist + Attached to processes: +tap2: tap pi persist filter + Attached to processes: diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.pcap new file mode 100644 index 000000000..a5f811c0d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..4d1be111d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/tnlsys.out new file mode 100644 index 000000000..e9591d7e9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-009/tnlsys.out @@ -0,0 +1,61 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [], + "run": { + "argv": [ + "ip", + "-d", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\n\tAttached to processes:\ntun1: tun multi_queue vnet_hdr persist\n\tAttached to processes:\ntap2: tap pi persist filter\n\tAttached to processes:\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/cmd.json new file mode 100644 index 000000000..8281f75e4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "-o tuntap show" + }, + "cmd": "ip -o tuntap show", + "desc": "corner: opt=plain cmd=tun:-o_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-010", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -o tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.pcap new file mode 100644 index 000000000..02314903b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..106f622c8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/tnlsys.out new file mode 100644 index 000000000..5793d3932 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-010/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-o", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/cmd.json new file mode 100644 index 000000000..a9c1fb69c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "-s tuntap show" + }, + "cmd": "ip -s tuntap show", + "desc": "corner: opt=plain cmd=tun:-s_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-011", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -s tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.pcap new file mode 100644 index 000000000..db560974b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..cd2ae5679 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/tnlsys.out new file mode 100644 index 000000000..e5ee2ad7a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-011/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-s", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/cmd.json new file mode 100644 index 000000000..830555658 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "-6 tuntap show" + }, + "cmd": "ip -6 tuntap show", + "desc": "corner: opt=plain cmd=tun:-6_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-012", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -6 tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.pcap new file mode 100644 index 000000000..a895fa22f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..81b08fba3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/tnlsys.out new file mode 100644 index 000000000..7c68eedf4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-012/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-6", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/cmd.json new file mode 100644 index 000000000..fde05aac4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tuntap show dev tap0" + }, + "cmd": "ip tuntap show dev tap0", + "desc": "corner: opt=plain cmd=tun:tuntap_show_dev_tap0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-013", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap show dev tap0", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.pcap new file mode 100644 index 000000000..5c38e903d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f387fb452 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/tnlsys.out new file mode 100644 index 000000000..08a338095 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-013/tnlsys.out @@ -0,0 +1,61 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tuntap", + "show", + "dev", + "tap0" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/cmd.json new file mode 100644 index 000000000..de7b31ea1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tuntap show bogus words" + }, + "cmd": "ip tuntap show bogus words", + "desc": "corner: opt=plain cmd=tun:tuntap_show_bogus_words", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-014", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap show bogus words", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.pcap new file mode 100644 index 000000000..0b1e23cfd Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..7bdb085b4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/tnlsys.out new file mode 100644 index 000000000..c0d76782d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-014/tnlsys.out @@ -0,0 +1,61 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tuntap", + "show", + "bogus", + "words" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/cmd.json new file mode 100644 index 000000000..7cfac436c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/cmd.json @@ -0,0 +1,89 @@ +{ + "axes": { + "fix": "proc", + "json": "0", + "words": "-d tuntap show" + }, + "cmd": "ip -d tuntap show", + "desc": "positive: opt=plain cmd=proc:-d_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-015", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -d tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.out new file mode 100644 index 000000000..d61d93c11 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.out @@ -0,0 +1,6 @@ +tap0: tap one_queue persist user 1000 group 100 + Attached to processes:python3(209708) +tun1: tun multi_queue vnet_hdr persist + Attached to processes:python3(209711)python3(209714) +tap2: tap pi persist filter + Attached to processes: diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.pcap new file mode 100644 index 000000000..575aa071c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..5e54b6e6f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/tnlsys.out new file mode 100644 index 000000000..8d474eef5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-015/tnlsys.out @@ -0,0 +1,80 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [ + { + "pid": 209708, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t428\nino:\t231\niff:\ttap0\n", + "comm": "python3\n" + }, + { + "pid": 209711, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t490\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + }, + { + "pid": 209714, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t533\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + } + ], + "run": { + "argv": [ + "ip", + "-d", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\n\tAttached to processes:python3(209708)\ntun1: tun multi_queue vnet_hdr persist\n\tAttached to processes:python3(209711)python3(209714)\ntap2: tap pi persist filter\n\tAttached to processes:\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/cmd.json new file mode 100644 index 000000000..eca69d6f0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/cmd.json @@ -0,0 +1,89 @@ +{ + "axes": { + "fix": "proc", + "json": "0", + "words": "-o -d tuntap show" + }, + "cmd": "ip -o -d tuntap show", + "desc": "corner: opt=plain cmd=proc:-o_-d_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-016", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -o -d tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.out new file mode 100644 index 000000000..190cdbb13 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100\ Attached to processes:python3(209810) +tun1: tun multi_queue vnet_hdr persist\ Attached to processes:python3(209813)python3(209816) +tap2: tap pi persist filter\ Attached to processes: diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.pcap new file mode 100644 index 000000000..32906a479 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..d7125d2d4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/tnlsys.out new file mode 100644 index 000000000..0ed5c1aec --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-016/tnlsys.out @@ -0,0 +1,81 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [ + { + "pid": 209810, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t426\nino:\t231\niff:\ttap0\n", + "comm": "python3\n" + }, + { + "pid": 209813, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t489\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + }, + { + "pid": 209816, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t533\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + } + ], + "run": { + "argv": [ + "ip", + "-o", + "-d", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\\\tAttached to processes:python3(209810)\ntun1: tun multi_queue vnet_hdr persist\\\tAttached to processes:python3(209813)python3(209816)\ntap2: tap pi persist filter\\\tAttached to processes:\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/cmd.json new file mode 100644 index 000000000..abd4cf314 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/cmd.json @@ -0,0 +1,89 @@ +{ + "axes": { + "fix": "proc", + "json": "0", + "words": "-d tuntap" + }, + "cmd": "ip -d tuntap", + "desc": "corner: opt=plain cmd=proc:-d_tuntap", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-017", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -d tuntap", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.out new file mode 100644 index 000000000..dbe751f8b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.out @@ -0,0 +1,6 @@ +tap0: tap one_queue persist user 1000 group 100 + Attached to processes:python3(209912) +tun1: tun multi_queue vnet_hdr persist + Attached to processes:python3(209915)python3(209918) +tap2: tap pi persist filter + Attached to processes: diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.pcap new file mode 100644 index 000000000..0ae2c7794 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..d5d796924 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/tnlsys.out new file mode 100644 index 000000000..8787e6345 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-017/tnlsys.out @@ -0,0 +1,79 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [ + { + "pid": 209912, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t423\nino:\t231\niff:\ttap0\n", + "comm": "python3\n" + }, + { + "pid": 209915, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t488\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + }, + { + "pid": 209918, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t533\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + } + ], + "run": { + "argv": [ + "ip", + "-d", + "tuntap" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\n\tAttached to processes:python3(209912)\ntun1: tun multi_queue vnet_hdr persist\n\tAttached to processes:python3(209915)python3(209918)\ntap2: tap pi persist filter\n\tAttached to processes:\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/cmd.json new file mode 100644 index 000000000..7dc03c568 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "xns", + "json": "0", + "words": "-d tuntap show" + }, + "cmd": "ip -d tuntap show", + "desc": "corner: opt=plain cmd=xns:-d_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-018", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "setsid unshare -n sh -c 'ip tuntap add tap0 mode tap && exec python3 /run/tnlholder.py tap0 0x1002' /dev/null 2>&1 & sleep 1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -d tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "rc": 0 + }, + { + "cmd": "setsid unshare -n sh -c 'ip tuntap add tap0 mode tap && exec python3 /run/tnlholder.py tap0 0x1002' /dev/null 2>&1 & sleep 1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.out new file mode 100644 index 000000000..b5d08f378 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.out @@ -0,0 +1,6 @@ +tap0: tap one_queue persist user 1000 group 100 + Attached to processes:python3(210014) +tun1: tun multi_queue vnet_hdr persist + Attached to processes: +tap2: tap pi persist filter + Attached to processes: diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.pcap new file mode 100644 index 000000000..1ac58383b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..56c0d01cc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/tnlsys.out new file mode 100644 index 000000000..6d6d65f87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-018/tnlsys.out @@ -0,0 +1,68 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [ + { + "pid": 210014, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t421\nino:\t231\niff:\ttap0\n", + "comm": "python3\n" + } + ], + "run": { + "argv": [ + "ip", + "-d", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\n\tAttached to processes:python3(210014)\ntun1: tun multi_queue vnet_hdr persist\n\tAttached to processes:\ntap2: tap pi persist filter\n\tAttached to processes:\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/b.txt new file mode 100644 index 000000000..f2647ade9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/b.txt @@ -0,0 +1,2 @@ +tuntap show +tuntap show dev tap0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/cmd.json new file mode 100644 index 000000000..a9d20d213 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "batch": "twice", + "fix": "tun", + "json": "0", + "words": "-batch b.txt" + }, + "cmd": "ip -batch b.txt", + "desc": "corner: opt=plain cmd=tun:batch:twice", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-019", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'tuntap show' 'tuntap show dev tap0' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -batch b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tuntap show' 'tuntap show dev tap0' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.out new file mode 100644 index 000000000..54361bc42 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.out @@ -0,0 +1,6 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.pcap new file mode 100644 index 000000000..d1079eaee Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..e9d8e18f7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/tnlsys.out new file mode 100644 index 000000000..7c74c1a90 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-019/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-batch", + "b.txt" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\ntap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/b.txt new file mode 100644 index 000000000..301877b0a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/b.txt @@ -0,0 +1 @@ +tap show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/cmd.json new file mode 100644 index 000000000..3972bd365 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "batch": "stdin", + "fix": "tun", + "json": "0", + "words": "-batch - < b.txt" + }, + "cmd": "ip -batch - < b.txt", + "desc": "corner: opt=plain cmd=tun:batch:stdin", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/ec-020", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'tap show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -batch - < b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tap show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.pcap new file mode 100644 index 000000000..dba30944d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8488c08fe Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/tnlsys.out new file mode 100644 index 000000000..5321c1735 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ec-020/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-batch", + "-" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/cmd.json new file mode 100644 index 000000000..de96a9654 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/cmd.json @@ -0,0 +1,39 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tuntap bogus" + }, + "cmd": "ip tuntap bogus", + "desc": "negative: opt=plain cmd=ng:bare:tuntap_bogus: an unknown tuntap command", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tuntap/ng-001", + "modules": [ + "tun" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.err new file mode 100644 index 000000000..2f1d7a145 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.err @@ -0,0 +1 @@ +Command "bogus" is unknown, try "ip tuntap help". diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/tnlsys.out new file mode 100644 index 000000000..7586141a7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-001/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tuntap", + "bogus" + ], + "rc": 255, + "stdout": "", + "stderr": "Command \"bogus\" is unknown, try \"ip tuntap help\".\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/cmd.json new file mode 100644 index 000000000..549a885eb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/cmd.json @@ -0,0 +1,39 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tuntap help" + }, + "cmd": "ip tuntap help", + "desc": "negative: opt=plain cmd=ng:bare:tuntap_help: the usage, exit(-1)", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tuntap/ng-002", + "modules": [ + "tun" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap help", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.err new file mode 100644 index 000000000..826825d82 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.err @@ -0,0 +1,6 @@ +Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ] + [ mode { tun | tap } ] [ user USER ] [ group GROUP ] + [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ] + +Where: USER := { STRING | NUMBER } + GROUP := { STRING | NUMBER } diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/tnlsys.out new file mode 100644 index 000000000..6a6c390b5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-002/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tuntap", + "help" + ], + "rc": 255, + "stdout": "", + "stderr": "Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]\n [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n\nWhere: USER := { STRING | NUMBER }\n GROUP := { STRING | NUMBER }\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/cmd.json new file mode 100644 index 000000000..ea5bc82b2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/cmd.json @@ -0,0 +1,39 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tuntap add" + }, + "cmd": "ip tuntap add", + "desc": "negative: opt=plain cmd=ng:bare:tuntap_add: a write with no mode: refused before any ioctl", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 1, + "refused_by": "iproute2" + }, + "id": "tuntap/ng-003", + "modules": [ + "tun" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap add", + "name": "tnlsys" + } + ], + "result": { + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.err new file mode 100644 index 000000000..7f20655d9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.err @@ -0,0 +1 @@ +You failed to specify a tunnel mode diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/tnlsys.out new file mode 100644 index 000000000..45428e0ea --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-003/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tuntap", + "add" + ], + "rc": 1, + "stdout": "", + "stderr": "You failed to specify a tunnel mode\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/cmd.json new file mode 100644 index 000000000..e8d365bf5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/cmd.json @@ -0,0 +1,39 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tuntap add mode bogus" + }, + "cmd": "ip tuntap add mode bogus", + "desc": "negative: opt=plain cmd=ng:bare:tuntap_add_mode_bogus: Unknown tunnel mode, before any ioctl", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tuntap/ng-004", + "modules": [ + "tun" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap add mode bogus", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.err new file mode 100644 index 000000000..63aaef1de --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.err @@ -0,0 +1 @@ +Unknown tunnel mode "bogus" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/tnlsys.out new file mode 100644 index 000000000..ddb0a2727 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-004/tnlsys.out @@ -0,0 +1,14 @@ +{ + "run": { + "argv": [ + "ip", + "tuntap", + "add", + "mode", + "bogus" + ], + "rc": 255, + "stdout": "", + "stderr": "Unknown tunnel mode \"bogus\"\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/cmd.json new file mode 100644 index 000000000..e1bea68f7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/cmd.json @@ -0,0 +1,39 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tuntap add mode tap user nosuchuser" + }, + "cmd": "ip tuntap add mode tap user nosuchuser", + "desc": "negative: opt=plain cmd=ng:bare:tuntap_add_mode_tap_user_nosuchuser: invalid user, before any ioctl", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 255, + "refused_by": "iproute2" + }, + "id": "tuntap/ng-005", + "modules": [ + "tun" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap add mode tap user nosuchuser", + "name": "tnlsys" + } + ], + "result": { + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.err new file mode 100644 index 000000000..eca9c619b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.err @@ -0,0 +1 @@ +invalid user "nosuchuser" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/tnlsys.out new file mode 100644 index 000000000..c2c7ff249 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-005/tnlsys.out @@ -0,0 +1,16 @@ +{ + "run": { + "argv": [ + "ip", + "tuntap", + "add", + "mode", + "tap", + "user", + "nosuchuser" + ], + "rc": 255, + "stdout": "", + "stderr": "invalid user \"nosuchuser\"\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/cmd.json new file mode 100644 index 000000000..93f4c8742 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/cmd.json @@ -0,0 +1,39 @@ +{ + "axes": { + "fix": "bare", + "json": "0", + "words": "tuntap del" + }, + "cmd": "ip tuntap del", + "desc": "negative: opt=plain cmd=ng:bare:tuntap_del: a delete with no mode: refused before any ioctl", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 1, + "refused_by": "iproute2" + }, + "id": "tuntap/ng-006", + "modules": [ + "tun" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap del", + "name": "tnlsys" + } + ], + "result": { + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.err new file mode 100644 index 000000000..7f20655d9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.err @@ -0,0 +1 @@ +You failed to specify a tunnel mode diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/tnlsys.out new file mode 100644 index 000000000..3302d7c66 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/ng-006/tnlsys.out @@ -0,0 +1,12 @@ +{ + "run": { + "argv": [ + "ip", + "tuntap", + "del" + ], + "rc": 1, + "stdout": "", + "stderr": "You failed to specify a tunnel mode\n" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/cmd.json new file mode 100644 index 000000000..609110826 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "0", + "words": "tuntap show" + }, + "cmd": "ip tuntap show", + "desc": "positive: opt=plain cmd=tun:tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-001", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.out new file mode 100644 index 000000000..9dd2d1b94 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.out @@ -0,0 +1,3 @@ +tap0: tap one_queue persist user 1000 group 100 +tun1: tun multi_queue vnet_hdr persist +tap2: tap pi persist filter diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.pcap new file mode 100644 index 000000000..d36e4e257 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8491737da Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/tnlsys.out new file mode 100644 index 000000000..7dd1fa8a2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-001/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "tap0: tap one_queue persist user 1000 group 100\ntun1: tun multi_queue vnet_hdr persist\ntap2: tap pi persist filter\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/cmd.json new file mode 100644 index 000000000..3eccf95a2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/cmd.json @@ -0,0 +1,39 @@ +{ + "axes": { + "fix": "bare", + "json": "1", + "words": "tuntap show" + }, + "cmd": "ip -j tuntap show", + "desc": "boundary: opt=json cmd=bare:tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-002", + "modules": [ + "tun" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tuntap show", + "name": "tnlsys" + } + ], + "result": { + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.out new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.out @@ -0,0 +1 @@ +[] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.pcap new file mode 100644 index 000000000..f9bf1e5e2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..20f521b52 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/tnlsys.out new file mode 100644 index 000000000..c2e703b37 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-002/tnlsys.out @@ -0,0 +1,13 @@ +{ + "run": { + "argv": [ + "ip", + "-j", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/cmd.json new file mode 100644 index 000000000..b963488b1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tuntap" + }, + "cmd": "ip -j tuntap", + "desc": "corner: opt=json cmd=tun:tuntap", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-003", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tuntap", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.pcap new file mode 100644 index 000000000..68f9e92a9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..073e55c3f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/tnlsys.out new file mode 100644 index 000000000..effb04ac0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-003/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tuntap" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/cmd.json new file mode 100644 index 000000000..9c57a885c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tuntap list" + }, + "cmd": "ip -j tuntap list", + "desc": "positive: opt=json cmd=tun:tuntap_list", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-004", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tuntap list", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.pcap new file mode 100644 index 000000000..c90621b64 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..95a806125 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/tnlsys.out new file mode 100644 index 000000000..df6fb1727 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-004/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tuntap", + "list" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/cmd.json new file mode 100644 index 000000000..eaf1488ee --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tuntap lst" + }, + "cmd": "ip -j tuntap lst", + "desc": "positive: opt=json cmd=tun:tuntap_lst", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-005", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tuntap lst", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.pcap new file mode 100644 index 000000000..8b50814e1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..67a8980d1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/tnlsys.out new file mode 100644 index 000000000..b0325890f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-005/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tuntap", + "lst" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/cmd.json new file mode 100644 index 000000000..b29549906 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tuntap sh" + }, + "cmd": "ip -j tuntap sh", + "desc": "corner: opt=json cmd=tun:tuntap_sh", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-006", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tuntap sh", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.pcap new file mode 100644 index 000000000..b89cfee8a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8159c7f26 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/tnlsys.out new file mode 100644 index 000000000..9efce6f41 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-006/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tuntap", + "sh" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/cmd.json new file mode 100644 index 000000000..6f7e6b1af --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tap show" + }, + "cmd": "ip -j tap show", + "desc": "positive: opt=json cmd=tun:tap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-007", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.pcap new file mode 100644 index 000000000..09e0606e3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..770e9e32c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/tnlsys.out new file mode 100644 index 000000000..6a9aa5e68 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-007/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/cmd.json new file mode 100644 index 000000000..ed9cec710 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tap" + }, + "cmd": "ip -j tap", + "desc": "corner: opt=json cmd=tun:tap", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-008", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tap", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.pcap new file mode 100644 index 000000000..2756f5bc7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f2950420c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/tnlsys.out new file mode 100644 index 000000000..44b65e2c1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-008/tnlsys.out @@ -0,0 +1,59 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tap" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/cmd.json new file mode 100644 index 000000000..edf74fd52 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "-d tuntap show" + }, + "cmd": "ip -j -d tuntap show", + "desc": "positive: opt=json cmd=tun:-d_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-009", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -d tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.out new file mode 100644 index 000000000..60b55a57b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100,"processes":[]},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"],"processes":[]},{"ifname":"tap2","flags":["tap","pi","persist","filter"],"processes":[]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.pcap new file mode 100644 index 000000000..4a880d9c0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..1f9096844 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/tnlsys.out new file mode 100644 index 000000000..45e7780b1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-009/tnlsys.out @@ -0,0 +1,62 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [], + "run": { + "argv": [ + "ip", + "-j", + "-d", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100,\"processes\":[]},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"],\"processes\":[]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"],\"processes\":[]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/cmd.json new file mode 100644 index 000000000..4c8c0123a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "-o tuntap show" + }, + "cmd": "ip -j -o tuntap show", + "desc": "corner: opt=json cmd=tun:-o_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-010", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -o tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.pcap new file mode 100644 index 000000000..22ca7febb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..50c006d4e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/tnlsys.out new file mode 100644 index 000000000..a26de125a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-010/tnlsys.out @@ -0,0 +1,61 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-o", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/cmd.json new file mode 100644 index 000000000..ab0bd7d44 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "-s tuntap show" + }, + "cmd": "ip -j -s tuntap show", + "desc": "corner: opt=json cmd=tun:-s_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-011", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -s tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.pcap new file mode 100644 index 000000000..70ca8c65c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..f77861ac1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/tnlsys.out new file mode 100644 index 000000000..254eced25 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-011/tnlsys.out @@ -0,0 +1,61 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-s", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/cmd.json new file mode 100644 index 000000000..d869aaf80 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "-6 tuntap show" + }, + "cmd": "ip -j -6 tuntap show", + "desc": "corner: opt=json cmd=tun:-6_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-012", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -6 tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.pcap new file mode 100644 index 000000000..4ffc5b384 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8b940cd1d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/tnlsys.out new file mode 100644 index 000000000..98ce3b582 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-012/tnlsys.out @@ -0,0 +1,61 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-6", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/cmd.json new file mode 100644 index 000000000..997fde5ca --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tuntap show dev tap0" + }, + "cmd": "ip -j tuntap show dev tap0", + "desc": "corner: opt=json cmd=tun:tuntap_show_dev_tap0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-013", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tuntap show dev tap0", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.pcap new file mode 100644 index 000000000..770a18ad9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..6a36460c4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/tnlsys.out new file mode 100644 index 000000000..10e9eabf5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-013/tnlsys.out @@ -0,0 +1,62 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tuntap", + "show", + "dev", + "tap0" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/cmd.json new file mode 100644 index 000000000..8eb3c4e1d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/cmd.json @@ -0,0 +1,63 @@ +{ + "axes": { + "fix": "tun", + "json": "1", + "words": "tuntap show bogus words" + }, + "cmd": "ip -j tuntap show bogus words", + "desc": "corner: opt=json cmd=tun:tuntap_show_bogus_words", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-014", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j tuntap show bogus words", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.pcap new file mode 100644 index 000000000..f867182a4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..20e01e392 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/tnlsys.out new file mode 100644 index 000000000..0b741cd30 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-014/tnlsys.out @@ -0,0 +1,62 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "tuntap", + "show", + "bogus", + "words" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/cmd.json new file mode 100644 index 000000000..ac2b9d392 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/cmd.json @@ -0,0 +1,89 @@ +{ + "axes": { + "fix": "proc", + "json": "1", + "words": "-d tuntap show" + }, + "cmd": "ip -j -d tuntap show", + "desc": "positive: opt=json cmd=proc:-d_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-015", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -d tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.out new file mode 100644 index 000000000..06e35f0b5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100,"processes":[{"name":"python3","pid":211530}]},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"],"processes":[{"name":"python3","pid":211533},{"name":"python3","pid":211536}]},{"ifname":"tap2","flags":["tap","pi","persist","filter"],"processes":[]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.pcap new file mode 100644 index 000000000..6b4e7839a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..80fca51a5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/tnlsys.out new file mode 100644 index 000000000..ea8ae0099 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-015/tnlsys.out @@ -0,0 +1,81 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [ + { + "pid": 211530, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t428\nino:\t231\niff:\ttap0\n", + "comm": "python3\n" + }, + { + "pid": 211533, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t490\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + }, + { + "pid": 211536, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t533\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-d", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100,\"processes\":[{\"name\":\"python3\",\"pid\":211530}]},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"],\"processes\":[{\"name\":\"python3\",\"pid\":211533},{\"name\":\"python3\",\"pid\":211536}]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"],\"processes\":[]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/cmd.json new file mode 100644 index 000000000..a781c9b50 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/cmd.json @@ -0,0 +1,89 @@ +{ + "axes": { + "fix": "proc", + "json": "1", + "words": "-o -d tuntap show" + }, + "cmd": "ip -j -o -d tuntap show", + "desc": "corner: opt=json cmd=proc:-o_-d_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-016", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -o -d tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.out new file mode 100644 index 000000000..b0f40924c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100,"processes":[{"name":"python3","pid":211632}]},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"],"processes":[{"name":"python3","pid":211635},{"name":"python3","pid":211638}]},{"ifname":"tap2","flags":["tap","pi","persist","filter"],"processes":[]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.pcap new file mode 100644 index 000000000..f99ab473d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..8b9fc3750 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/tnlsys.out new file mode 100644 index 000000000..dc7507093 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-016/tnlsys.out @@ -0,0 +1,82 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [ + { + "pid": 211632, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t426\nino:\t231\niff:\ttap0\n", + "comm": "python3\n" + }, + { + "pid": 211635, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t489\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + }, + { + "pid": 211638, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t533\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-o", + "-d", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100,\"processes\":[{\"name\":\"python3\",\"pid\":211632}]},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"],\"processes\":[{\"name\":\"python3\",\"pid\":211635},{\"name\":\"python3\",\"pid\":211638}]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"],\"processes\":[]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/cmd.json new file mode 100644 index 000000000..5c7753a06 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/cmd.json @@ -0,0 +1,89 @@ +{ + "axes": { + "fix": "proc", + "json": "1", + "words": "-d tuntap" + }, + "cmd": "ip -j -d tuntap", + "desc": "corner: opt=json cmd=proc:-d_tuntap", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-017", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -d tuntap", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tap0 0x3002 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + }, + { + "cmd": "setsid python3 /run/tnlholder.py tun1 0x5101 /dev/null 2>&1 & sleep 1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.out new file mode 100644 index 000000000..b67cde7d6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100,"processes":[{"name":"python3","pid":211734}]},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"],"processes":[{"name":"python3","pid":211737},{"name":"python3","pid":211740}]},{"ifname":"tap2","flags":["tap","pi","persist","filter"],"processes":[]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.pcap new file mode 100644 index 000000000..06057f34d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..76cd0045d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/tnlsys.out new file mode 100644 index 000000000..5f7e8b64a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-017/tnlsys.out @@ -0,0 +1,80 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [ + { + "pid": 211734, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t423\nino:\t231\niff:\ttap0\n", + "comm": "python3\n" + }, + { + "pid": 211737, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t488\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + }, + { + "pid": 211740, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t533\nino:\t231\niff:\ttun1\n", + "comm": "python3\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-d", + "tuntap" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100,\"processes\":[{\"name\":\"python3\",\"pid\":211734}]},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"],\"processes\":[{\"name\":\"python3\",\"pid\":211737},{\"name\":\"python3\",\"pid\":211740}]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"],\"processes\":[]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/cmd.json new file mode 100644 index 000000000..1876679ff --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/cmd.json @@ -0,0 +1,79 @@ +{ + "axes": { + "fix": "xns", + "json": "1", + "words": "-d tuntap show" + }, + "cmd": "ip -j -d tuntap show", + "desc": "corner: opt=json cmd=xns:-d_tuntap_show", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-018", + "modules": [ + "tun" + ], + "pre": [ + "pkill -f '[t]nlholde[r]'; true", + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "setsid unshare -n sh -c 'ip tuntap add tap0 mode tap && exec python3 /run/tnlholder.py tap0 0x1002' /dev/null 2>&1 & sleep 1" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -d tuntap show", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "pkill -f '[t]nlholde[r]'; true", + "rc": 0 + }, + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'import fcntl,os,struct,sys,time' 'f=os.open(\"/dev/net/tun\",os.O_RDWR)' 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))' 'time.sleep(120)' > /run/tnlholder.py", + "rc": 0 + }, + { + "cmd": "setsid unshare -n sh -c 'ip tuntap add tap0 mode tap && exec python3 /run/tnlholder.py tap0 0x1002' /dev/null 2>&1 & sleep 1", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + }, + "serial": true +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.out new file mode 100644 index 000000000..00fecd4db --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100,"processes":[{"name":"python3","pid":211836}]},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"],"processes":[]},{"ifname":"tap2","flags":["tap","pi","persist","filter"],"processes":[]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.pcap new file mode 100644 index 000000000..b4895dcd7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..2342257b6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/tnlsys.out new file mode 100644 index 000000000..cc7bf86dd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-018/tnlsys.out @@ -0,0 +1,69 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "tunfds": [ + { + "pid": 211836, + "fd": 3, + "fdinfo": "pos:\t0\nflags:\t02100002\nmnt_id:\t421\nino:\t231\niff:\ttap0\n", + "comm": "python3\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-d", + "tuntap", + "show" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100,\"processes\":[{\"name\":\"python3\",\"pid\":211836}]},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"],\"processes\":[]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"],\"processes\":[]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/b.txt new file mode 100644 index 000000000..f2647ade9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/b.txt @@ -0,0 +1,2 @@ +tuntap show +tuntap show dev tap0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/cmd.json new file mode 100644 index 000000000..73abbf7e3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "batch": "twice", + "fix": "tun", + "json": "1", + "words": "-batch b.txt" + }, + "cmd": "ip -j -batch b.txt", + "desc": "corner: opt=json cmd=tun:batch:twice", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-019", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'tuntap show' 'tuntap show dev tap0' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -batch b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tuntap show' 'tuntap show dev tap0' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.out new file mode 100644 index 000000000..7214be7f2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.out @@ -0,0 +1,2 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.pcap new file mode 100644 index 000000000..5a86ddbff Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..be04a1d05 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/tnlsys.out new file mode 100644 index 000000000..a6cb68227 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-019/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-batch", + "b.txt" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/b.txt new file mode 100644 index 000000000..301877b0a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/b.txt @@ -0,0 +1 @@ +tap show diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/cmd.json new file mode 100644 index 000000000..b628036c1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "batch": "stdin", + "fix": "tun", + "json": "1", + "words": "-batch - < b.txt" + }, + "cmd": "ip -j -batch - < b.txt", + "desc": "corner: opt=json cmd=tun:batch:stdin", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tuntap/pw-020", + "modules": [ + "tun" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", + "printf '%s\\n' 'tap show' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tnlsnap -- -j -batch - < b.txt", + "name": "tnlsys" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "rc": 0 + }, + { + "cmd": "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "rc": 0 + }, + { + "cmd": "ip tuntap add tap2 mode tap pi", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'tap show' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.out new file mode 100644 index 000000000..f91b97add --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.out @@ -0,0 +1 @@ +[{"ifname":"tap0","flags":["tap","one_queue","persist"],"user":1000,"group":100},{"ifname":"tun1","flags":["tun","multi_queue","vnet_hdr","persist"]},{"ifname":"tap2","flags":["tap","pi","persist","filter"]}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.pcap new file mode 100644 index 000000000..ea88919b4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/netlink_route_tnlsys.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/netlink_route_tnlsys.pcap new file mode 100644 index 000000000..95a8c2a63 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/netlink_route_tnlsys.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/tnlsys.out b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/tnlsys.out new file mode 100644 index 000000000..41072ab2c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tuntap/pw-020/tnlsys.out @@ -0,0 +1,60 @@ +{ + "props": [ + { + "dev": "tap0", + "prop": "tun_flags", + "value": "0x3802\n" + }, + { + "dev": "tap0", + "prop": "owner", + "value": "1000\n" + }, + { + "dev": "tap0", + "prop": "group", + "value": "100\n" + }, + { + "dev": "tap2", + "prop": "tun_flags", + "value": "0x802\n" + }, + { + "dev": "tap2", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tap2", + "prop": "group", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "tun_flags", + "value": "0x5901\n" + }, + { + "dev": "tun1", + "prop": "owner", + "value": "-1\n" + }, + { + "dev": "tun1", + "prop": "group", + "value": "-1\n" + } + ], + "run": { + "argv": [ + "ip", + "-j", + "-batch", + "-" + ], + "rc": 0, + "stdout": "[{\"ifname\":\"tap0\",\"flags\":[\"tap\",\"one_queue\",\"persist\"],\"user\":1000,\"group\":100},{\"ifname\":\"tun1\",\"flags\":[\"tun\",\"multi_queue\",\"vnet_hdr\",\"persist\"]},{\"ifname\":\"tap2\",\"flags\":[\"tap\",\"pi\",\"persist\",\"filter\"]}]\n", + "stderr": "" + } +} diff --git a/pkg/xtcpnl/xtcpnl_tunnel_parm.go b/pkg/xtcpnl/xtcpnl_tunnel_parm.go new file mode 100644 index 000000000..20da8cd7b --- /dev/null +++ b/pkg/xtcpnl/xtcpnl_tunnel_parm.go @@ -0,0 +1,434 @@ +package xtcpnl + +import ( + "encoding/binary" + "errors" + "fmt" + "net/netip" + "strings" + + "github.com/randomizedcoder/xtcp2/pkg/cint" +) + +// The tunnel ioctl structs (include/uapi/linux/if_tunnel.h, +// include/uapi/linux/ip6_tunnel.h): what SIOCGETTUNNEL, SIOCGETPRL and +// SIOCGET6RD return through ifr_data, as ip/iptunnel.c and ip/ip6tunnel.c +// at v7.2.0 read them; and the tun sysfs properties ip/iptuntap.c reads +// with lib/utils.c read_prop (docs/netlink/goip-tunnel.md). None of it is +// netlink: internal/tnlsys records it, and these decode the recording. + +// The C struct sizes on every Linux ABI: no member is wider than 4 bytes, +// and each struct's size is a multiple of 4. +const ( + IPTunnelParmSize = 52 // struct ip_tunnel_parm + IP6TnlParm2Size = 76 // struct ip6_tnl_parm2 + TunnelPRLSize = 16 // struct ip_tunnel_prl + Tunnel6RDSize = 24 // struct ip_tunnel_6rd + tnlNameSizeCst = 16 // IFNAMSIZ +) + +// Flag bits in the tunnel structs besides the GRE ones (GreFlag*, in +// xtcpnl_gre.go). The i_flags and o_flags words are big-endian on the wire +// and given here in host order, as the parsers return them. +const ( + // VtiIsVti is VTI_ISVTI, (__force __be16)0x0001: the raw be16 is 1, + // which reads as 0x0100 in host order. + VtiIsVti = 0x0100 + // SitIsatap is SIT_ISATAP, a host-order 1 the kernel stores straight + // into the be16 i_flags, so it too reads as 0x0100. + SitIsatap = 0x0100 + // PRLDefault is PRL_DEFAULT, a host-endian u16 in ip_tunnel_prl. + PRLDefault = 0x0001 +) + +// IP6_TNL_F_* (include/uapi/linux/ip6_tunnel.h), ip6_tnl_parm2.flags. +const ( + IP6TnlFIgnEncapLimit = 0x1 + IP6TnlFUseOrigTclass = 0x2 + IP6TnlFUseOrigFlowlabel = 0x4 + IP6TnlFMIP6Dev = 0x8 + IP6TnlFRcvDSCPCopy = 0x10 + IP6TnlFUseOrigFwmark = 0x20 + IP6TnlFAllowLocalRemote = 0x40 +) + +// ErrTunnelStructLen is a tunnel struct of the wrong length. +var ErrTunnelStructLen = errors.New("xtcpnl: tunnel ioctl struct has the wrong length") + +// TunnelName is a struct's name[IFNAMSIZ]. Name is the bytes before the +// first NUL. Terminated is false when all 16 bytes are non-NUL: C's "%s" +// would then read on into the next member, which the kernel never sends +// (it copies a NUL-terminated dev->name). +type TunnelName struct { + Name string + Terminated bool +} + +func parseTunnelName(b []byte) TunnelName { + if len(b) < tnlNameSizeCst { + return TunnelName{} + } + n := b[:tnlNameSizeCst] + if i := strings.IndexByte(string(n), 0); i >= 0 { + return TunnelName{Name: string(n[:i]), Terminated: true} + } + return TunnelName{Name: string(n)} +} + +// IPTunnelParm is struct ip_tunnel_parm. Multi-byte big-endian members are +// in host order; Saddr and Daddr are addresses. +type IPTunnelParm struct { + TunnelName + Link int32 // host-endian int + IFlags, OFlags uint16 + IKey, OKey uint32 + // The struct iphdr. + VersionIHL uint8 + TOS uint8 + TotLen uint16 + ID uint16 + FragOff uint16 + TTL uint8 + Protocol uint8 + Check uint16 + Saddr netip.Addr + Daddr netip.Addr +} + +// ParseIPTunnelParm decodes a SIOCGETTUNNEL answer for an ipip, gre, sit +// or vti device: exactly IPTunnelParmSize bytes. +func ParseIPTunnelParm(b []byte) (IPTunnelParm, error) { + if len(b) != IPTunnelParmSize { + return IPTunnelParm{}, fmt.Errorf("%w: ip_tunnel_parm is %d bytes, not %d", ErrTunnelStructLen, len(b), IPTunnelParmSize) + } + be := binary.BigEndian + return IPTunnelParm{ + TunnelName: parseTunnelName(b), + Link: cint.Int(binary.NativeEndian.Uint32(b[16:20])), + IFlags: be.Uint16(b[20:22]), + OFlags: be.Uint16(b[22:24]), + IKey: be.Uint32(b[24:28]), + OKey: be.Uint32(b[28:32]), + VersionIHL: b[32], + TOS: b[33], + TotLen: be.Uint16(b[34:36]), + ID: be.Uint16(b[36:38]), + FragOff: be.Uint16(b[38:40]), + TTL: b[40], + Protocol: b[41], + Check: be.Uint16(b[42:44]), + Saddr: netip.AddrFrom4([4]byte(b[44:48])), + Daddr: netip.AddrFrom4([4]byte(b[48:52])), + }, nil +} + +// IP6TnlParm2 is struct ip6_tnl_parm2: ip6tnl, ip6gre and vti6. FlowInfo +// and the GRE words are in host order; Flags is host-endian on the wire. +type IP6TnlParm2 struct { + TunnelName + Link int32 + Proto uint8 + EncapLimit uint8 + HopLimit uint8 + FlowInfo uint32 + Flags uint32 + Laddr, Raddr netip.Addr + IFlags, OFlags uint16 + IKey, OKey uint32 +} + +// ParseIP6TnlParm2 decodes a SIOCGETTUNNEL answer for an ip6 tunnel: +// exactly IP6TnlParm2Size bytes. The byte at 23 is padding. +func ParseIP6TnlParm2(b []byte) (IP6TnlParm2, error) { + if len(b) != IP6TnlParm2Size { + return IP6TnlParm2{}, fmt.Errorf("%w: ip6_tnl_parm2 is %d bytes, not %d", ErrTunnelStructLen, len(b), IP6TnlParm2Size) + } + be, ne := binary.BigEndian, binary.NativeEndian + return IP6TnlParm2{ + TunnelName: parseTunnelName(b), + Link: cint.Int(ne.Uint32(b[16:20])), + Proto: b[20], + EncapLimit: b[21], + HopLimit: b[22], + FlowInfo: be.Uint32(b[24:28]), + Flags: ne.Uint32(b[28:32]), + Laddr: netip.AddrFrom16([16]byte(b[32:48])), + Raddr: netip.AddrFrom16([16]byte(b[48:64])), + IFlags: be.Uint16(b[64:66]), + OFlags: be.Uint16(b[66:68]), + IKey: be.Uint32(b[68:72]), + OKey: be.Uint32(b[72:76]), + }, nil +} + +// appendTunnelName appends a struct's name[IFNAMSIZ] as strncpy writes it: +// at most 16 bytes, the rest zero. +func appendTunnelName(b []byte, name string) []byte { + n := []byte(name) + if len(n) > tnlNameSizeCst { + n = n[:tnlNameSizeCst] + } + b = append(b, n...) + return append(b, make([]byte, tnlNameSizeCst-len(n))...) +} + +// appendAddr appends an address of size bytes: a's bytes when it is that +// family, else zeros. +func appendAddr(b []byte, a netip.Addr, size int) []byte { + if a.IsValid() && a.BitLen() == size*8 { + return append(b, a.AsSlice()...) + } + return append(b, make([]byte, size)...) +} + +// Marshal is the struct ip_tunnel_parm ip passes a SIOCGETTUNNEL: exactly +// IPTunnelParmSize bytes, ParseIPTunnelParm's inverse for a terminated +// name of at most 15 bytes (a longer one is cut at 16, as strncpy cuts it). +func (p *IPTunnelParm) Marshal() []byte { + be := binary.BigEndian + b := make([]byte, 0, IPTunnelParmSize) + b = appendTunnelName(b, p.Name) + b = binary.NativeEndian.AppendUint32(b, cint.Bits(p.Link)) + b = be.AppendUint16(b, p.IFlags) + b = be.AppendUint16(b, p.OFlags) + b = be.AppendUint32(b, p.IKey) + b = be.AppendUint32(b, p.OKey) + b = append(b, p.VersionIHL, p.TOS) + b = be.AppendUint16(b, p.TotLen) + b = be.AppendUint16(b, p.ID) + b = be.AppendUint16(b, p.FragOff) + b = append(b, p.TTL, p.Protocol) + b = be.AppendUint16(b, p.Check) + b = appendAddr(b, p.Saddr, 4) + return appendAddr(b, p.Daddr, 4) +} + +// Marshal is the struct ip6_tnl_parm2 ip passes a SIOCGETTUNNEL: exactly +// IP6TnlParm2Size bytes with the padding byte zero, ParseIP6TnlParm2's +// inverse for a terminated name of at most 15 bytes. +func (p *IP6TnlParm2) Marshal() []byte { + be, ne := binary.BigEndian, binary.NativeEndian + b := make([]byte, 0, IP6TnlParm2Size) + b = appendTunnelName(b, p.Name) + b = ne.AppendUint32(b, cint.Bits(p.Link)) + b = append(b, p.Proto, p.EncapLimit, p.HopLimit, 0) + b = be.AppendUint32(b, p.FlowInfo) + b = ne.AppendUint32(b, p.Flags) + b = appendAddr(b, p.Laddr, 16) + b = appendAddr(b, p.Raddr, 16) + b = be.AppendUint16(b, p.IFlags) + b = be.AppendUint16(b, p.OFlags) + b = be.AppendUint32(b, p.IKey) + return be.AppendUint32(b, p.OKey) +} + +// TunnelPRLRequest is the buffer ip passes a SIOCGETPRL (iptunnel.c +// print_tunnel): n zeroed entries, the first a request header whose datalen +// (at offset 8) is the size of the other n-1. +func TunnelPRLRequest(n int) []byte { + if n < 1 { + return nil + } + v, ok := cint.U32((n - 1) * TunnelPRLSize) + if !ok { + return nil + } + b := make([]byte, 8, n*TunnelPRLSize) + b = binary.NativeEndian.AppendUint32(b, v) + return append(b, make([]byte, n*TunnelPRLSize-12)...) +} + +// TunnelPRL is one struct ip_tunnel_prl: a potential router of an isatap +// tunnel. The reserved members are not kept. +type TunnelPRL struct { + Addr netip.Addr + Flags uint16 // host-endian; PRLDefault + DataLen uint32 // host-endian; the request header's buffer size +} + +// ParseTunnelPRL decodes a SIOCGETPRL buffer: whole TunnelPRLSize entries, +// as many as there are. ip passes 16 and reads entries 1 to 15: entry 0 is +// its request header (iptunnel.c print_tunnel), which the kernel leaves. +func ParseTunnelPRL(b []byte) ([]TunnelPRL, error) { + if len(b)%TunnelPRLSize != 0 { + return nil, fmt.Errorf("%w: ip_tunnel_prl buffer of %d bytes is not whole %d-byte entries", ErrTunnelStructLen, len(b), TunnelPRLSize) + } + ne := binary.NativeEndian + out := make([]TunnelPRL, 0, len(b)/TunnelPRLSize) + for off := 0; off < len(b); off += TunnelPRLSize { + e := b[off : off+TunnelPRLSize] + out = append(out, TunnelPRL{ + Addr: netip.AddrFrom4([4]byte(e[0:4])), + Flags: ne.Uint16(e[4:6]), + DataLen: ne.Uint32(e[8:12]), + }) + } + return out, nil +} + +// Tunnel6RD is struct ip_tunnel_6rd: a sit tunnel's 6rd prefix and relay +// prefix, with their lengths (host-endian u16). +type Tunnel6RD struct { + Prefix netip.Addr + RelayPrefix netip.Addr + PrefixLen uint16 + RelayPrefixLen uint16 +} + +// ParseTunnel6RD decodes a SIOCGET6RD answer: exactly Tunnel6RDSize bytes. +func ParseTunnel6RD(b []byte) (Tunnel6RD, error) { + if len(b) != Tunnel6RDSize { + return Tunnel6RD{}, fmt.Errorf("%w: ip_tunnel_6rd is %d bytes, not %d", ErrTunnelStructLen, len(b), Tunnel6RDSize) + } + ne := binary.NativeEndian + return Tunnel6RD{ + Prefix: netip.AddrFrom16([16]byte(b[0:16])), + RelayPrefix: netip.AddrFrom4([4]byte(b[16:20])), + PrefixLen: ne.Uint16(b[20:22]), + RelayPrefixLen: ne.Uint16(b[22:24]), + }, nil +} + +// The tun device's sysfs flag bits (drivers/net/tun.c tun_flags_show, +// include/uapi/linux/if_tun.h): the IFF_* of TUNSETIFF, printed "0x%x". +const ( + TunIffTun = 0x0001 + TunIffTap = 0x0002 + TunIffNapi = 0x0010 + TunIffNapiFrags = 0x0020 + TunIffNoCarrier = 0x0040 + TunIffMultiQueue = 0x0100 + TunIffPersist = 0x0800 + TunIffNoPI = 0x1000 // also IFF_NOFILTER, the same bit + + TunIffOneQueue = 0x2000 + TunIffVnetHdr = 0x4000 + TunIffTunExcl = 0x8000 +) + +// readPropBufCst is read_prop's buf[80]: fgets keeps at most 79 bytes. +const readPropBufCst = 80 + +// ErrSysfsNotNumber is a sysfs value read_prop refuses ("is not a +// number", or an empty file: "is currently unknown"), and ErrSysfsRange one +// strtol saturates. +var ( + ErrSysfsNotNumber = errors.New("xtcpnl: sysfs value is not a number") + ErrSysfsRange = errors.New("xtcpnl: sysfs value out of range") +) + +// SysfsPropLine is the buf read_prop parses and quotes in its messages: +// fgets's first line of content (at most 79 bytes, and C's string stops at +// a NUL), its newline cut. ok is false for an empty file, where fgets +// returns NULL ("is currently unknown"). +func SysfsPropLine(content string) (line string, ok bool) { + if content == "" { + return "", false + } + line = content + if i := strings.IndexByte(line, '\n'); i >= 0 { + line = line[:i+1] + } + if len(line) > readPropBufCst-1 { + line = line[:readPropBufCst-1] + } + if i := strings.IndexByte(line, 0); i >= 0 { + line = line[:i] + } + return strings.TrimSuffix(line, "\n"), true +} + +// ParseSysfsLong is lib/utils.c read_prop's parse of a sysfs file's +// content, as ip tuntap reads tun_flags, owner and group: fgets's first +// line (at most 79 bytes; C stops at a NUL too), its newline cut, then +// strtol base 0 over the whole of it. strtol skips leading space, takes a +// sign, and reads 0x as hex and a leading 0 as octal. A value past a C +// long is ErrSysfsRange (read_prop checks errno, which strtol sets). +func ParseSysfsLong(content string) (int64, error) { + line, ok := SysfsPropLine(content) + if !ok || line == "" { + return 0, fmt.Errorf("%w: empty", ErrSysfsNotNumber) + } + v, rest, ok, overflow := strtolBase0(line) + if !ok || rest != "" { + return 0, fmt.Errorf("%w: %q", ErrSysfsNotNumber, line) + } + if overflow { + return 0, fmt.Errorf("%w: %q", ErrSysfsRange, line) + } + return v, nil +} + +// strtolBase0 is glibc strtol(s, &end, 0) for a 64-bit long: the value, +// what follows the digits, whether any digit was read (else end == s), and +// whether the value saturated. +func strtolBase0(s string) (v int64, rest string, ok, overflow bool) { + i := 0 + for i < len(s) && isCSpace(s[i]) { + i++ + } + neg := false + if i < len(s) && (s[i] == '+' || s[i] == '-') { + neg = s[i] == '-' + i++ + } + base := uint64(10) + switch { + case i+1 < len(s) && s[i] == '0' && (s[i+1] == 'x' || s[i+1] == 'X') && i+2 < len(s) && digitVal(s[i+2]) < 16: + base = 16 + i += 2 + case i < len(s) && s[i] == '0': + base = 8 + } + const limit = uint64(1) << 63 // |LONG_MIN|; LONG_MAX is one less + var mag uint64 + start := i + for i < len(s) { + d := uint64(digitVal(s[i])) + if d >= base { + break + } + if !overflow { + if mag > (limit-d)/base { + overflow = true + } else { + mag = mag*base + d + } + } + i++ + } + if i == start { + return 0, s, false, false + } + if !neg && mag == limit { + overflow = true + } + if overflow { + if neg { + return -1 << 63, s[i:], true, true + } + return 1<<63 - 1, s[i:], true, true + } + n, inRange := cint.Int64(mag) + if neg { + n, inRange = cint.NegInt64(mag) + } + return n, s[i:], true, !inRange +} + +func isCSpace(c byte) bool { + return c == ' ' || (c >= '\t' && c <= '\r') +} + +// digitVal is c's value as a digit in bases up to 36, or 36. +func digitVal(c byte) int { + switch { + case c >= '0' && c <= '9': + return int(c - '0') + case c >= 'a' && c <= 'z': + return int(c-'a') + 10 + case c >= 'A' && c <= 'Z': + return int(c-'A') + 10 + } + return 36 +} diff --git a/pkg/xtcpnl/xtcpnl_tunnel_parm_test.go b/pkg/xtcpnl/xtcpnl_tunnel_parm_test.go new file mode 100644 index 000000000..b9073707d --- /dev/null +++ b/pkg/xtcpnl/xtcpnl_tunnel_parm_test.go @@ -0,0 +1,638 @@ +package xtcpnl + +import ( + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "net/netip" + "os" + "path/filepath" + "slices" + "strings" + "testing" + + "golang.org/x/sys/unix" +) + +// The tunnel ioctl structs against the 8C corpus +// (testdata/7_3_1/ws/tunnel, each row's tnlsys.out sidecar; goip 8P). + +// tnlSidecarIoctl is one ioctl record of a tnlsys.out sidecar +// (internal/tnlsys IoctlRec), the fields these tests read. +type tnlSidecarIoctl struct { + Family int `json:"family"` + Req string `json:"req"` + Name string `json:"name"` + In string `json:"in"` + Out string `json:"out"` + Errno int `json:"errno"` +} + +func tnlSidecar(t testing.TB, dir string) []tnlSidecarIoctl { + t.Helper() + b, err := os.ReadFile(filepath.Join(dir, "tnlsys.out")) + if err != nil { + t.Fatal(err) + } + var s struct { + Ioctls []tnlSidecarIoctl `json:"ioctls"` + } + if err := json.Unmarshal(b, &s); err != nil { + t.Fatalf("%s: %v", dir, err) + } + return s.Ioctls +} + +func tnlHex(t testing.TB, s string) []byte { + t.Helper() + b, err := hex.DecodeString(s) + if err != nil { + t.Fatal(err) + } + return b +} + +// tnlCorpusOut is the output of the first successful req on name in a +// corpus row of the tunnel space. +func tnlCorpusOut(t testing.TB, row, req, name string) []byte { + t.Helper() + for _, r := range tnlSidecar(t, filepath.Join("testdata", "7_3_1", "ws", "tunnel", row)) { + if r.Req == req && r.Name == name && r.Errno == 0 { + return tnlHex(t, r.Out) + } + } + t.Fatalf("%s: no %s answer for %s", row, req, name) + return nil +} + +func tnlCorpusDirs(t testing.TB) []string { + t.Helper() + dirs, err := filepath.Glob(filepath.Join("testdata", "7_3_1", "ws", "tunnel", "*")) + if err != nil { + t.Fatal(err) + } + if len(dirs) == 0 { + t.Fatal("no ws/tunnel rows") + } + slices.Sort(dirs) + return dirs +} + +// TestParseTunnelParm decodes corpus answers and hand-made buffers. +// +// go test ./pkg/xtcpnl/ -run TestParseTunnelParm +func TestParseTunnelParm(t *testing.T) { + a4 := netip.MustParseAddr + // ec-003 is `ip tunnel show` over tnl4, ec-039 `-6 tunnel show` over + // tnl6, ec-038 `tunnel show isa16`. + tests := []struct { + description string + got func() (string, error) + expected string + }{ + {"positive: gre with key, seq and csum", func() (string, error) { + p, err := ParseIPTunnelParm(tnlCorpusOut(t, "ec-003", "SIOCGETTUNNEL", "gre1")) + return fmt.Sprintf("%s %#x %#x %d %d proto %d %s>%s ttl %d", p.Name, p.IFlags, p.OFlags, p.IKey, p.OKey, + p.Protocol, p.Saddr, p.Daddr, p.TTL), err + }, "gre1 0xb000 0xb000 5 5 proto 47 192.0.2.1>198.51.100.2 ttl 32"}, + {"positive: vti keys with VTI_ISVTI in i_flags", func() (string, error) { + p, err := ParseIPTunnelParm(tnlCorpusOut(t, "ec-003", "SIOCGETTUNNEL", "vti1")) + return fmt.Sprintf("%#x %#x %d %d isvti %t", p.IFlags, p.OFlags, p.IKey, p.OKey, p.IFlags&VtiIsVti != 0), err + }, "0x2100 0x2000 7 8 isvti true"}, + {"positive: isatap made by ip tunnel add: proto 41 and SIT_ISATAP", func() (string, error) { + p, err := ParseIPTunnelParm(tnlCorpusOut(t, "ec-003", "SIOCGETTUNNEL", "isa1")) + return fmt.Sprintf("proto %d isatap %t", p.Protocol, p.IFlags&SitIsatap != 0), err + }, "proto 41 isatap true"}, + {"positive: isatap PRL, header then two routers", func() (string, error) { + prl, err := ParseTunnelPRL(tnlCorpusOut(t, "ec-003", "SIOCGETPRL", "isa1")) + var s []string + for _, e := range prl { + if e.Addr != a4("0.0.0.0") { + s = append(s, fmt.Sprintf("%s/%d", e.Addr, e.Flags)) + } + } + return fmt.Sprintf("%d entries, header datalen %d: %s", len(prl), prl[0].DataLen, strings.Join(s, " ")), err + }, "16 entries, header datalen 32: 192.0.2.11/0 192.0.2.10/1"}, + {"positive: ip6tnl: encaplimit none is IGN_ENCAP_LIMIT (limit stays 4), the kernel CAP bits in flags", func() (string, error) { + p, err := ParseIP6TnlParm2(tnlCorpusOut(t, "ec-039", "SIOCGETTUNNEL", "ip6t1")) + return fmt.Sprintf("%s proto %d encap %d hop %d flowinfo %#x flags %#x %s>%s", p.Name, p.Proto, p.EncapLimit, + p.HopLimit, p.FlowInfo, p.Flags, p.Laddr, p.Raddr), err + }, "ip6t1 proto 41 encap 4 hop 1 flowinfo 0x12345 flags 0x30043 2001:db8::1>2001:db8::2"}, + {"positive: ip6gre keys", func() (string, error) { + p, err := ParseIP6TnlParm2(tnlCorpusOut(t, "ec-039", "SIOCGETTUNNEL", "ip6g1")) + return fmt.Sprintf("%#x %#x %d %d proto %d", p.IFlags, p.OFlags, p.IKey, p.OKey, p.Proto), err + }, "0xb000 0xb000 9 9 proto 47"}, + {"positive: a 6rd struct", func() (string, error) { + b := make([]byte, Tunnel6RDSize) + copy(b, netip.MustParseAddr("2001:db8::").AsSlice()) + copy(b[16:], []byte{192, 0, 2, 0}) + b[20], b[22] = 32, 24 // host-endian u16s on a little-endian host + r, err := ParseTunnel6RD(b) + return fmt.Sprintf("%s/%d %s/%d", r.Prefix, r.PrefixLen, r.RelayPrefix, r.RelayPrefixLen), err + }, "2001:db8::/32 192.0.2.0/24"}, + {"negative: ip_tunnel_parm one byte short", func() (string, error) { + _, err := ParseIPTunnelParm(make([]byte, IPTunnelParmSize-1)) + return "", err + }, "error"}, + {"negative: ip6_tnl_parm2 given an ip_tunnel_parm", func() (string, error) { + _, err := ParseIP6TnlParm2(make([]byte, IPTunnelParmSize)) + return "", err + }, "error"}, + {"negative: a PRL buffer of a partial entry", func() (string, error) { + _, err := ParseTunnelPRL(make([]byte, TunnelPRLSize+1)) + return "", err + }, "error"}, + {"negative: a 6rd struct one byte long", func() (string, error) { + _, err := ParseTunnel6RD(make([]byte, Tunnel6RDSize+1)) + return "", err + }, "error"}, + {"boundary: all-zero parm: no name, any/any, ttl 0 (inherit)", func() (string, error) { + p, err := ParseIPTunnelParm(make([]byte, IPTunnelParmSize)) + return fmt.Sprintf("%q %t proto %d %s %s ttl %d", p.Name, p.Terminated, p.Protocol, p.Saddr, p.Daddr, p.TTL), err + }, `"" true proto 0 0.0.0.0 0.0.0.0 ttl 0`}, + {"boundary: a name of all 16 bytes has no NUL", func() (string, error) { + b := make([]byte, IPTunnelParmSize) + copy(b, "abcdefghijklmnop") + p, err := ParseIPTunnelParm(b) + return fmt.Sprintf("%q %t", p.Name, p.Terminated), err + }, `"abcdefghijklmnop" false`}, + {"boundary: an empty PRL buffer", func() (string, error) { + prl, err := ParseTunnelPRL(nil) + return fmt.Sprint(len(prl)), err + }, "0"}, + {"corner: 16 routers in a 16-entry buffer: the header and 15 (T8)", func() (string, error) { + prl, err := ParseTunnelPRL(tnlCorpusOut(t, "ec-038", "SIOCGETPRL", "isa16")) + n := 0 + for _, e := range prl[1:] { + if e.Addr.IsValid() && e.Addr != a4("0.0.0.0") { + n++ + } + } + return fmt.Sprintf("%d entries, %d routers, first %s last %s", len(prl), n, prl[1].Addr, prl[15].Addr), err + }, "16 entries, 15 routers, first 192.0.2.25 last 192.0.2.11"}, + {"corner: ip6gre's 76 bytes through the v4 path decode as garbage (T19)", func() (string, error) { + p, err := ParseIPTunnelParm(tnlCorpusOut(t, "ec-065", "SIOCGETTUNNEL", "gre6x")) + return fmt.Sprintf("%s proto %d %s>%s", p.Name, p.Protocol, p.Saddr, p.Daddr), err + }, "gre6x proto 0 0.0.0.1>32.1.13.184"}, + {"corner: a negative link", func() (string, error) { + b := make([]byte, IPTunnelParmSize) + copy(b[16:20], []byte{0xff, 0xff, 0xff, 0xff}) + p, err := ParseIPTunnelParm(b) + return fmt.Sprint(p.Link), err + }, "-1"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + got, err := tc.got() + if tc.expected == "error" { + if !errors.Is(err, ErrTunnelStructLen) { + t.Errorf("err %v, want ErrTunnelStructLen", err) + } + return + } + if err != nil { + t.Fatal(err) + } + if got != tc.expected { + t.Errorf("got %q, want %q", got, tc.expected) + } + }) + } +} + +// TestParseSysfsLong pins read_prop's parse: fgets, the newline cut, then +// strtol base 0 over the whole line. +// +// go test ./pkg/xtcpnl/ -run TestParseSysfsLong +func TestParseSysfsLong(t *testing.T) { + tests := []struct { + description string + content string + expected string // value, or the error + }{ + {"positive: tun_flags in hex", "0x1002\n", "4098"}, + {"positive: owner -1", "-1\n", "-1"}, + {"positive: group 100", "100\n", "100"}, + {"positive: no newline", "7", "7"}, + {"negative: empty", "", "not a number"}, + {"negative: a newline only", "\n", "not a number"}, + {"negative: a word", "abc\n", "not a number"}, + {"negative: trailing space", "5 \n", "not a number"}, + {"negative: 0x with no digits", "0x\n", "not a number"}, + {"negative: 08 is a bad octal", "08\n", "not a number"}, + {"boundary: LONG_MAX", "9223372036854775807\n", "9223372036854775807"}, + {"boundary: LONG_MIN", "-9223372036854775808\n", "-9223372036854775808"}, + {"boundary: LONG_MAX + 1 saturates", "9223372036854775808\n", "out of range"}, + {"boundary: LONG_MIN - 1 saturates", "-9223372036854775809\n", "out of range"}, + {"corner: octal", "010\n", "8"}, + {"corner: leading space and a sign", " \t+0X1f\n", "31"}, + {"corner: only the first line", "3\n4\n", "3"}, + {"corner: a NUL ends the string", "12\x0034\n", "12"}, + {"corner: fgets keeps 79 bytes", strings.Repeat("0", 79) + "x\n", "0"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + v, err := ParseSysfsLong(tc.content) + got := fmt.Sprint(v) + switch { + case errors.Is(err, ErrSysfsNotNumber): + got = "not a number" + case errors.Is(err, ErrSysfsRange): + got = "out of range" + case err != nil: + t.Fatal(err) + } + if got != tc.expected { + t.Errorf("ParseSysfsLong(%q) = %s, want %s", tc.content, got, tc.expected) + } + }) + } +} + +// tnlLinks is every RTM_NEWLINK reply in a row's ip.pcap, by name. +func tnlLinks(t *testing.T, dir string) map[string]LinkInfo { + t.Helper() + links := map[string]LinkInfo{} + for _, m := range pcapNlMsgs(t, filepath.Join(dir, "ip.pcap")) { + if m.h.Flags&unix.NLM_F_REQUEST != 0 || m.h.Type != unix.RTM_NEWLINK { + continue + } + li, err := ParseNewLink(m.body) + if err != nil { + t.Fatalf("%s: %v", dir, err) + } + links[li.Name] = li + } + return links +} + +// tnlAgree compares a SIOCGETTUNNEL answer with the same tunnel's +// IFLA_INFO_DATA: the fields both carry. ok is false for a kind with no +// ioctl struct of that size (the T19 case: an ip6gre asked through the v4 +// path). +func tnlAgree(li LinkInfo, out []byte) (diffs []string, ok bool, err error) { + d := func(field string, a, b any) { + if a != b { + diffs = append(diffs, fmt.Sprintf("%s: ioctl %v, netlink %v", field, a, b)) + } + } + switch len(out) { + case IPTunnelParmSize: + p, err := ParseIPTunnelParm(out) + if err != nil { + return nil, false, err + } + switch { + case li.Iptun != nil && li.Kind != ip6tnlKindCst: + n := li.Iptun + d("saddr", p.Saddr, n.Local) + d("daddr", p.Daddr, n.Remote) + d("ttl", p.TTL, n.TTL) + d("tos", p.TOS, n.TOS) + d("protocol", p.Protocol, n.Proto) + d("isatap", p.IFlags&SitIsatap != 0, n.Flags&IptunFlagSitIsatap != 0) + case li.Gre != nil && li.Kind == greKindCst: + n := li.Gre + d("saddr", p.Saddr, n.Local) + d("daddr", p.Daddr, n.Remote) + d("ttl", p.TTL, n.TTL) + d("tos", p.TOS, n.TOS) + d("i_flags", p.IFlags, n.IFlags) + d("o_flags", p.OFlags, n.OFlags) + d("i_key", p.IKey, n.IKey) + d("o_key", p.OKey, n.OKey) + case li.Vti != nil && li.Kind == vtiKindCst: + n := li.Vti + d("saddr", p.Saddr, n.Local) + d("daddr", p.Daddr, n.Remote) + d("i_key", p.IKey, n.IKey) + d("o_key", p.OKey, n.OKey) + default: + return nil, false, nil + } + case IP6TnlParm2Size: + p, err := ParseIP6TnlParm2(out) + if err != nil { + return nil, false, err + } + switch { + case li.Iptun != nil && li.Kind == ip6tnlKindCst: + n := li.Iptun + d("laddr", p.Laddr, n.Local) + d("raddr", p.Raddr, n.Remote) + d("hop_limit", p.HopLimit, n.TTL) + d("encap_limit", p.EncapLimit, n.EncapLimit) + d("flowinfo", p.FlowInfo, n.FlowInfo) + d("flags", p.Flags, n.Flags) + d("proto", p.Proto, n.Proto) + case li.Gre != nil && li.Kind == ip6greKindCst: + n := li.Gre + d("laddr", p.Laddr, n.Local) + d("raddr", p.Raddr, n.Remote) + d("hop_limit", p.HopLimit, n.TTL) + d("encap_limit", p.EncapLimit, n.EncapLimit) + d("flowinfo", p.FlowInfo, n.FlowInfo) + d("i_flags", p.IFlags, n.IFlags) + d("o_flags", p.OFlags, n.OFlags) + d("i_key", p.IKey, n.IKey) + d("o_key", p.OKey, n.OKey) + case li.Vti != nil && li.Kind == vti6KindCst: + n := li.Vti + d("laddr", p.Laddr, n.Local) + d("raddr", p.Raddr, n.Remote) + d("i_key", p.IKey, n.IKey) + d("o_key", p.OKey, n.OKey) + default: + return nil, false, nil + } + default: + return nil, false, nil + } + return diffs, true, nil +} + +// TestWsTunnelParmAgreesWithLinkDump is the O-check: every SIOCGETTUNNEL +// answer in the corpus decodes, and where the same row's link dump holds +// the tunnel it names, the two agree on every field both carry. +// +// go test ./pkg/xtcpnl/ -run TestWsTunnelParmAgreesWithLinkDump +func TestWsTunnelParmAgreesWithLinkDump(t *testing.T) { + compared, decoded, prl, sixrd := 0, 0, 0, 0 + kinds := map[string]bool{} + for _, dir := range tnlCorpusDirs(t) { + links := tnlLinks(t, dir) + for _, r := range tnlSidecar(t, dir) { + if r.Errno != 0 { + continue + } + out := tnlHex(t, r.Out) + switch r.Req { + case "SIOCGETPRL": + if _, err := ParseTunnelPRL(out); err != nil { + t.Errorf("%s %s: %v", dir, r.Name, err) + } + prl++ + continue + case "SIOCGET6RD": + if _, err := ParseTunnel6RD(out); err != nil { + t.Errorf("%s %s: %v", dir, r.Name, err) + } + sixrd++ + continue + } + var name TunnelName + switch len(out) { + case IPTunnelParmSize: + p, err := ParseIPTunnelParm(out) + if err != nil { + t.Fatalf("%s %s: %v", dir, r.Name, err) + } + name = p.TunnelName + case IP6TnlParm2Size: + p, err := ParseIP6TnlParm2(out) + if err != nil { + t.Fatalf("%s %s: %v", dir, r.Name, err) + } + name = p.TunnelName + default: + t.Fatalf("%s %s: a %d-byte answer", dir, r.Name, len(out)) + } + decoded++ + if !name.Terminated { + t.Errorf("%s %s: the kernel's name has no NUL", dir, r.Name) + } + li, ok := links[name.Name] + if !ok { + continue + } + diffs, ok, err := tnlAgree(li, out) + if err != nil { + t.Fatal(err) + } + if !ok { + continue + } + compared++ + kinds[li.Kind] = true + for _, x := range diffs { + t.Errorf("%s: %s (%s): %s", dir, name.Name, li.Kind, x) + } + } + } + t.Logf("%d answers decoded, %d compared with the link dump; %d PRL, %d 6rd", decoded, compared, prl, sixrd) + for _, k := range []string{ipipKindCst, sitKindCst, greKindCst, vtiKindCst, ip6tnlKindCst, ip6greKindCst, vti6KindCst} { + if !kinds[k] { + t.Errorf("no %s answer compared", k) + } + } +} + +// FuzzParseIPTunnelParm: any input decodes or is refused for its length, +// and a decoded name is at most IFNAMSIZ bytes. +func FuzzParseIPTunnelParm(f *testing.F) { + for _, dir := range tnlCorpusDirs(f) { + for _, r := range tnlSidecar(f, dir) { + if r.Errno == 0 && r.Req == "SIOCGETTUNNEL" { + f.Add(tnlHex(f, r.Out)) + } + } + } + f.Fuzz(func(t *testing.T, b []byte) { + p, err := ParseIPTunnelParm(b) + if (err == nil) != (len(b) == IPTunnelParmSize) { + t.Fatalf("len %d: err %v", len(b), err) + } + if len(p.Name) > tnlNameSizeCst || p.Terminated && strings.IndexByte(p.Name, 0) >= 0 { + t.Fatalf("name %q", p.Name) + } + }) +} + +// FuzzParseIP6TnlParm2: as FuzzParseIPTunnelParm, for the v6 struct. +func FuzzParseIP6TnlParm2(f *testing.F) { + for _, dir := range tnlCorpusDirs(f) { + for _, r := range tnlSidecar(f, dir) { + if r.Errno == 0 && r.Req == "SIOCGETTUNNEL" && r.Family == unix.AF_INET6 { + f.Add(tnlHex(f, r.Out)) + } + } + } + f.Fuzz(func(t *testing.T, b []byte) { + p, err := ParseIP6TnlParm2(b) + if (err == nil) != (len(b) == IP6TnlParm2Size) { + t.Fatalf("len %d: err %v", len(b), err) + } + if err == nil && (!p.Laddr.Is6() || !p.Raddr.Is6()) { + t.Fatalf("addresses %v %v", p.Laddr, p.Raddr) + } + }) +} + +// FuzzParseSysfsLong: whatever the content, a value or one of the two +// errors, and the value of a plain decimal round-trips. +func FuzzParseSysfsLong(f *testing.F) { + for _, s := range []string{"0x1002\n", "-1\n", "100\n", "", "0x", "010", " +7\n", "9223372036854775808"} { + f.Add(s) + } + f.Fuzz(func(t *testing.T, s string) { + v, err := ParseSysfsLong(s) + if err != nil && !errors.Is(err, ErrSysfsNotNumber) && !errors.Is(err, ErrSysfsRange) { + t.Fatalf("%q: %v", s, err) + } + if err == nil && s == fmt.Sprint(v) && v != 0 && s[0] == '0' { + t.Fatalf("%q read as decimal %d", s, v) + } + }) +} + +func BenchmarkParseIPTunnelParm(b *testing.B) { + buf := tnlCorpusOut(b, "ec-003", "SIOCGETTUNNEL", "gre1") + b.ReportAllocs() + for b.Loop() { + if _, err := ParseIPTunnelParm(buf); err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkParseIP6TnlParm2(b *testing.B) { + buf := tnlCorpusOut(b, "ec-039", "SIOCGETTUNNEL", "ip6t1") + b.ReportAllocs() + for b.Loop() { + if _, err := ParseIP6TnlParm2(buf); err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkParseTunnelPRL(b *testing.B) { + buf := tnlCorpusOut(b, "ec-038", "SIOCGETPRL", "isa16") + b.ReportAllocs() + for b.Loop() { + if _, err := ParseTunnelPRL(buf); err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkParseSysfsLong(b *testing.B) { + b.ReportAllocs() + for b.Loop() { + if _, err := ParseSysfsLong("0x5101\n"); err != nil { + b.Fatal(err) + } + } +} + +// TestTunnelParmMarshal builds the ioctl inputs goip passes: every input +// `ip` passed in the corpus rebuilds from its parse, and hand-made structs +// land at the C offsets. +// +// go test ./pkg/xtcpnl/ -run TestTunnelParmMarshal +func TestTunnelParmMarshal(t *testing.T) { + inputs := map[string][][]byte{} + for _, dir := range tnlCorpusDirs(t) { + for _, r := range tnlSidecar(t, dir) { + k := fmt.Sprintf("%s/%d", r.Req, r.Family) + inputs[k] = append(inputs[k], tnlHex(t, r.In)) + } + } + roundTrip := func(k string, parse func([]byte) ([]byte, error)) (string, error) { + n := 0 + for _, in := range inputs[k] { + out, err := parse(in) + if err != nil { + return "", err + } + if !slices.Equal(out, in) { + return "", fmt.Errorf("%x rebuilt as %x", in, out) + } + n++ + } + return fmt.Sprintf("%t", n > 0), nil + } + tests := []struct { + description string + got func() (string, error) + expected string + }{ + {"positive: every v4 SIOCGETTUNNEL input in the corpus rebuilds", func() (string, error) { + return roundTrip("SIOCGETTUNNEL/2", func(b []byte) ([]byte, error) { + p, err := ParseIPTunnelParm(b) + return p.Marshal(), err + }) + }, "true"}, + {"positive: every v6 SIOCGETTUNNEL input in the corpus rebuilds", func() (string, error) { + return roundTrip("SIOCGETTUNNEL/10", func(b []byte) ([]byte, error) { + p, err := ParseIP6TnlParm2(b) + return p.Marshal(), err + }) + }, "true"}, + {"positive: every SIOCGETPRL input is the 16-entry request", func() (string, error) { + return roundTrip("SIOCGETPRL/2", func([]byte) ([]byte, error) { return TunnelPRLRequest(16), nil }) + }, "true"}, + {"positive: v4 fields at the C offsets", func() (string, error) { + p := IPTunnelParm{TunnelName: TunnelName{Name: "gre1"}, Link: 3, IFlags: GreFlagKey, OFlags: GreFlagSeq, + IKey: 5, OKey: 6, VersionIHL: 0x45, TOS: 0x10, FragOff: 0x4000, TTL: 64, Protocol: 47, + Saddr: netip.MustParseAddr("192.0.2.1"), Daddr: netip.MustParseAddr("198.51.100.2")} + b := p.Marshal() + return fmt.Sprintf("%d %x %x %x %x %x", len(b), b[:4], b[20:32], b[32:34], b[38:42], b[44:52]), nil + }, "52 67726531 200010000000000500000006 4510 4000402f c0000201c6336402"}, + {"negative: a v4 address in an ip6 struct is left zero", func() (string, error) { + p := IP6TnlParm2{Laddr: netip.MustParseAddr("192.0.2.1")} + return fmt.Sprintf("%x", p.Marshal()[32:48]), nil + }, "00000000000000000000000000000000"}, + {"boundary: the zero struct is all zero bytes", func() (string, error) { + var p IPTunnelParm + var q IP6TnlParm2 + return fmt.Sprintf("%t %t", slices.Equal(p.Marshal(), make([]byte, IPTunnelParmSize)), + slices.Equal(q.Marshal(), make([]byte, IP6TnlParm2Size))), nil + }, "true true"}, + {"boundary: a PRL request of one entry has datalen 0; none is nil", func() (string, error) { + return fmt.Sprintf("%x %t", TunnelPRLRequest(1), TunnelPRLRequest(0) == nil), nil + }, "00000000000000000000000000000000 true"}, + {"corner: a 16-byte name fills name[] with no NUL, as strncpy does", func() (string, error) { + p := IP6TnlParm2{TunnelName: TunnelName{Name: "abcdefghijklmnopq"}, Link: -1} + b := p.Marshal() + return fmt.Sprintf("%s %x", b[:16], b[16:20]), nil + }, "abcdefghijklmnop ffffffff"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + got, err := tc.got() + if err != nil { + t.Fatal(err) + } + if got != tc.expected { + t.Errorf("got %q, want %q", got, tc.expected) + } + }) + } +} + +// TestSysfsPropLine is the buf read_prop quotes in its messages. +// +// go test ./pkg/xtcpnl/ -run TestSysfsPropLine +func TestSysfsPropLine(t *testing.T) { + tests := []struct { + description string + in string + expected string // line|ok + }{ + {"positive: a value and its newline", "0x1002\n", "0x1002|true"}, + {"negative: an empty file is fgets' NULL", "", "|false"}, + {"boundary: 79 bytes kept", strings.Repeat("7", 90), strings.Repeat("7", 79) + "|true"}, + {"boundary: a bare newline is an empty line", "\n", "|true"}, + {"corner: only the first line", "1\n2\n", "1|true"}, + {"corner: a NUL ends the string", "1\x002\n", "1|true"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + line, ok := SysfsPropLine(tc.in) + if got := fmt.Sprintf("%s|%t", line, ok); got != tc.expected { + t.Errorf("SysfsPropLine(%q) = %q, want %q", tc.in, got, tc.expected) + } + }) + } +} diff --git a/tools/nlcapgen/main.go b/tools/nlcapgen/main.go index 6ded93a24..e49547be8 100644 --- a/tools/nlcapgen/main.go +++ b/tools/nlcapgen/main.go @@ -148,6 +148,8 @@ var families = map[string]func() []*space{ "bridgex": func() []*space { return []*space{bridgexSpace()} }, "bridgefdb": func() []*space { return []*space{bridgefdbSpace()} }, "bridgemdb": func() []*space { return []*space{bridgemdbSpace()} }, + "tunnel": func() []*space { return []*space{tunnelSpace()} }, + "tuntap": func() []*space { return []*space{tuntapSpace()} }, } // namedFamilies are families of named rows, written out as they are @@ -161,7 +163,7 @@ var namedFamilies = map[string]func() []row{ func runMatrix(args []string, stdout, stderr io.Writer) int { fs := flag.NewFlagSet("matrix", flag.ContinueOnError) fs.SetOutput(stderr) - family := fs.String("family", "", "the family to generate: route, rule, nexthop, addr, neigh, link, linkattr, routeget, fdb, mdb, ss, mpls, ethtool, devlink, vdpa, fou, mptcp, tipc, bridge, bridgex, bridgefdb, bridgemdb, kwlive, lwt, lwtx, lwtenc, nhstats, v730, v730ip720, stats") + family := fs.String("family", "", "the family to generate: route, rule, nexthop, addr, neigh, link, linkattr, routeget, fdb, mdb, ss, mpls, ethtool, devlink, vdpa, fou, mptcp, tipc, bridge, bridgex, bridgefdb, bridgemdb, tunnel, tuntap, kwlive, lwt, lwtx, lwtenc, nhstats, v730, v730ip720, stats") seed := fs.Uint64("seed", 1, "the random rows' seed, recorded in their ids") random := fs.Int("random", 0, "random rows per space") out := fs.String("out", "", "rows file to write") @@ -173,7 +175,7 @@ func runMatrix(args []string, stdout, stderr io.Writer) int { ok = true } if !ok || *out == "" || *random < 0 { - fmt.Fprintln(stderr, "nlcapgen matrix: -family (route, rule, nexthop, addr, neigh, link, linkattr, routeget, fdb, mdb, ss, mpls, ethtool, devlink, vdpa, fou, mptcp, tipc, bridge, bridgex, bridgefdb, bridgemdb, kwlive, lwt, lwtx, lwtenc, nhstats, v730, v730ip720, stats) and -out are required, -random must be >= 0") + fmt.Fprintln(stderr, "nlcapgen matrix: -family (route, rule, nexthop, addr, neigh, link, linkattr, routeget, fdb, mdb, ss, mpls, ethtool, devlink, vdpa, fou, mptcp, tipc, bridge, bridgex, bridgefdb, bridgemdb, tunnel, tuntap, kwlive, lwt, lwtx, lwtenc, nhstats, v730, v730ip720, stats) and -out are required, -random must be >= 0") return 2 } var rows []row diff --git a/tools/nlcapgen/matrix_tunnel.go b/tools/nlcapgen/matrix_tunnel.go new file mode 100644 index 000000000..977c5603f --- /dev/null +++ b/tools/nlcapgen/matrix_tunnel.go @@ -0,0 +1,270 @@ +package main + +import "strings" + +// The tunnel read space (goip increment 8, 8C): `ip tunnel show` and +// `ip -6 tunnel show` (ip/iptunnel.c, ip/ip6tunnel.c, ip/tunnel.c), each +// plain and -j, over fixed fixtures of every tunnel kind the two list. +// +// ip dumps the links, then asks each tunnel of the family's ARPHRDs for its +// parameters with SIOCGETTUNNEL (and SIOCGETPRL, SIOCGET6RD). nlmon sees +// only the dump, so every row carries the `tnlsys` readback: tnlsnap runs +// the same `ip` under ptrace and records each ioctl's input and output +// (internal/tnlsys), which goip's replay reads through GOIP_TNLSYS. +// +// The rows pin the plan's leads (docs/netlink/goip-tunnel.md; T1-T21 in +// upstream/iproute2-tunnel-tuntap.md once 8B writes it): -s text inside +// -j (T1); a mode or a gre/ipip/sit/vti name skipping the list for the +// fallback device, whose answer depends on the parameters passed (T5); +// keys refused without a mode (T6); the printers' text/JSON differences +// (T7); the 16-entry PRL buffer (T8); the v6 named path's missing newline +// and -s sending it to the list (T9); `mode any` switching to v6, and +// staying switched for the next batch line (T10, T21); "invalid TTL\n" +// (T11); the v6 proto match (T12); a v4 show naming an ip6gre device, which +// the kernel answers with 76 bytes into 52 (T19); and v6 encaplimit's +// unchecked get_u8 (T20). +// +// Determinism: fixed names, addresses and MACs; the tunnels stay down, so +// -s counters stay 0. Writes appear only as refusals ip makes before any +// ioctl. + +// tunnelModules are every kind the fixtures make, so each row's namespace +// has all fallback devices: tunl0, gre0 (and gretap0, erspan0), sit0, +// ip_vti0, ip6tnl0, ip6gre0 and ip6_vti0. +var tunnelModules = []string{"ipip", "ip_gre", "sit", "ip_vti", "ip6_tunnel", "ip6_gre", "ip6_vti"} + +// tnlD0 is the underlay: dummy d0 with a v4 and a v6 address. +const tnlD0 = "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none" + + " && ip link set d0 up && ip addr add 192.0.2.1/24 dev d0 && ip addr add 2001:db8::1/64 dev d0 nodad" + +// tnl4Fix is one of each v4 kind: ipip1 (ttl, tos, dev), ipip2 (remote, +// local any, nopmtudisc, ttl and tos inherit; not remote any too, which +// would be tunl0's parameters, EEXIST), gre1 (key, seq, csum), gre2 +// (ikey/okey differ), gre3 (a multicast remote), vti1, and sit1. Those are +// made over netlink, and the kernel then reports their iph.protocol as 0, +// "any/ip" (K2). isa1 and sit2 are made with `ip tunnel add`, as their own +// mode, so isa1's routers print: print_tunnel reads the PRL only for +// protocol IPPROTO_IPV6 with SIT_ISATAP. isan is an isatap made over +// netlink, whose routers do not print. No 6rd: the workbench kernel has no +// CONFIG_IPV6_SIT_6RD, so SIOCADD6RD is EINVAL and SIOCGET6RD's EINVAL is +// the one error ip skips silently (K1); 6rd printing is a unit row. +var tnl4Fix = []string{ + tnlD0, + "ip link add ipip1 type ipip remote 198.51.100.1 local 192.0.2.1 ttl 64 tos 0x10 dev d0", + "ip link add ipip2 type ipip remote 198.51.100.9 nopmtudisc tos inherit", + "ip link add gre1 type gre remote 198.51.100.2 local 192.0.2.1 key 5 seq csum ttl 32", + "ip link add gre2 type gre remote 198.51.100.3 local 192.0.2.1 ikey 1 okey 2 iseq ocsum", + "ip link add gre3 type gre remote 239.1.1.1 local 192.0.2.1 ttl 1", + "ip link add sit1 type sit remote 198.51.100.4 local 192.0.2.1 ttl 64", + "ip tunnel add sit2 mode sit remote 198.51.100.8 local 192.0.2.1 ttl 16", + "ip tunnel add isa1 mode isatap local 192.0.2.1", + "ip tunnel prl dev isa1 prl-default 192.0.2.10 && ip tunnel prl dev isa1 prl-nodefault 192.0.2.11", + "ip link add isan type sit local 192.0.2.2 isatap && ip tunnel prl dev isan prl-default 192.0.2.12", + "ip link add vti1 type vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", +} + +// tnlPrl16Fix is isa16 with sixteen routers: ip reads them into a +// 16-entry buffer whose first entry is the header, so 15 fit (T8). +var tnlPrl16Fix = []string{ + tnlD0, + "ip tunnel add isa16 mode isatap local 192.0.2.1", + "i=10; while [ $i -lt 26 ]; do ip tunnel prl dev isa16 prl-nodefault 192.0.2.$i || exit 1; i=$((i+1)); done", +} + +// tnl6Fix is one of each v6 kind: ip6t1 (ip6ip6, encaplimit none, +// hoplimit 1, tclass inherit, a flowlabel, allow-localremote, dev), +// ip6t2 (ipip6, tclass 0x20, flowlabel inherit, dscp inherit), ip6g1 +// (ip6gre with key, seq, csum), vti61, and gre6x, an ip6gre whose name +// starts with gre, which a v4 show asks by name (T19). +var tnl6Fix = []string{ + tnlD0, + "ip link add ip6t1 type ip6tnl mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none" + + " hoplimit 1 tclass inherit flowlabel 0x12345 allow-localremote dev d0", + "ip link add ip6t2 type ip6tnl mode ipip6 remote 2001:db8::3 local 2001:db8::1 encaplimit 2" + + " hoplimit 64 tclass 0x20 flowlabel inherit dscp inherit", + "ip link add ip6g1 type ip6gre remote 2001:db8::4 local 2001:db8::1 key 9 seq csum", + "ip link add vti61 type vti6 remote 2001:db8::5 local 2001:db8::1 ikey 3 okey 4", + "ip link add gre6x type ip6gre remote 2001:db8::6 local 2001:db8::1", +} + +// tnlExtFix is the kinds the lists skip or barely know: an external +// (collect_md) ipip, and the Ethernet gretap, erspan and ip6gretap, +// whose ARPHRD_ETHER neither list takes. +var tnlExtFix = []string{ + tnlD0, + "ip link add ipipx type ipip external", + "ip link add gtap1 type gretap remote 198.51.100.6 local 192.0.2.1 key 11", + "ip link add ersp1 type erspan remote 198.51.100.7 local 192.0.2.1 seq key 12 erspan_ver 1 erspan 5", + "ip link add g6tap1 type ip6gretap remote 2001:db8::7 local 2001:db8::1", +} + +// tunnelSpace: ip tunnel show and ip -6 tunnel show, each plain and -j. +func tunnelSpace() *space { + // exit(-1) is 255; a returned -1 is 1, since do_cmd returns + // -(func()): an ioctl failure, nodev, refused keys, a refused add. + tool := expect{RC: intp(255), RefusedBy: refIproute2} + ret := expect{RC: intp(1), RefusedBy: refIproute2} + sp := &space{ + Name: "tunnel", + Axes: []axis{ + {Name: "opt", Values: []value{ + v("plain", "", f("json", "0")), + v("json", "-j", f("json", "1")), + }}, + {Name: "cmd", Values: []value{ + // No tunnels but the fallback devices. + bc(brBoundary, "bare", "tunnel show", nil), + bc(brBoundary, "bare", "-6 tunnel show", nil), + // v4: the list. + bc(brPos, "tnl4", "tunnel show", tnl4Fix), + bc(brCorner, "tnl4", "tunnel", tnl4Fix), // no verb: show + bc(brPos, "tnl4", "tunnel list", tnl4Fix), + bc(brPos, "tnl4", "tunnel lst", tnl4Fix), + bc(brCorner, "tnl4", "tunnel sh", tnl4Fix), // matches(): a prefix + bc(brCorner, "tnl4", "tunl show", tnl4Fix), // ip's alias object + bc(brPos, "tnl4", "-4 tunnel show", tnl4Fix), + bc(brPos, "tnl4", "-s tunnel show", tnl4Fix), // printf stats, inside -j too (T1) + bc(brCorner, "tnl4", "-d tunnel show", tnl4Fix), + bc(brCorner, "tnl4", "-o tunnel show", tnl4Fix), // _SL_ in the gre flags + bc(brCorner, "tnl4", "-p tunnel show", tnl4Fix), + bc(brPos, "tnl4", "tunnel show remote 198.51.100.2", tnl4Fix), + bc(brPos, "tnl4", "tunnel show local 192.0.2.1", tnl4Fix), + bc(brPos, "tnl4", "tunnel show dev d0", tnl4Fix), + bc(brCorner, "tnl4", "tunnel show isa1", tnl4Fix), // no prefix: the list, by name + bc(brCorner, "tnl4", "tunnel show isan", tnl4Fix), // a netlink isatap: no routers (K2) + bc(brPos, "tnl4", "tunnel show sit2", tnl4Fix), + bc(brCorner, "tnl4", "tunnel show nosuch", tnl4Fix), // the list finds nothing, rc 0 + bc(brCorner, "tnl4", "tunnel show name ipip2", tnl4Fix), // name: the ipip prefix asks ipip2 + // v4: a name prefix or a mode asks one device (T5). + bc(brPos, "tnl4", "tunnel show gre1", tnl4Fix), + bc(brPos, "tnl4", "tunnel show ipip1", tnl4Fix), + bc(brPos, "tnl4", "tunnel show sit1", tnl4Fix), + bc(brPos, "tnl4", "tunnel show vti1", tnl4Fix), + bc(brPos, "tnl4", "tunnel show mode gre", tnl4Fix), + bc(brPos, "tnl4", "tunnel show mode ipip", tnl4Fix), + bc(brPos, "tnl4", "tunnel show mode sit", tnl4Fix), + bc(brPos, "tnl4", "tunnel show mode isatap", tnl4Fix), + bc(brPos, "tnl4", "tunnel show mode vti", tnl4Fix), + bc(brCorner, "tnl4", "-s tunnel show gre1", tnl4Fix), // the named path prints no stats + // The fallback device answers for the tunnel the parameters describe. + bc(brCorner, "tnl4", "tunnel show mode gre remote 198.51.100.2 local 192.0.2.1 key 5", tnl4Fix), + bc(brCorner, "tnl4", "tunnel show mode gre remote 198.51.100.2", tnl4Fix), + bc(brCorner, "tnl4", "tunnel show mode gre remote 239.1.1.1 local 192.0.2.1", tnl4Fix), + bc(brCorner, "tnl4", "tunnel show mode vti remote 198.51.100.5 local 192.0.2.1 ikey 7 okey 8", tnl4Fix), + // mode any is a v6 mode (T10). + bc(brCorner, "tnl4", "tunnel show mode any", tnl4Fix), + bc(brCorner, "tnl4", "-6 tunnel show", tnl4Fix), + bc(brPos, "prl16", "tunnel show isa16", tnlPrl16Fix), // 15 of 16 routers (T8) + // v6. + bc(brPos, "tnl6", "-6 tunnel show", tnl6Fix), + bc(brCorner, "tnl6", "-6 tunnel", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel list", tnl6Fix), + bc(brPos, "tnl6", "-s -6 tunnel show", tnl6Fix), + bc(brCorner, "tnl6", "-o -6 tunnel show", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show ip6t1", tnl6Fix), // named: no final newline (T9) + bc(brCorner, "tnl6", "-s -6 tunnel show ip6t1", tnl6Fix), // -s: the list (T9) + bc(brPos, "tnl6", "-6 tunnel show name ip6g1", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show ip6tnl0", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show mode ip6gre", tnl6Fix), // proto 0 passes (T12) + bc(brPos, "tnl6", "-6 tunnel show mode ip6ip6", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show mode ipip6", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show mode vti6", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show mode any", tnl6Fix), + bc(brCorner, "tnl6", "tunnel show mode ip6ip6", tnl6Fix), // the pre-scan picks v6 + bc(brPos, "tnl6", "-6 tunnel show remote 2001:db8::2", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show local 2001:db8::1", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show dev d0", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show encaplimit none", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show hoplimit 1", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show tclass inherit", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show flowlabel 0x12345", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show key 9", tnl6Fix), + bc(brPos, "tnl6", "-6 tunnel show allow-localremote", tnl6Fix), + bc(brCorner, "tnl6", "-6 tunnel show encaplimit 300", tnl6Fix), // get_u8 fails unchecked (T20) + bc(brPos, "tnl6", "tunnel show", tnl6Fix), + bc(brCorner, "tnl6", "tunnel show gre6x", tnl6Fix), // 76 bytes into 52 (T19) + // External and Ethernet kinds. + bc(brCorner, "ext", "tunnel show", tnlExtFix), + bc(brCorner, "ext", "-6 tunnel show", tnlExtFix), + bc(brCorner, "ext", "tunnel show ipipx", tnlExtFix), + // Batch: ip -batch, and what carries between lines. + bb(brCorner, "tnl4", "twice", "", false, batchFile("tunnel show", "tunnel show"), tnl4Fix), + bb(brCorner, "tnl4", "mode-then-list", "", false, + batchFile("tunnel show mode gre", "tunnel show"), tnl4Fix), + bb(brCorner, "tnl4", "any-sticks", "", false, // T21 refuted: ip_batch_cmd resets the family, line 2 is v4 + batchFile("tunnel show mode any", "tunnel show"), tnl4Fix), + // A batch line takes no options: the mode pre-scan reaches the v6 + // named path, whose missing newline runs into the next line (T9). + bb(brCorner, "tnl6", "v6-named-then-list", "", true, + batchFile("tunnel show mode ip6ip6 ip6t1", "tunnel show"), tnl6Fix), + }}, + }, + Bad: []badValue{ + brBad("tnl4", "tunnel show gre9", tnl4Fix, ret, "a gre name asks gre9 by ioctl: ENODEV, rc 1 (T5)"), + brBad("tnl4", "tunnel show key 5", tnl4Fix, ret, "keys without a gre or vti mode are refused (T6)"), + brBad("bare", "tunnel show mode bogus", nil, tool, "Unknown tunnel mode, exit(-1)"), + brBad("bare", "tunnel show mode gre mode ipip", nil, tool, "more than one tunnel mode, exit(-1)"), + brBad("bare", "tunnel show mode", nil, tool, "mode with no value: the command is incomplete"), + brBad("bare", "tunnel show ttl 300", nil, tool, "invarg(\"invalid TTL\\n\"): two newlines (T11)"), + brBad("bare", "tunnel show ttl bogus", nil, tool, "invalid TTL"), + brBad("bare", "tunnel show tos bogus", nil, tool, "bad TOS value"), + brBad("bare", "tunnel show key bogus", nil, tool, "tnl_parse_key: not an unsigned integer"), + brBad("bare", "tunnel show remote bogus", nil, ret, "get_addr32: not an address, exit(1)"), + brBad("bare", "tunnel show name a name b", nil, tool, "duparg2 name"), + brBad("bare", "tunnel show help", nil, tool, "a prefix of help in the words prints the usage"), + brBad("bare", "tunnel show dev nosuch", nil, expect{RC: intp(1), Errno: "ENODEV", RefusedBy: refKernel}, + "ll_name_to_index asks the kernel, then nodev"), + brBad("bare", "tunnel bogus", nil, tool, "an unknown tunnel command"), + brBad("bare", "tunnel help", nil, tool, "the usage, exit(-1)"), + brBad("bare", "-0 tunnel show", nil, tool, "AF_PACKET: Unsupported protocol family"), + brBad("bare", "tunnel add", nil, ret, "a write with no mode: cannot determine tunnel mode, before any ioctl"), + brBad("bare", "tunnel add mode gre ttl 64 nopmtudisc", nil, ret, "ttl and nopmtudisc refused before any ioctl"), + brBad("bare", "tunnel prl", nil, tool, "prl with no device: Must specify device"), + brBad("bare", "tunnel 6rd", nil, tool, "6rd with no device: Must specify device"), + brBad("tnl6", "-6 tunnel show nosuch", tnl6Fix, ret, "the v6 named path: ENODEV, rc 1"), + brBad("bare", "-6 tunnel show mode gre", nil, tool, "gre is not a v6 mode: Unknown tunnel mode"), + brBad("bare", "-6 tunnel show ttl 300", nil, tool, "invarg(\"invalid TTL\"): one newline (T11)"), + brBad("bare", "-6 tunnel show flowlabel 0x100000", nil, tool, "a 21-bit flowlabel: invalid Flowlabel"), + brBad("bare", "-6 tunnel show dscp 5", nil, tool, "dscp takes only inherit"), + brBad("bare", "-6 tunnel bogus", nil, tool, "an unknown v6 tunnel command"), + brBad("bare", "-6 tunnel help", nil, tool, "the v6 usage, exit(-1)"), + }, + } + sp.Build = func(vals []value) row { + var optArg, cmdArg string + var pre []string + for i, val := range vals { + pre = append(pre, val.Pre...) + switch i { + case 0: + optArg = val.Arg + case 1: + cmdArg = val.Arg + } + } + args := joinArgs(optArg, cmdArg) + r := row{ + Cmd: strings.TrimSpace("ip " + args), + Proto: "route", + Modules: tunnelModules, + Readback: []readback{tnlsysReadback(args)}, + Expect: expect{RC: intp(0), RefusedBy: refNone}, + Axes: mergeFacts(vals), + } + for _, p := range pre { + r.Pre = append(r.Pre, preStep{Cmd: p}) + } + return r + } + sp.NegBase = func(vals []value) bool { + return pickOf(sp.Axes, vals)["opt"] == "plain" + } + return sp +} + +// tnlsysReadback is the sidecar readback: tnlsnap runs `ip ARGS` again +// under ptrace, from the row's directory (so b.txt and `< b.txt` work), +// and records what it asks outside netlink. +func tnlsysReadback(args string) readback { + return readback{Name: "tnlsys", Cmd: "tnlsnap -- " + args} +} diff --git a/tools/nlcapgen/matrix_tunnel_test.go b/tools/nlcapgen/matrix_tunnel_test.go new file mode 100644 index 000000000..36f46a958 --- /dev/null +++ b/tools/nlcapgen/matrix_tunnel_test.go @@ -0,0 +1,225 @@ +package main + +import ( + "bytes" + "fmt" + "strings" + "testing" +) + +// tnlSpaceRows generates a family's rows twice (determinism), checks them +// and keys them by command, fixture and batch name. Each row must carry the +// family's modules and the tnlsys readback of its own arguments; a write +// verb may appear only in a negative row; and every non-negative command +// runs plain and -j. +func tnlSpaceRows(t *testing.T, family string, modules []string) ([]row, map[string]*row) { + t.Helper() + rows, err := matrixRows(families[family](), matrixOpts{Seed: 1}) + if err != nil { + t.Fatal(err) + } + if err := checkRows(rows); err != nil { + t.Fatal(err) + } + var a, b bytes.Buffer + if err := writeRows(&a, nil, rows); err != nil { + t.Fatal(err) + } + again, err := matrixRows(families[family](), matrixOpts{Seed: 1}) + if err != nil { + t.Fatal(err) + } + if err := writeRows(&b, nil, again); err != nil { + t.Fatal(err) + } + if !bytes.Equal(a.Bytes(), b.Bytes()) { + t.Errorf("%s: two runs with seed 1 differ", family) + } + byKey := map[string]*row{} + for i := range rows { + r := &rows[i] + k := r.Cmd + "|" + r.Axes["fix"] + "|" + r.Axes["batch"] + if !strings.HasPrefix(r.ID, family+"/") { + t.Errorf("%s: not in %s/", r.ID, family) + } + if r.InitNS || r.Proto != "route" || strings.Join(r.Modules, ",") != strings.Join(modules, ",") { + t.Errorf("%s: initns %t proto %q modules %v", r.ID, r.InitNS, r.Proto, r.Modules) + } + if _, dup := byKey[k]; dup { + t.Errorf("%s: %q twice", r.ID, k) + } + byKey[k] = r + want := "tnlsnap -- " + strings.TrimPrefix(r.Cmd, "ip ") + if len(r.Readback) != 1 || r.Readback[0].Name != "tnlsys" || r.Readback[0].Cmd != want { + t.Errorf("%s: readback %+v, want tnlsys %q", r.ID, r.Readback, want) + } + neg := strings.HasPrefix(r.Desc, "negative:") + for _, w := range []string{" add", " del", " change", " prl", " 6rd"} { + if strings.Contains(r.Cmd+" ", w+" ") && !neg { + t.Errorf("%s: %q writes outside a negative row", r.ID, r.Cmd) + } + } + if neg && strings.Contains(r.Cmd, " -j ") { + t.Errorf("%s: a negative row in -j", r.ID) + } + if strings.Contains(r.Cmd, "-batch") { + if len(r.Pre) == 0 || !strings.HasSuffix(r.Pre[len(r.Pre)-1].Cmd, "> b.txt") { + t.Errorf("%s: batch row whose last pre step doesn't write b.txt", r.ID) + } + } + } + for k, r := range byKey { + if strings.HasPrefix(r.Desc, "negative:") || strings.Contains(r.Cmd, " -j ") { + continue + } + cmd, rest, _ := strings.Cut(k, "|") + if _, ok := byKey[strings.Replace(cmd, "ip ", "ip -j ", 1)+"|"+rest]; !ok { + t.Errorf("%s: %q has no -j row", r.ID, cmd) + } + } + return rows, byKey +} + +type tnlSpaceCase struct { + description string + key string // cmd|fix|batch + expected string // kind rc refused-by errno serial | pre count +} + +func runTnlSpaceCases(t *testing.T, byKey map[string]*row, tests []tnlSpaceCase) { + t.Helper() + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + r, ok := byKey[tc.key] + if !ok { + t.Fatalf("no row %q", tc.key) + } + kind, _, _ := strings.Cut(r.Desc, ":") + got := fmt.Sprintf("%s %d %s %s %t | %d", kind, *r.Expect.RC, r.Expect.RefusedBy, r.Expect.Errno, r.Serial, len(r.Pre)) + if got != tc.expected { + t.Errorf("got %q, want %q", got, tc.expected) + } + }) + } +} + +// TestTunnelSpace pins the ip tunnel and ip -6 tunnel read rows (goip 8C). +// +// go test ./tools/nlcapgen/ -run TestTunnelSpace +func TestTunnelSpace(t *testing.T) { + rows, byKey := tnlSpaceRows(t, "tunnel", tunnelModules) + if len(rows) != 171 { + t.Errorf("%d rows, want 171 (72 commands plain and -j, 27 negatives)", len(rows)) + } + for _, r := range rows { + if r.Serial { + t.Errorf("%s: serial; only tuntap -d rows walk /proc", r.ID) + } + } + // isatap tunnels come from `ip tunnel add`, so that the kernel keeps + // protocol IPPROTO_IPV6 and ip reads their routers (K2). + if len(tnlPrl16Fix) != 3 || !strings.HasPrefix(tnlPrl16Fix[1], "ip tunnel add isa16 mode isatap") || + !strings.Contains(tnlPrl16Fix[2], "i=10; while [ $i -lt 26 ]") { + t.Errorf("tnlPrl16Fix: want ip tunnel add isa16, then routers .10 to .25: %q", tnlPrl16Fix) + } + runTnlSpaceCases(t, byKey, []tnlSpaceCase{ + // Positive. + {"positive: the v4 list", "ip tunnel show|tnl4|", "positive 0 none false | 12"}, + {"positive: -j the v4 list", "ip -j tunnel show|tnl4|", "positive 0 none false | 12"}, + {"positive: the v6 list", "ip -6 tunnel show|tnl6|", "positive 0 none false | 6"}, + {"positive: v6 named, no final newline (T9)", "ip -6 tunnel show ip6t1|tnl6|", "positive 0 none false | 6"}, + {"positive: a gre name takes the named path (T5)", "ip tunnel show gre1|tnl4|", "positive 0 none false | 12"}, + {"positive: -s stats inside -j (T1)", "ip -j -s tunnel show|tnl4|", "positive 0 none false | 12"}, + // Negative. + {"negative: gre9 ENODEV is rc 1 (T5)", "ip tunnel show gre9|tnl4|", "negative 1 iproute2 false | 12"}, + {"negative: keys without a mode (T6)", "ip tunnel show key 5|tnl4|", "negative 1 iproute2 false | 12"}, + {"negative: unknown mode, exit(-1)", "ip tunnel show mode bogus|bare|", "negative 255 iproute2 false | 0"}, + {"negative: get_addr32 exit(1)", "ip tunnel show remote bogus|bare|", "negative 1 iproute2 false | 0"}, + {"negative: dev nosuch asks the kernel", "ip tunnel show dev nosuch|bare|", "negative 1 kernel ENODEV false | 0"}, + {"negative: a write is refused before any ioctl", "ip tunnel add|bare|", "negative 1 iproute2 false | 0"}, + {"negative: v6 named ENODEV", "ip -6 tunnel show nosuch|tnl6|", "negative 1 iproute2 false | 6"}, + // Boundary. + {"boundary: fallback devices only", "ip tunnel show|bare|", "boundary 0 none false | 0"}, + {"boundary: ttl 300, two newlines (T11)", "ip tunnel show ttl 300|bare|", "negative 255 iproute2 false | 0"}, + {"boundary: 16 routers, 15 printed (T8)", "ip tunnel show isa16|prl16|", "positive 0 none false | 3"}, + {"boundary: a 21-bit flowlabel", "ip -6 tunnel show flowlabel 0x100000|bare|", "negative 255 iproute2 false | 0"}, + // Corner. + {"corner: mode any is v6 (T10)", "ip tunnel show mode any|tnl4|", "corner 0 none false | 12"}, + {"corner: ip6gre through the v4 named path (T19)", "ip tunnel show gre6x|tnl6|", "corner 0 none false | 6"}, + {"corner: encaplimit 300 unchecked (T20)", "ip -6 tunnel show encaplimit 300|tnl6|", "corner 0 none false | 6"}, + {"corner: the tunl alias", "ip tunl show|tnl4|", "corner 0 none false | 12"}, + {"corner: mode any does not stick across batch lines (T21 refuted)", "ip -batch b.txt|tnl4|any-sticks", "corner 0 none false | 13"}, + {"corner: v6 named then the list, on stdin", "ip -batch - < b.txt|tnl6|v6-named-then-list", "corner 0 none false | 7"}, + {"corner: external and Ethernet kinds", "ip tunnel show|ext|", "corner 0 none false | 5"}, + }) +} + +// TestTuntapSpace pins the ip tuntap read rows (goip 8C). +// +// go test ./tools/nlcapgen/ -run TestTuntapSpace +func TestTuntapSpace(t *testing.T) { + rows, byKey := tnlSpaceRows(t, "tuntap", tuntapModules) + if len(rows) != 46 { + t.Errorf("%d rows, want 46 (20 commands plain and -j, 6 negatives)", len(rows)) + } + // A -d row walks /proc, which every namespace shares: it runs alone, + // after killing earlier rows' holders. Other rows run in parallel. + serial := 0 + for _, r := range rows { + d := detailWords(strings.TrimPrefix(r.Cmd, "ip ")) + if r.Serial != d { + t.Errorf("%s: serial %t, -d %t", r.ID, r.Serial, d) + } + if d { + serial++ + if len(r.Pre) == 0 || r.Pre[0].Cmd != tunHolderKill { + t.Errorf("%s: -d row whose first pre step isn't the holder kill", r.ID) + } + } + } + if serial != 10 { + t.Errorf("%d serial rows, want 10", serial) + } + runTnlSpaceCases(t, byKey, []tnlSpaceCase{ + // Positive. + {"positive: tuntap show", "ip tuntap show|tun|", "positive 0 none false | 4"}, + {"positive: -j tuntap show", "ip -j tuntap show|tun|", "positive 0 none false | 4"}, + {"positive: the tap alias", "ip tap show|tun|", "positive 0 none false | 4"}, + {"positive: -d with holders (T15)", "ip -d tuntap show|proc|", "positive 0 none true | 9"}, + // Negative. + {"negative: unknown command", "ip tuntap bogus|bare|", "negative 255 iproute2 false | 0"}, + {"negative: add with no mode is a returned -1", "ip tuntap add|bare|", "negative 1 iproute2 false | 0"}, + {"negative: del with no mode is a returned -1", "ip tuntap del|bare|", "negative 1 iproute2 false | 0"}, + // Boundary. + {"boundary: no tun devices", "ip tuntap show|bare|", "boundary 0 none false | 0"}, + {"boundary: -d with no holders", "ip -d tuntap show|tun|", "positive 0 none true | 5"}, + // Corner. + {"corner: arguments ignored (T13)", "ip tuntap show dev tap0|tun|", "corner 0 none false | 4"}, + {"corner: -o -d half one-line (T16)", "ip -o -d tuntap show|proc|", "corner 0 none true | 9"}, + {"corner: another namespace's holder (T22)", "ip -d tuntap show|xns|", "corner 0 none true | 7"}, + {"corner: batch on stdin", "ip -batch - < b.txt|tun|stdin", "corner 0 none false | 5"}, + }) +} + +// TestDetailWords pins which option words make a tuntap row serial. +func TestDetailWords(t *testing.T) { + tests := []struct { + description string + args string + expected bool + }{ + {"positive: -d", "-d tuntap show", true}, + {"positive: -d after -j", "-j -o -d tuntap", true}, + {"negative: no -d", "-j tuntap show", false}, + {"boundary: empty", "", false}, + {"corner: -d after the object is an argument", "tuntap show -d", false}, + {"corner: only the -d spelling (no row spells -details)", "-details tuntap", false}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := detailWords(tc.args); got != tc.expected { + t.Errorf("detailWords(%q) = %t, want %t", tc.args, got, tc.expected) + } + }) + } +} diff --git a/tools/nlcapgen/matrix_tuntap.go b/tools/nlcapgen/matrix_tuntap.go new file mode 100644 index 000000000..68b59fa0a --- /dev/null +++ b/tools/nlcapgen/matrix_tuntap.go @@ -0,0 +1,163 @@ +package main + +import "strings" + +// The tuntap read space (goip increment 8, 8C): `ip tuntap show` +// (ip/iptuntap.c do_show, print_tuntap, show_processes), plain and -j. +// +// ip dumps the links of kind "tun", then reads each one's +// /sys/class/net/DEV/{tun_flags,owner,group}, and under -d walks /proc for +// the processes holding /dev/net/tun on it. The `tnlsys` readback (tnlsnap) +// records the files and the walk for goip's replay. +// +// The rows pin the leads: show ignores every argument (T13); -d prints the +// processes run together, "name(pid)name(pid)" (T15); and a hard "\n" after +// -o's _SL_ "Attached to processes:" (T16). +// +// Determinism: fixed names. The holder processes' pids differ per run, so +// the -d rows differ between batches in their pids alone (the allow-list in +// V002). /proc is not per namespace, so every -d row is serial and first +// kills the holders earlier rows left (tunHolderKill). + +var tuntapModules = []string{"tun"} + +// tunFix is tap0 (tap, user 1000, group 100, one_queue), tun1 (tun, +// multi_queue, vnet_hdr) and tap2 (tap, pi), all persistent, beside a +// dummy d0 the kind filter skips. +var tunFix = []string{ + "ip link add d0 address 02:00:00:00:01:01 type dummy && ip link set d0 addrgenmode none", + "ip tuntap add tap0 mode tap user 1000 group 100 one_queue", + "ip tuntap add tun1 mode tun multi_queue vnet_hdr", + "ip tuntap add tap2 mode tap pi", +} + +// tunHolderScript is a pre step writing /run/tnlholder.py: attach to +// argv[1] with the TUNSETIFF flags argv[2] (the device's own, so the attach +// changes none of them) and hold it for 120 s. The name is what +// tunHolderKill finds the holders by. +const tunHolderScript = "printf '%s\\n' 'import fcntl,os,struct,sys,time'" + + " 'f=os.open(\"/dev/net/tun\",os.O_RDWR)'" + + " 'fcntl.ioctl(f,0x400454ca,struct.pack(\"16sH\",sys.argv[1].encode(),int(sys.argv[2],0)))'" + + " 'time.sleep(120)' > /run/tnlholder.py" + +// tunHolderKill is the first pre step of every -d row: show_processes +// walks all of /proc, not the row's namespace (T22), so an earlier row's +// holder would be listed too. The brackets keep the pattern from matching +// the shell that runs it. +const tunHolderKill = "pkill -f '[t]nlholde[r]'; true" + +// tunHolder is a pre step leaving a holder on dev, in the row's namespace. +func tunHolder(dev, flags string) string { + return "setsid python3 /run/tnlholder.py " + dev + " " + flags + " /dev/null 2>&1 & sleep 1" +} + +// tunProcFix is tunFix with one holder on tap0 and two on the multi_queue +// tun1. +var tunProcFix = append(clonePre(tunFix), + tunHolderScript, + tunHolder("tap0", "0x3002"), + tunHolder("tun1", "0x5101"), + tunHolder("tun1", "0x5101"), +) + +// tunXnsFix is tunFix with no holder of its own, and a holder on a tap0 in +// another network namespace, which show_processes matches by name (T22). +var tunXnsFix = append(clonePre(tunFix), + tunHolderScript, + "setsid unshare -n sh -c 'ip tuntap add tap0 mode tap && exec python3 /run/tnlholder.py tap0 0x1002'"+ + " /dev/null 2>&1 & sleep 1", +) + +// tuntapSpace: ip tuntap show, plain and -j. +func tuntapSpace() *space { + tool := expect{RC: intp(255), RefusedBy: refIproute2} + ret := expect{RC: intp(1), RefusedBy: refIproute2} // a returned -1: do_cmd negates it + sp := &space{ + Name: "tuntap", + Axes: []axis{ + {Name: "opt", Values: []value{ + v("plain", "", f("json", "0")), + v("json", "-j", f("json", "1")), + }}, + {Name: "cmd", Values: []value{ + bc(brBoundary, "bare", "tuntap show", nil), + bc(brPos, "tun", "tuntap show", tunFix), + bc(brCorner, "tun", "tuntap", tunFix), // no verb: show + bc(brPos, "tun", "tuntap list", tunFix), + bc(brPos, "tun", "tuntap lst", tunFix), + bc(brCorner, "tun", "tuntap sh", tunFix), + bc(brPos, "tun", "tap show", tunFix), // ip's alias object + bc(brCorner, "tun", "tap", tunFix), + bc(brPos, "tun", "-d tuntap show", tunFix), // no holders: an empty list + bc(brCorner, "tun", "-o tuntap show", tunFix), + bc(brCorner, "tun", "-s tuntap show", tunFix), + bc(brCorner, "tun", "-6 tuntap show", tunFix), // the dump is AF_UNSPEC whatever -6 says + bc(brCorner, "tun", "tuntap show dev tap0", tunFix), // arguments ignored (T13) + bc(brCorner, "tun", "tuntap show bogus words", tunFix), // (T13) + bc(brPos, "proc", "-d tuntap show", tunProcFix), // name(pid)name(pid) (T15) + bc(brCorner, "proc", "-o -d tuntap show", tunProcFix), // half one-line (T16) + bc(brCorner, "proc", "-d tuntap", tunProcFix), + bc(brCorner, "xns", "-d tuntap show", tunXnsFix), // another namespace's tap0 holder (T22) + bb(brCorner, "tun", "twice", "", false, batchFile("tuntap show", "tuntap show dev tap0"), tunFix), + bb(brCorner, "tun", "stdin", "", true, batchFile("tap show"), tunFix), + }}, + }, + Bad: []badValue{ + brBad("bare", "tuntap bogus", nil, tool, "an unknown tuntap command"), + brBad("bare", "tuntap help", nil, tool, "the usage, exit(-1)"), + brBad("bare", "tuntap add", nil, ret, "a write with no mode: refused before any ioctl"), + brBad("bare", "tuntap add mode bogus", nil, tool, "Unknown tunnel mode, before any ioctl"), + brBad("bare", "tuntap add mode tap user nosuchuser", nil, tool, "invalid user, before any ioctl"), + brBad("bare", "tuntap del", nil, ret, "a delete with no mode: refused before any ioctl"), + }, + } + sp.Build = func(vals []value) row { + var optArg, cmdArg string + var pre []string + for i, val := range vals { + pre = append(pre, val.Pre...) + switch i { + case 0: + optArg = val.Arg + case 1: + cmdArg = val.Arg + } + } + args := joinArgs(optArg, cmdArg) + r := row{ + Cmd: strings.TrimSpace("ip " + args), + Proto: "route", + Modules: tuntapModules, + Readback: []readback{tnlsysReadback(args)}, + Expect: expect{RC: intp(0), RefusedBy: refNone}, + Axes: mergeFacts(vals), + } + // A -d row walks /proc, which every namespace shares: it runs alone, + // after the holders earlier rows left are gone. + if detailWords(args) { + r.Serial = true + pre = append([]string{tunHolderKill}, pre...) + } + for _, p := range pre { + r.Pre = append(r.Pre, preStep{Cmd: p}) + } + return r + } + sp.NegBase = func(vals []value) bool { + return pickOf(sp.Axes, vals)["opt"] == "plain" + } + return sp +} + +// detailWords is whether ip's options in args include -d. +func detailWords(args string) bool { + for _, w := range strings.Fields(args) { + if !strings.HasPrefix(w, "-") { + return false + } + if w == "-d" { + return true + } + } + return false +}