diff --git a/.golangci-comprehensive.yml b/.golangci-comprehensive.yml index 8532b9cdf..c942ba2aa 100644 --- a/.golangci-comprehensive.yml +++ b/.golangci-comprehensive.yml @@ -40,6 +40,7 @@ run: - capture - dest_file - goip_write + - gotc_write - treatment formatters: diff --git a/.golangci-quick.yml b/.golangci-quick.yml index ca1d184ed..4934b5d0f 100644 --- a/.golangci-quick.yml +++ b/.golangci-quick.yml @@ -34,6 +34,7 @@ run: - capture - dest_file - goip_write + - gotc_write - treatment formatters: diff --git a/.golangci.yml b/.golangci.yml index 4c167a360..7341d4fdc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -31,6 +31,7 @@ run: - capture - dest_file - goip_write + - gotc_write - treatment formatters: diff --git a/cmd/tnlsnap/main.go b/cmd/tnlsnap/main.go index 9cd363c88..583230494 100644 --- a/cmd/tnlsnap/main.go +++ b/cmd/tnlsnap/main.go @@ -28,6 +28,7 @@ import ( "strings" "github.com/randomizedcoder/xtcp2/internal/tnlsys" + "github.com/randomizedcoder/xtcp2/internal/tnlsys/trace" ) func main() { @@ -162,7 +163,7 @@ func matches(prefix, word string) bool { // 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) + r, recs, err := trace.Trace(cmd) if err != nil { return nil, err } diff --git a/docs/netlink/goip-tunnel.md b/docs/netlink/goip-tunnel.md index 5ad16c1c5..3ad5dcbd1 100644 --- a/docs/netlink/goip-tunnel.md +++ b/docs/netlink/goip-tunnel.md @@ -76,7 +76,7 @@ TunFDs() ([]TunFD, error) ## 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 +1. It runs the real `ip` under ptrace (`trace.Trace` in `internal/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; diff --git a/docs/netlink/gotc-status.md b/docs/netlink/gotc-status.md index 04f58a27f..3e9971fd4 100644 --- a/docs/netlink/gotc-status.md +++ b/docs/netlink/gotc-status.md @@ -208,6 +208,27 @@ skbprio; branch `gotc/aqm`; plan leads Q66–Q87, K32–K42): not submitted to netdev (DOC009). - **16L (live diff): done.** 129/132 rows identical live; the other 3 are the planned write refusals (V036). +**Increment 17: qdisc and class writes, the increment-9 kinds** (pfifo, bfifo, pfifo_head_drop, prio, pfifo_fast, +fq_codel, fq, htb qdisc and class, tbf, sfq, netem, ingress, clsact; branch `gotc/qwrite`; plan leads W1+, K44+). +Writes are dry-run: built under the `gotc_write` tag and checked against a replay or written to `GOTC_WRITE_OUT`, +never sent to a live kernel. + +- **17C (captures): done.** `tcqwrite`: 125 rows (100 writes, 25 refusals), each write with a `qdisc`/`class show` + readback. Two batches on one boot agree on every write (V037). +- **17P (encoders and units): done.** `pkg/xtcpnl/xtcpnl_tc_write.go` builds a qdisc or class write in tc's + attribute order (gotc_write only), every slice struct has an `Append` that round-trips, and + `internal/gotc/units.go` ports tc's rate, size, time, rtable, size-table and estimator code, checked against + tc's own C (V038). +- **17W (gotc writes): done.** `internal/gotc/qwrite.go` (`gotc_write`) is tc_qdisc_modify and tc_class_modify with + parse_estimator, parse_size_table, read_prop and get_percent_rate; `qw_*.go` port the parse_qopt of pfifo, bfifo, + pfifo_head_drop, prio, fq_codel, fq, htb (and its parse_copt), tbf, sfq, netem, ingress and clsact. Writes are dry-run: + a replay matches them byte for byte, the kernel socket gets only GETs and the request goes to `GOTC_WRITE_OUT` + (V039). +- **17B (write-up): done.** [upstream/iproute2-tc-write.md](upstream/iproute2-tc-write.md): W1–W6 and W8–W25 + confirmed with file:line and pinning rows, W7 dropped, K44–K45; all present at HEAD `35033e4713fe` (DOC010). +- **17L (live diff): done.** All 125 tcqwrite rows on the workbench: gotc's `GOTC_WRITE_OUT` requests equal tc's + byte for byte (ifindex aside), and stdout, stderr and rc match wherever tc stops before the kernel (V040). + ## Ledger | id | task | what was verified | @@ -254,7 +275,13 @@ skbprio; branch `gotc/aqm`; plan leads Q66–Q87, K32–K42): | DOC008 | 15B | **Write-up:** `docs/netlink/upstream/iproute2-tc-sched.md`: status header, reachability, contents, 29 summary rows, seven sections, and K24–K31. Not submitted to netdev. **Leads:** each was read at v7.2.0 (`q_{drr,qfq,hfsc,ets,mqprio,taprio,multiq,cbs,etf}.c`) against the tcsched corpus, and the kernel side at v7.4-rc4. **At HEAD** (GitHub mirror, `5d13122576d6`, 2026-11-26): none of the nine printers, `tc_qdisc.c`, `tc_class.c`, `tc_util.c` or `tc_stab.c` has a commit since v7.2.0, so all are present. **Confirmed in the corpus:** Q37, Q38, Q39, Q40, Q42, Q43, Q44, Q45, Q46, Q48, Q49, Q50, Q51 (the JSON shape), Q52, Q55, Q56, Q57, Q58, Q60, Q61 and Q63. **Latent, with unit rows:** Q41, Q47, Q51 (count 0; the kernel rejects it, sch_mqprio_lib.c:29), Q53, Q54, Q59, Q62 (the kernel rejects a negative delta, sch_etf.c:67), Q64 and Q65. **Dropped:** none. **New leads:** **Q64**: the ets list walks print the first band from each offset to the end but step by the attribute at the offset, +3 for the priomap, so a foreign attribute repeats a band and a non-canonical length misaligns the walk; this is the same hand-rolled walk as tunnel_key's geneve (AC46). **Q65**: an explicit `mode dcb` (or `shaper dcb`), which the kernel echoes only when it was given (sch_mqprio.c:602), prints nothing, while an absent one prints `mode:dcb`; it needs `hw 1` (sch_mqprio.c:263). **Kernel notes:** K24 (qfq's `tc_qfq_stats`, sch_qfq.c:663-677). K25 (ets: NSTRICT only when nonzero, QUANTA only when `nbands > nstrict`, an empty class nest for a strict band, sch_ets.c:313-319, 764, 767). K26 (16 TC entries whatever num_tc, sch_mqprio.c:531, sch_taprio.c:2319). K27, corrected from the plan: tc never sends bands, as multiq takes no options; `multiq_tune` writes `real_num_tx_queues` into the request's own attribute (sch_multiq.c:186). K28, refined: the tc entries and the oper schedule are dumped only `if (oper)` (sch_taprio.c:2446, 2449); in software mode oper is set at the first cycle start (:220), under txtime-assist at change time (:1989); the xstats need `ndo_setup_tc` (:2371). K29 (drr and qfq have no qdisc `.dump`). K30, corrected from the plan: TCA_OPTIONS is noflag for every one of these kinds, ets included. The flagged nests are ets's QUANTA/PRIOMAP and the mqprio/taprio TC_ENTRYs; mqprio's rate nests are noflag. tc's printers depend on exactly that: TC_ENTRY is matched by its raw type with the flag, and the rates are parsed without masking it, while tc's own parser sends the rates flagged. **K31 (new):** `qdisc_change` returns EINVAL ("Change operation not supported by specified qdisc", sch_api.c:1456-1460) for a kind with no `.change`, so any `tc qdisc replace` over an etf fails before its options are read; this is why 15C's etf negative grafts a new etf. **Re-confirmed:** Q22 (`-j -g` prints `[]`, then text, pw-011) and Q36 (`-g` over hfsc's nested tree, ec-011 and pw-011). **Unit rows added** to `TestGotcSched` for Q65 and Q62 (35 rows). **Bug classes:** none edited. One candidate is noted for the user: a hand-rolled TLV walk that reads with `parse_rtattr` from an offset but steps by another stride (Q64, AC46). | | V032 | 15L | **Live diff** on the workbench (kernel 7.3.1, tc 7.2.0): `gotc` from `nix build "git+file://…?rev=f64f6d074#gotc"` (`/nix/store/lcm6hr7nykwldhlkrhkb3186q2klxsv8-gotc-0.2.1`) beside `tc` (`/nix/store/x1pwsbz5cm23hk58b7fcpn3hhg9j7gwh-iproute2-7.2.0`), with `GOTC_CONF_USR_DIR` set to tc's `share/iproute2`. The guest script is generated from `nix/microvms/workbench/tcsched.rows.jsonl` by 13L's generator, without its two `-netns` reads. The row's ten modules are loaded once, then each row runs its pre steps in a fresh named namespace, in its own directory (so the batch rows' `b.txt` is there), then tc and gotc in turn. **Result:** 87 rows, **83 identical** on stdout, stderr and exit code, the `-s`, `-d`, `-o`, `-g`, `-j -g` and batch rows included. **The other four** are the planned write refusals: ng-001 (mqprio under drr; tc `RTNETLINK answers: Operation not supported`, rc 2), ng-002 (taprio with no clockid; `Error: Specifying a 'clockid' is mandatory.`, rc 2), ng-003 (cbs offload; `Error: Specified device does not support cbs offload.`, rc 2) and ng-004 (etf offload; `Error: Specified device does not support ETF offload.`, rc 2). gotc gives `not implemented: tc qdisc add`/`replace`, rc 255, for each. **tc against the corpus:** stdout, stderr and rc match `ws/tcsched` on all 87 rows, so nothing has drifted since the capture (the taprio base-times are fixed, and no row sends packets). **VM:** pre-checked (`free -g`, port 12061 free, no other workbench process), booted for this run. The modules this run loaded (the ten, plus `sch_mqprio_lib`) were removed with `modprobe -r`, leaving lsmod equal to the pre-run list; no namespace or extra link is left, there are no core files, `/tmp/t15l` is removed, and the VM is powered off again, as it was before. | | V036 | 16L | **Live diff** on the workbench (kernel 7.3.1, tc 7.2.0): `gotc` from `nix build "git+file://…?rev=a74e25f35#gotc"` (`/nix/store/fyk73qxkzp4hbn4abfiwh8glvr2qdnfv-gotc-0.2.1`) beside `tc` (`/nix/store/x1pwsbz5cm23hk58b7fcpn3hhg9j7gwh-iproute2-7.2.0`), with `GOTC_CONF_USR_DIR` set to tc's `share/iproute2`. The guest script is generated from `nix/microvms/workbench/tcaqm.rows.jsonl` by 15L's generator; the twelve sch_* modules are loaded once, then each row runs its pre steps in a fresh named namespace, then tc and gotc in turn. **Result:** 132 rows, **129 identical** on stdout, stderr and exit code, the `-s`, `-d`, `-o` and `-j` rows included. **The other three** are the planned write refusals: ng-001 (`Error: Parent qdisc is not classful.`, rc 2), ng-002 (`Error: Can't use autorate-ingress with cake_mq.`, rc 2) and ng-003 (gred `change` before `setup`: `Error: Invalid qdisc name: must match existing qdisc.`, rc 2). gotc gives `not implemented: tc qdisc add`/`replace`/`change`, rc 255, for each. **tc against the corpus:** stdout, stderr and rc match `ws/tcaqm` on all 132 rows, so nothing has drifted since the capture. **VM:** pre-checked (`free -g`, a bracketed pgrep); it was the boot this session started for 16C. The twelve modules were removed with `modprobe -r` (none left); no namespace or extra link is left, there are no core files, `/tmp/t16l` is removed, and the VM is powered off (`systemctl poweroff`; port 12061 free). | +| V037 | 17C | **Captures** `tcqwrite`: `tools/nlcapgen/matrix_tcqwrite.go` (+ `TestTcQwriteSpace`), rows in `nix/microvms/workbench/tcqwrite.rows.jsonl`, corpus in `pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/` (125 rows, 3.0M). The write is the captured command, its setup is in the pre steps, and `tc -d qdisc show` (plus `tc -d class show` for class rows) reads it back. **Rows:** every add body of the 11 root kinds, then change, replace, link and delete on each; ingress and clsact with blocks and deletes; parent, estimator (and the `est` prefix), stab (atm with mtu/tsize/mpu, ethernet, overhead only), the verb prefix `qdisc a`, no handle, W1 `help`, W3 `handle 0: handle 1:`, W2 `handle 5: ingress`; htb classes (full options, rate64, estimator, atm, root, change, replace, del, help); a two-line batch. **Refusals (25):** EEXIST, change and delete with no qdisc (ENOENT), classless, bad option and bad unit (rc 1), unknown kind sent to the kernel (ENOENT), duplicate dev and root, class `handle`, a missing device, a `-force` batch; plus what the first batch showed: **sfq and htb have no kernel change op**, so change, replace and link on them are EINVAL, `Error: Change operation not supported by specified qdisc.` (K44, 6 rows); htb `offload` on a dummy (ENOTSUP, `Error: hw-tc-offload ethtool feature flag must be on.`); `qdisc add dev d0 handle 1: pfifo` with no parent (ENOENT); **W2 confirmed:** `qdisc add ingress dev d0` hands `dev d0` to ingress's parse_qopt (`What is "dev"?`, rc 1); **W9 confirmed:** `htb rate 10%` on a dummy fails reading `/sys/class/net/d0/speed` (rc 1); **W5 and W8 are not reached here:** an unknown class kind gives `Qdisc "nosuchkind" is classless.` (rc 1), an unknown qdisc kind gives `Unknown qdisc "nosuchkind", hence option "rate" is unparsable` (rc 1), and clsact's own parse_qopt refuses `foo` (rc 1). fq's `priomap` needs `bands` before it. **Gate:** two batches on one boot, 125/125 OK; stdout, stderr and rc identical on every row. Eight readbacks differ, all nondeterministic: netem's random `seed` (seven rows) and an auto-allocated handle (`8003:` vs `8004:`, ec-087). `TestWsCorpusRows` checks every row's errno against its pcap. `TestTcQwriteSpace` pins 125 rows, the kind × verb grid and the lead rows; no row sends packets. | +| V038 | 17P | **Encoders and units.** `pkg/xtcpnl/xtcpnl_tc_qencode.go` (untagged): `Append` for tc_ratespec, tc_sizespec, the new `TcEstimator` (+ `DecodeTcEstimator`), tc_fifo_qopt, tc_prio_qopt, tc_htb_opt, tc_htb_glob, tc_tbf_qopt, tc_sfq_qopt(_v1, stats included), tc_netem_qopt and its corr, reorder/corrupt, rate, slot, gimodel and gemodel structs, each cited to pkt_sched.h at v7.4-rc4; `TestTcQencodeRoundTrip` (20 rows) has decode(Append(x)) == x at each size. `pkg/xtcpnl/xtcpnl_tc_write.go` (`gotc_write`): `TcWrite` and `BuildTcWriteRequest` lay out tcmsg, TCA_KIND, TCA_RATE, the blocks, the kind's options (a callback) and TCA_STAB {BASE, DATA} in tc_qdisc_modify's and tc_class_modify's order, in TCA_BUF_MAX for a qdisc and 4096 for a class (W6: tc prints `addattr_l ERROR` and sends a truncated request; the builder refuses); `BeginNestCompat`/`EndNestCompat` are addattr_nest_compat for q_prio. `IsAdmittedWriteType` admits RTM_NEW/DELQDISC and RTM_NEW/DELTCLASS; `xtcpnl_write_request.go` builds under `gotc_write` too. **`TestBuildTcWrite`** matches tc's captured request byte for byte (seq and pid aside) on 14 tcqwrite rows: add, change (ACK only), replace (CREATE\|REPLACE), link (REPLACE only), delete, prio's compat nest, ingress, clsact with both blocks, the estimator, stab with a table and with overhead alone, W2 and W3. The bytes corrected three assumptions: ingress and clsact send **no** TCA_OPTIONS; clsact's handle and parent are ingress's (`TC_H_CLSACT` is `TC_H_INGRESS`); an overhead-only stab keeps linklayer 0. `TestBuildTcWriteAllocs`: 2 allocations per request; `BenchmarkBuildTcWrite` 16.6 µs, 73.8 KB/op (the 64 KiB TCA_BUF_MAX buffer, zeroed). **Units** (`internal/gotc/units.go`, `gotc_write`): glibc strtod (inf, nan(…), hex floats with `p`), get_rate/get_rate64, get_size/get_size64 (+ `_and_cell`), get_time/get_time64, get_linklayer, percent, time2tick, calc_xmittime, adjust_size, calc_rtable, calc_size_table, setup_estimator, get_integer. **`TestTcUnits` / `TestCStrtod` / `TestTcEstimatorTables`** (93 rows) take every expected value from iproute2 v7.2.0's own C built with gcc -O2. **`cDoubleToU64` fixed:** it returned 0x8000000000000000 for ≥ 2^64, +Inf and v ≤ -1; gcc gives 0 for ≥ 2^64 and +Inf, `(u64)(i64)v` below 2^63 (so -1 is all ones), and 0x8000000000000000 only for NaN and ≤ -2^63. **New leads:** W10 get_time has no range check, so `5000s` is 705032704 and `4294.967296s` is 0; W11 get_rate64 converts with no check, so `inf` is 0 and `nan` is 9223372036854775808; W12 strtod takes `inf`, `nan` and hex, and `0x10bit` parses as `0x10b` then `it`; W13 `stab tsize 1` with mtu ≥ 2^31 never ends (cell_log is `__u8` and the shift count wraps), where the plan guessed any tsize 1 (mtu 2047 gives cell_log 11); W14 parse_size_table fails with no message (rc 255) given `mtu` or `tsize` alone. **cint:** `ShortBits`, `SChar`, `SCharBits` (+ `TestShortSChar`). **Nix:** `gotc_write` in `optInOnlyTags` and `gotcWriteTags`; govulncheck scans it; flavor-tags fails if the full flavor carries it; no-write-encoders counts internal/gotc as a write package and requires `gotc_write` to add write files; `test-focused-gotc-write`; all three golangci configs lint it. | +| V039 | 17W | **gotc writes.** `qwrite.go` (`gotc_write`; `qwrite_off.go` keeps refusing without it): do_qdisc's verbs (add EXCL\|CREATE, change 0, replace CREATE\|REPLACE, link REPLACE, delete) and do_class's (replace is CREATE alone), both argument loops with every lead kept as tc behaves (W1 help goes on, W2 ingress/clsact overwrite handle and break, W3 `handle 0: handle 1:`, W4 parser failure rc 1, W5 unreachable Garbage arm, W8 pfifo_fast's missing parse_qopt, W13 refused rather than hang, W14 silent stab), parse_noqopt for unknown kinds, and kinds of increments 15/16 refused by name. `sendWrite`: a replay compares and echoes the recorded ack (rtnl_talk, rc 2 on error); on the kernel socket the request is appended to `GOTC_WRITE_OUT`, else `ErrWriteNotApplied`; `LiveSource.Talk` refuses anything but RTM_GET*. Per-kind parsers in `qw_fifo.go`, `qw_fq.go`, `qw_htb.go`, `qw_tbf.go`, `qw_netem.go` (distribution tables from `TC_LIB_DIR`/`/usr/lib/tc`, copies in `testdata/tc-lib`), `qw_ingress.go`. **Corpus:** all 125 tcqwrite rows replay byte for byte (requests, stdout, stderr, rc), and tcqdisc/ng-018 and tcclass/ng-011 are now sent. **`TestGotcTdcWrites`:** of 410 tdc qdisc/class writes, 173 match exactly and 237 are refused by kind (pinned per kind). **`TestGotcQwrite`** (34 rows), `TestGotcPercentRate`, `TestGotcWriteOut`, `TestIsGetRequest`, plus per-kind tables (`TestParseFqQopts`, `TestParseHtb`, `TestParseTbfSfq`, `TestRedEval`, netem's). Coverage 85.3% (tagged). **New leads** for 17B: q_fq.c orphan_mask says `Illegal "initial_quantum"`; fq maxrate percent goes through 32-bit get_percent_rate; htb and tbf build rtables from the 32-bit-clamped rate beside RATE64; htb `debug` stops silently at a digit outside 0-3; tbf's `"limit" and "/latency"`; sfq `depth` says `Illegal "flows"` and `quantum` says `Illegal "limit"`; sfq red with avpkt 0 divides by zero (gotc refuses); netem `duplicate P C` drops the correlation (ec-062); netem's second `loss` message holds a newline inside the quotes; an empty `.dist` fails silently. | +| V040 | 17L | **Live diff** on the workbench (kernel 7.3.1, tc 7.2.0 `/nix/store/x1pwsbz5cm23hk58b7fcpn3hhg9j7gwh-iproute2-7.2.0`): gotc built with `-tags gotc_write` at 17W (`/nix/store/4jqbwh9si1kacb7frig6hwxkalkfdgr1-gotc-write-17l`), with `GOTC_CONF_USR_DIR` and `TC_LIB_DIR` set to tc's `share/iproute2` and `lib/tc`. Each row of `tcqwrite.rows.jsonl` runs its pre steps in a fresh named namespace, then gotc with `GOTC_WRITE_OUT` (it sends only its link lookups), then tc, which applies the write. gotc's requests are compared with tc's from the corpus pcaps (seq and pid zeroed), and stdout, stderr and rc with the live tc's. **Result: 125/125.** Every request matches byte for byte, the batch rows' two included, with one masked field: the tcmsg ifindex, 2 live and 3 in the capture, because nlcapgen's nlmon device took index 2 in the capture namespace (tc in the live namespace also has d0 at 2). **Named exceptions** (request identical, output differs because gotc never hears the kernel): ec-092 (htb's quantum warning) and the 12 kernel refusals ng-001, 002, 003, 007, 012, 014, 020–025, where tc prints the extack and exits 2 and gotc exits 0. Everywhere tc stops before sending (ng-004–006, 008–011, 013, 015–019, help rows ec-088, ec-099), stdout, stderr and rc are identical. **tc against the corpus:** stdout, stderr and rc match `ws/tcqwrite` on all 125 rows, so nothing has drifted. **VM:** pre-checked (`free -g`, port 12061 held only by this session's boot, bracketed pgrep). This run loaded no module (17C's captures had already loaded all eight on this boot), and none were removed here. No namespace or extra link is left, there are no core files, `/tmp/t17l` is removed, and the VM is powered off (`nlcap-ws down`; port 12061 free). | +| V041 | 17W | **Review fix (PR 356):** `cStrtod` dropped strtod's ERANGE on a hex float, so `0x1p1024` passed get_time and get_rate64 as an integer conversion of infinity: gotc sent where tc says `Illegal "target"` (fq_codel), `Illegal "latency"`/`"rate"` (netem) and `Illegal "timer_slack"` (fq), each rc 1. `hexFloat` now reports the overflow and `cStrtod` returns it, as the decimal path does. `inf` stays no ERANGE. Pinned by `TestCStrtod` (hex overflow ±, `0x1p1023` the largest power) and `TestGotcHexOverflow` (the four commands: rc 1, tc's stderr, no request). | | DOC009 | 16B | **Write-up:** `docs/netlink/upstream/iproute2-tc-aqm.md`: status header, reachability, contents, 24 summary rows, six sections, and K32–K43. Not submitted to netdev. **At HEAD** (GitHub mirror, `5d13122576d6`, 2026-11-26): none of the thirteen printers, `tc_red.c`, `tc_qevent.c` or `tc_qdisc.c` has a commit since v7.2.0, so all are present. **Confirmed in the corpus:** Q66 (ec-007), Q73 (ec-021, pw-021), Q79 (ec-038), Q80/Q81 (pw-035, ec-040, pw-040, pw-042), Q83 (pw-052), Q84 (pw-052, ec-055, pw-055), Q86 (ec-053), Q87 (ec-001, pw-005). **Latent, with unit rows:** Q67–Q72, Q74–Q78, Q82, Q85, Q88, Q89. **Dropped:** none. **New leads:** Q88 (gred_parse_vqs's plain parse_rtattr misses a VQ_ENTRY flagged NLA_F_NESTED), Q89 (an unknown dualpi2 ECN mask warns twice and prints an empty word). **Kernel notes:** K32–K42 confirmed at v7.4-rc4, refined: red's qevents only when bound; idle cake MIN_NETLEN 65535; cake_mq no dump_stats; plug no .dump; skbprio 64 classes; dualpi2 rejects both step_thresh forms (sch_dualpi2.c:812). **K43 (new):** codel times lose 1 µs (target 4ms dumps 3999, pw-024). **Unit rows:** TestGotcAqm adds Q88 (44 rows). **Bug classes:** none new; Q88 and Q89 fit C3/C15 and C10. | +| DOC010 | 17B | **Write-up:** `docs/netlink/upstream/iproute2-tc-write.md`: status header, reachability, contents, 25 summary rows, eight sections, K44–K45. Not submitted to netdev. **At HEAD** (GitHub mirror, `35033e4713fe`, 2026-11-27): no tc file in scope has a commit since v7.2.0; `lib/utils.c`'s one (`552d9842b1f4`, resolve_address's cache) touches none of it, so all are present. **Confirmed in the corpus:** W1 (ec-088, ec-099), W2 (ec-079, ng-011), W3 (ec-089), W4 (ng-004, ng-005, ng-019), W9 (ng-013), W17 (ec-092), W22 (ec-062). **Latent, with unit rows:** W5, W6, W8, W10–W16, W18–W21, W23–W25. **Dropped:** W7. **Kernel notes:** K44 (each verb's errno and extack, ng-001–003, 007, 014, 020–025), K45 (extack errors and warnings printed in place of RTNETLINK answers). **Bug classes:** candidates for the user: a wrong option named in a copied error message (W15, W20) and a divide by a user-given zero (W21). | | V033 | 16C | **Captures** `tcaqm`: `tools/nlcapgen/matrix_tcaqm.go` (+ `TestTcAqmSpace`), rows in `nix/microvms/workbench/tcaqm.rows.jsonl`, corpus in `pkg/xtcpnl/testdata/7_3_1/ws/tcaqm/` (132 rows, 2.7M). Modules: sch_cake (with cake_mq), sch_choke, sch_codel, sch_dualpi2, sch_fq_pie, sch_gred, sch_hhf, sch_pie, sch_plug, sch_red, sch_sfb, sch_skbprio. **Fixtures (26):** red default and `ecn harddrop adaptive qevent early_drop block 10`; choke with ecn; gred `setup vqs 4 default 0 grio` with VQs 0 and 1 changed in, and gred with no VQ configured; sfb default and `rehash 5000000 db 5000000` (Q73); codel, pie, fq_pie and hhf defaults plus an option variant each; cake default, plus four variants covering every diffserv mode, the flow modes, nat/wash/ingress, both ack-filters, no-split-gso, rtt, atm overhead mpu, memlimit, fwmark 0xff, autorate-ingress and docsis; cake_mq on a four-queue dummy; dualpi2 default, step_thresh in packets with drop_enqueue/drop_on_overload/any_ect/no_split_gso, and step_thresh in time; plug; skbprio (with `class show`). Each gets `qdisc show` plus `-s`/`-d`/`-o` forms; batches: cake `-s` qdisc/class/qdisc and red `-d` twice. **Refusals:** ng-001 cake_mq under plug (ENOTSUP, "Parent qdisc is not classful"), ng-002 cake_mq autorate-ingress (ENOTSUP, K39), ng-003 gred change over plug (EINVAL), ng-004 `show dev nosuch` (rc 1). **Notes:** batch lines take no options, so the batches pass `-s`/`-d` on tc's own command line; hhf's `admit_bytes 64Kb` is not accepted, so the fixture uses 65536. Q66 is confirmed live (`Scell_log 15qevent early_drop block 10`), and Q73 (sfb prints `rehash 705s`), Q80, Q81, Q83 and Q84 show in the captures. misspell flags dualpi2's `any_ect`; a scoped exclusion in both golangci configs covers the tcaqm and dualpi2 files. **Gate:** two batches on one boot, 132/132 OK, stdout, stderr and rc identical; `TestTcAqmSpace` pins 132 rows, 26 fixtures and 21 cases; no row sends packets. | | V034 | 16P | **Parsers** `pkg/xtcpnl/xtcpnl_tc_aqm.go` (+ `xtcpnl_tc_aqm_test.go`): 13 `TcKind*` constants; TCA_* for red, choke, gred (with VQ enums), sfb, codel, pie, fq_pie, hhf, cake (stats, tin stats), dualpi2; structs for red/gred/sfb qopts and the red, choke, sfb, codel, pie, fq_pie, hhf, dualpi2 and cake xstats. A generic `TcVals` store (32 u64 plus a presence mask) filled from per-kind width tables covers the flat-attribute kinds; widths follow tc's reads (0 = unread, -1 = presence only). **Errors:** an unchecked short read is `ErrTcShort` (Q69, Q77); gred without DPS is `ErrTcMissing` (Q67); gred short is `ErrTcGredSmall` (wraps ErrTcShort, Q72); a VQ entry with rta_len < 4 is `ErrTcShort` rather than a hang (Q71); a VQ DP ≥ 16 is skipped and flagged `VqDpOver` (Q68); VQ_STAT_BYTES keeps the u64 and tc's truncated u32 (Q70). **Plan corrections:** a cake tin missing an attribute tin 0 has sets `TinGap` rather than erroring, since tc's JSON path tests each tin (Q78; gotc refuses in 16R); K38's idle MIN_NETLEN is 65535, not 4294967295; codel's times lose 1 µs in tc's conversion; dualpi2's bare `step_thresh 10` is µs (STEP_THRESH_US). **Size:** gred and cake are pointers, so `TcQopt` is 2040 bytes (HEAD 1680) and `TcXstats` 632 (HEAD 384). **Corpus:** `TestWsTcKinds` decodes cake 155, cake_mq 39, choke 15, codel 20, dualpi2 29, fq_pie 8, gred 18, hhf 20, pie 9, plug 15, red 30, sfb 19, skbprio 201 messages, no errors. **Tests:** `TestParseTcAqm` 35 rows; allocs pinned: skbprio 0, red 1, cake 1, red xstats 0, gred 2, cake xstats 1, plug 0. **Bench (host load ~43, noisy):** red ~331 ns, gred ~1 µs, cake xstats ~634 ns. netlink-audit and kernel-citation-audit clean; both golangci configs 0 issues. | | V035 | 16R | **Printers** `internal/gotc/q_red.go` (red, choke, the shared red flags and qevents, and red_has_block), `q_gred.go`, `q_aqm.go` (sfb, codel, pie, fq_pie, hhf, plug, skbprio), `q_cake.go` (cake, cake_mq), `q_dualpi2.go`, each following its v7.2.0 C printer line by line, with every lead printed as tc prints it: Q66 Scell_log runs into the qevent, Q87 text-only-true flags, Q73 sfb's u32 wrap, Q79 cake's hard newlines under `-o`, Q80/Q81 cake's JSON, Q83/Q84/Q86 dualpi2, Q70 gred's u32 bytes, Q72 gred's raw message inside JSON, Q75/Q76 cake's unnegated, text-only blue_timer, Q74 codel's INT_MIN drop_next. **Refusals** (partial stdout kept, rc 255): gred without DPS (Q67), a VQ_DP of MAX_DPs or more (Q68), a short VQ attribute (Q69), a VQ entry with rta_len < 4 (Q71); a short cake stat (Q77); in text, a cake tin missing an attribute tin 0 has (Q78; JSON tests each tin and prints); a short red qevent block. **qkind.go:** the 13 kinds are registered; every kind tc links now prints, so `tcBuiltinKinds` and `errKind` are gone, and `qdiscKind` cannot fail. `filter show block N` used to refuse any red in the qdisc dump; it now runs red_has_block (qevents_have_block compares every qevent, an unset one's 0 included; a zero block is "Illegal qevent block index" and the dump's -1). sfq's red flags reuse `printRedFlags`. **Tests:** corpus: tcaqm added to `corpusRows` (132), with ng-001..003 as refused writes; 942 tc rows replay. `readbackSkips` empty; `readbackRendered` 1114 → 1250. `TestGotcAqm` 43 rows (positive, negative, boundary, corner), including four `filter show block` rows for red_has_block. The `TestGotcSched` and `TestGotcShow` refusal-by-name rows now expect red and cake to print. **Mutants:** 10/10 killed, each checked to build (Scell_log trailing space, JSON flags only when true, gred bytes as u64, cake skipping `raw`, `ack_filter` key, `_SL_` for cake's hard newlines, blue_timer negated, dualpi2's last print_nl dropped, sfb rehash in u64, plug printing options). Coverage 86.1%. **Notes for 16B:** the kernel sends TCA_GRED_VQ_ENTRY without NLA_F_NESTED (nla_nest_start_noflag), and tc's plain parse_rtattr needs that: a flagged entry would be "ERROR: Failed to parse Virtual Queue entry". **Lint:** the dualpi2 misspell exclusion now matches `ECT` as well as `ect` (uapi names in comments); both configs 0 issues. **PR 353 review (P3):** a short cake tin attribute is no longer a decode error; `TcCakeXstats.TinShort` keeps each tin's mask and `ShortTin(text)` applies the mode's reads: text reads a row only when tin 0 has the attribute (PRINT_TSTAT, q_cake.c:770), JSON each tin's own. So a short tin 1 field tin 0 lacks prints in text (identical to tc 7.2.0 on the review's monitor file: tin headings, rc 0) and is refused in JSON; the Q78 gap test counts a short attribute as present. Rows: 4 in `TestParseTcAqmXstats`, 3 in `TestGotcAqm` (47). | diff --git a/docs/netlink/upstream/iproute2-tc-write.md b/docs/netlink/upstream/iproute2-tc-write.md new file mode 100644 index 000000000..243e7d960 --- /dev/null +++ b/docs/netlink/upstream/iproute2-tc-write.md @@ -0,0 +1,159 @@ +# iproute2 tc qdisc and class writes: help that carries on, ingress that eats words, silent failures and copy-paste messages + +**Status (2026-11-27, increment 17):** + +- **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. +- **Scope:** the write paths of `tc qdisc` and `tc class` (`tc/tc_qdisc.c` tc_qdisc_modify, `tc/tc_class.c` + tc_class_modify), the shared parsers they reach (`tc/m_estimator.c`, `tc/tc_stab.c`, `tc/tc_core.c`, + `tc/tc_util.c`, `lib/utils.c`), and the parse_qopt/parse_copt of increment 9's kinds: pfifo, bfifo, + pfifo_head_drop, prio, pfifo_fast, fq_codel, fq, htb, tbf, sfq, netem, ingress and clsact. Leads are **W1+**; kernel + notes continue [iproute2-tc-aqm.md](iproute2-tc-aqm.md)'s K32–K43 at **K44**. +- **Source:** + - Line numbers are iproute2 **v7.2.0**, the version the corpus was captured with. Kernel behaviour is from the + corpus (kernel 7.3.1) and linux **v7.4-rc4**. + - **"At HEAD"** means the GitHub mirror's `main` on 2026-11-27 (`35033e4713fe`), checked with + `gh api repos/iproute2/iproute2/commits?path=...`. None of the files above has a commit since v7.2.0 + (2026-08-17) except `lib/utils.c`, whose one commit (`552d9842b1f4`) bounds resolve_address's cache and touches + none of the code below. **Every finding is present at HEAD.** +- **How they were found:** in increment 17 ([gotc-status.md](../gotc-status.md), V037–V039). + - The plan's bug-class sweep ([bug-classes.md](bug-classes.md)) listed W1–W9. + - Porting the units (17P, V038) added W10–W14; porting the kind parsers (17W, V039) added W15–W25. + - `gotc` (built with `gotc_write`) replays all 125 tcqwrite rows byte for byte, requests included, and 173 tdc + writes of these kinds exactly. Every captured finding is reproduced by an independent implementation. +- **Corpus:** `pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/` (125 rows), kernel 7.3.1, tc 7.2.0. "ec-N" and "ng-N" below + are its rows. +- **Reachability:** + - **In the corpus:** W1, W2, W3, W4, W9, W22. + - **Latent, with unit rows** in `internal/gotc/qwrite_test.go`, `units_test.go` and `qw_*_test.go`: W5, W6, W8, + W10–W21, W23–W25. + - **Kernel notes:** K44, K45. + - **Dropped:** W7 (parse_estimator's argv step is right). + +## Contents + +- [Summary](#summary) +- [W1, W2, W3. The argument loop](#w1-w2-w3-the-argument-loop) +- [W4, W5, W8. Return codes and unreachable arms](#w4-w5-w8-return-codes-and-unreachable-arms) +- [W6. A class has a sixteenth of a qdisc's room](#w6-a-class-has-a-sixteenth-of-a-qdiscs-room) +- [W9. Percent rates on a device with no speed](#w9-percent-rates-on-a-device-with-no-speed) +- [W10–W14. Units and the size table](#w10w14-units-and-the-size-table) +- [W15–W25. Kind parsers](#w15w25-kind-parsers) +- [W7. Dropped](#w7-dropped) +- [K44, K45. Kernel notes](#k44-k45-kernel-notes) + +## Summary + +| lead | where (v7.2.0) | what | pinned by | gotc | +|---|---|---|---|---| +| W1 | tc_qdisc.c:134, tc_class.c:106 | `help` prints usage, then parsing goes on and the write is sent | ec-088, ec-099 | same | +| W2 | tc_qdisc.c:88-108 | `ingress`/`clsact` overwrite an earlier `handle` and break; later words go to the kind's parser | ec-079, ng-011 | same | +| W3 | tc_qdisc.c:75 | the duplicate check is on a non-zero handle: `handle 0: handle 1:` is accepted; a real duplicate names the word `handle` as the value | ec-089 | same | +| W4 | tc_qdisc.c:160, tc_class.c:124-128 | parser failures return 1, other failures -1 (255) | ng-004, ng-005, ng-019 | same | +| W5 | tc_class.c:133 | class "Garbage instead of arguments" has no newline, and the arm is unreachable (get_qdisc_kind never returns NULL) | unit | same | +| W6 | tc_class.c:56 | class buffer is 4096 vs TCA_BUF_MAX; addattr_l overflow prints and the truncated request is sent | unit | refused | +| W8 | tc_qdisc.c:162, q_fifo.c:91 | pfifo_fast has no parse_qopt: any option is "does not support option parsing", rc 255 | unit | same | +| W9 | tc_util.c:186-223, lib/utils.c:53-103 | a percent rate reads `/sys/class/net/DEV/speed`; a dummy's read fails, two messages and rc 1 | ng-013 | same | +| W10 | lib/utils.c:1643 | get_time has no range check: `5000s` is 705032704 | unit | same | +| W11 | tc_util.c get_rate64 | no overflow check: `inf` is 0, `nan` 9223372036854775808 | unit | same | +| W12 | tc_util.c strtod | strtod takes inf, nan and hex: `0x10bit` is `0x10b` then `it` | unit | same | +| W13 | tc_core.c:200 | `stab tsize 1` with mtu ≥ 2^31 never ends | unit | refused | +| W14 | tc_stab.c:92 | a stab of `mtu` or `tsize` alone fails with no message, rc 255 | unit | same | +| W15 | q_fq.c:197 | an `orphan_mask` error says `Illegal "initial_quantum"` | unit | same | +| W16 | q_fq.c:113,171 | percent `maxrate`/`defrate` go through 32-bit get_percent_rate | — | same | +| W17 | q_htb.c:239,249; q_tbf.c:216,229 | rate tables are built from the 32-bit-clamped rate beside RATE64 | ec-092 | same | +| W18 | q_htb.c:79-83 | `debug` stops silently at the first digit outside 0-3 | unit | same | +| W19 | q_tbf.c:69 | `"limit" and "/latency"`: a stray slash | unit | same | +| W20 | q_sfq.c:78,85 / 46,60 | `depth` errors say `Illegal "flows"`; `quantum` errors say `Illegal "limit"` | unit | same | +| W21 | q_sfq.c:164,176; tc_red.c | red with `avpkt 0` divides by zero (SIGFPE) | unit | refused | +| W22 | q_netem.c:402-414 | `duplicate P C` sets the correlation but does not mark it present, so it is never sent alone | ec-062 | same | +| W23 | q_netem.c:237 | a second `loss` prints `Illegal "duplicate loss argument\n"` with the newline inside the quotes | unit | same | +| W24 | q_netem.c:261-275 | `loss state P13` and `loss gemodel P` set 1-p through set_percent unchecked | unit | same | +| W25 | q_netem.c get_distribution | an empty or comment-only `.dist` file fails with no message | unit | same | + +## W1, W2, W3. The argument loop + +- **W1.** `else if (matches(*argv, "help") == 0) { usage(); }` has no return: usage goes to stderr and the loop goes + on, so `tc qdisc add dev d0 root handle 1: help pfifo` (ec-088) prints the usage and adds the pfifo, rc 0. Same in + tc_class.c:106 (ec-099). +- **W2.** `ingress` and `clsact` set `tcm_handle = TC_H_MAKE(TC_H_INGRESS, 0)` over any earlier `handle`, then + `NEXT_ARG_FWD(); break;`. `handle 5: ingress` sends handle ffff: (ec-079), and `qdisc add ingress dev d0` hands + `dev d0` to ingress_parse_opt: `What is "dev"?`, rc 1 (ng-011). Ingress's own parser skips `handle X` pairs + unchecked. +- **W3.** `if (req.t.tcm_handle) duparg("handle", *argv);` runs before NEXT_ARG, so a zero first handle is not seen + (ec-089: `handle 0: handle 1:` sends 1:), and a real duplicate prints `"handle" is the second value`, naming the + keyword, not the value. The class `classid` check is after NEXT_ARG and names the value. + +## W4, W5, W8. Return codes and unreachable arms + +- **W4.** A kind parser failure is `return 1` (tc_qdisc.c:160); "classless" is `return 1` too; every other failure + is -1, exit 255. It matters in `-batch` only for the exit status (ng-019). +- **W5.** get_qdisc_kind (tc.c:104) never returns NULL for a name: an unknown kind gets a calloc'd util with + parse_noqopt. So the `else` arms with "Garbage instead of arguments" are unreachable, and the class one also lacks + its newline. +- **W8.** pfifo_fast_qdisc_util (q_fifo.c:91) has only a printer, so `qdisc add ... pfifo_fast limit 5` is + `qdisc 'pfifo_fast' does not support option parsing`, rc 255, while every other kind's bad option is rc 1. + +## W6. A class has a sixteenth of a qdisc's room + +tc_class_modify's request has `char buf[4096]`; tc_qdisc_modify's has TCA_BUF_MAX (64 KiB). An attribute that does +not fit makes addattr_l print `addattr_l ERROR: message exceeded bound of N` and return -1, which most parsers ignore; +the truncated request is then sent. gotc's builder refuses such a request instead. + +## W9. Percent rates on a device with no speed + +`htb rate 10%` on a dummy (ng-013): read_prop opens `/sys/class/net/d0/speed`, fgets fails (the kernel returns +EINVAL), and tc prints `property "speed" ... is currently unknown` then `Failed to parse ...`, then htb's own +`Illegal "rate"` and its usage, rc 1. Nothing says that the device simply has no speed. + +## W10–W14. Units and the size table + +Found porting tc_util.c and tc_core.c (V038), every value checked against tc's C built with gcc: + +- **W10.** get_time multiplies and truncates to 32 bits with no check: `5000s` is 705032704 µs, `4294.967296s` is 0. +- **W11.** get_rate64 converts the double with no range check: `inf` gives 0 and `nan` gives 2^63. +- **W12.** strtod accepts `inf`, `nan(...)` and hex floats, so `0x10bit` parses as 0x10b followed by the suffix `it`. +- **W13.** tc_calc_size_table's `while ((s->mtu >> s->cell_log) > s->tsize - 1) s->cell_log++;`: with tsize 1 the + bound is 0; cell_log is `__u8` and the shift count wraps mod 32, so mtu ≥ 2^31 never reaches 0 and tc spins. +- **W14.** parse_size_table returns -1 with no message when check_size_table_opts is false (only `mtu`/`tsize` + given), and tc_qdisc_modify returns -1 silently. + +## W15–W25. Kind parsers + +Found porting the parse_qopts (V039): + +- **W15.** q_fq.c:197, the `orphan_mask` arm, prints `Illegal "initial_quantum"`: a copy of the arm above. +- **W16.** fq's percent `maxrate`/`defrate` use get_percent_rate (32-bit), so 100% of a 400G link is refused although + TCA_FQ_FLOW_MAX_RATE is a u32 of bytes/s anyway; the limit is real, the message is get_rate's. +- **W17.** htb (q_htb.c:239,249) and tbf (q_tbf.c:216,229) call tc_calc_rtable with the rate already clamped to + 2^32-1 while sending the real rate in TCA_*_RATE64 (ec-092, 40gbit). The kernel uses RATE64, so the table is + wrong but unused. +- **W18.** htb `debug` reads up to 16 digits and stops quietly at the first outside 0-3; `opt.debug` is sent. +- **W19.** q_tbf.c:69: `tbf: specifying both "limit" and "/latency" is not allowed`, a stray slash. +- **W20.** q_sfq.c: the `depth` arm's errors print `Illegal "flows"` (78, 85), the `quantum` arm's `Illegal "limit"`. +- **W21.** sfq's red: `burst = (2 * qth_min + qth_max) / (3 * avpkt)` (164) and tc_red_eval_ewma divide by avpkt with + no check, so `avpkt 0` is SIGFPE. gotc refuses rather than panic. +- **W22.** netem's duplicate arm (q_netem.c:402-414) reads an optional correlation into `cor.dup_corr` but, unlike + delay, loss, reorder and corrupt (227, 255, 375, 390), does not `++present[TCA_NETEM_CORR]`; TCA_NETEM_CORR + (582) is sent only when another correlation is. ec-062 shows the bytes. +- **W23.** q_netem.c:237: `explain1("duplicate loss argument\n")` puts a newline inside the quotes of + `Illegal "%s"`. +- **W24.** `loss state P13` sets p31 = 1 - p13 and `loss gemodel P` sets r = 1 - p through set_percent with no range + check. +- **W25.** get_distribution returns an error for a table with no numbers but prints nothing. + +## W7. Dropped + +parse_estimator's two NEXT_ARGs leave argv on the time constant and tc_qdisc_modify's `argc--; argv++` steps past +it; `est_help` prints and does not exit, after which invarg fails the word. Correct. + +## K44, K45. Kernel notes + +- **K44.** Each verb's errno, as the corpus captured them: add on an existing qdisc is `Exclusivity flag on, cannot + modify.` (ng-001); change of a missing qdisc `Qdisc not found. To create specify NLM_F_CREATE flag.` (ng-002); + delete of root without a handle `Cannot delete qdisc with handle of zero.` (ng-003); an unknown kind `Specified + qdisc kind is unknown.` (ng-007); htb and sfq refuse change, replace and link alike with EINVAL `Change operation + not supported by specified qdisc.` (ng-020–025); htb offload on a dummy is ENOTSUP `hw-tc-offload ethtool feature + flag must be on.` (ng-014). +- **K45.** Extack comes back in the ack and tc prints it as `Error: ...` in place of `RTNETLINK answers`; a warning + on success is printed too (ec-092: `Warning: sch_htb: quantum of class 10010 is big.`), rc 0. diff --git a/internal/gotc/corpus_test.go b/internal/gotc/corpus_test.go index e4069da59..a422fa946 100644 --- a/internal/gotc/corpus_test.go +++ b/internal/gotc/corpus_test.go @@ -37,6 +37,10 @@ var corpusRefused = map[string]string{ "tcflower/ng-004": "not implemented: flower ip_proto in a get", } +// qwriteSent are the corpusWrites rows the gotc_write build sends and +// matches (17W). +var qwriteSent = map[string]bool{"tcqdisc/ng-018": true, "tcclass/ng-011": true} + var corpusWrites = map[string]bool{ "tcqdisc/ng-018": true, "tcclass/ng-011": true, "tcfilter/ng-024": true, "tcflower/ng-009": true, "tcaction/ng-006": true, "tcaction2/ng-007": true, @@ -61,6 +65,16 @@ var shareDir = func() string { return d }() +// tcLibTestDir holds the workbench tc's LIBDIR/tc *.dist files, as an +// absolute path taken before any row's Chdir. +var tcLibTestDir = func() string { + d, err := filepath.Abs(filepath.Join("testdata", "tc-lib")) + if err != nil { + panic(err) + } + return d +}() + type cmdJSON struct { ID string `json:"id"` Cmd string `json:"cmd"` @@ -143,6 +157,32 @@ func testSys(t *testing.T, rowDir string) sysFS { t.Fatal(err) } } + // tc's LIBDIR/tc distribution tables (netem's get_distribution), the + // workbench iproute2 7.2.0's, at gotc's default tcLibDir. + dists, err := filepath.Glob(filepath.Join(tcLibTestDir, "*.dist")) + if err != nil || len(dists) == 0 { + t.Fatalf("no tc-lib dist files: %v", err) + } + if err := os.MkdirAll(filepath.Join(root, "usr", "lib", "tc"), 0o755); err != nil { + t.Fatal(err) + } + for _, d := range dists { + b, err := os.ReadFile(d) + if err != nil { + t.Fatal(err) + } + if err := rt.WriteFile("usr/lib/tc/"+filepath.Base(d), b, 0o600); err != nil { + t.Fatal(err) + } + } + // The workbench's dummy d0 has no speed: its sysfs file opens and + // reads EINVAL, which read_prop's fgets reports as unknown (W9). + if err := os.MkdirAll(filepath.Join(root, "sys", "class", "net", "d0"), 0o755); err != nil { + t.Fatal(err) + } + if err := rt.WriteFile("sys/class/net/d0/speed", nil, 0o600); err != nil { + t.Fatal(err) + } return sysFS{root: root, usrDir: confUsrDirCst} } @@ -190,7 +230,12 @@ func TestGotcCorpus(t *testing.T) { if err != nil { t.Fatal(err) } - for _, sp := range []string{"tcclass", "tcfilter", "tcflower", "tcaction", "tcaction2", "tcsched", "tcaqm"} { + spaces := []string{"tcclass", "tcfilter", "tcflower", "tcaction", "tcaction2", "tcsched", "tcaqm"} + if writesBuilt { + spaces = append(spaces, "tcqwrite") + corpusRows["tcqwrite"] = 125 + } + for _, sp := range spaces { more, err := filepath.Glob("../../pkg/xtcpnl/testdata/*/ws/" + sp) if err != nil { t.Fatal(err) @@ -222,7 +267,7 @@ func TestGotcCorpus(t *testing.T) { perBase[filepath.Base(base)]++ t.Run(c.ID, func(t *testing.T) { got, want := corpusRow(t, dir, c) - if corpusWrites[c.ID] { + if corpusWrites[c.ID] && (!writesBuilt || !qwriteSent[c.ID]) { if got.rc != 255 || !strings.Contains(got.stderr, "not implemented") || got.stdout != "" { t.Fatalf("write row not refused: %#v", got) } diff --git a/internal/gotc/gotc.go b/internal/gotc/gotc.go index 00fc42db9..9345aac86 100644 --- a/internal/gotc/gotc.go +++ b/internal/gotc/gotc.go @@ -87,6 +87,8 @@ type runner struct { fProto uint16 // f_proto: the last filter's htons'd protocol, u32 -p's key realms rtRealmTab // rt_names.c's realm table + + wroteOut bool // a write has gone to GOTC_WRITE_OUT, so the next appends } func (r *runner) errf(format string, a ...any) { @@ -425,7 +427,7 @@ func (r *runner) doQdisc(args []string) error { } switch w := args[0]; { case writeVerb(w, "add", "change", "replace", "link", "delete"): - return fmt.Errorf("%w: tc qdisc %s", errNotImplemented, w) + return r.qdiscWrite(w, args[1:]) case listWords(w): return r.qdiscList(args[1:]) case matches(w, helpWord): @@ -443,7 +445,7 @@ func (r *runner) doClass(args []string) error { } switch w := args[0]; { case writeVerb(w, "add", "change", "replace", "delete"): - return fmt.Errorf("%w: tc class %s", errNotImplemented, w) + return r.classWrite(w, args[1:]) case listWords(w): return r.classList(args[1:]) case matches(w, helpWord): diff --git a/internal/gotc/q_aqm.go b/internal/gotc/q_aqm.go index 09d024508..e28a7756d 100644 --- a/internal/gotc/q_aqm.go +++ b/internal/gotc/q_aqm.go @@ -14,11 +14,12 @@ import ( // The option names more than one AQM printer uses, text and JSON alike. const ( - wordLimit = "limit" - wordTarget = "target" - wordEcn = "ecn" - wordAlpha = "alpha" - wordBeta = "beta" + wordLimit = "limit" + wordTarget = "target" + wordEcn = "ecn" + wordAlpha = "alpha" + wordBeta = "beta" + wordCeThreshold = "ce_threshold" ) // sfbMaxProb is q_sfb.c's SFB_MAX_PROB. @@ -125,7 +126,7 @@ func printSfbXstats(r *runner, xs []byte) { var codelFields = []aqmField{ {xtcpnl.TcaCodelLimit, wordLimit, aqmPkts}, {xtcpnl.TcaCodelTarget, wordTarget, aqmTime}, - {xtcpnl.TcaCodelCeThreshold, "ce_threshold", aqmTime}, + {xtcpnl.TcaCodelCeThreshold, wordCeThreshold, aqmTime}, {xtcpnl.TcaCodelInterval, "interval", aqmTime}, {xtcpnl.TcaCodelEcn, wordEcn, aqmFlag}, } diff --git a/internal/gotc/qw_fifo.go b/internal/gotc/qw_fifo.go new file mode 100644 index 000000000..932da5afe --- /dev/null +++ b/internal/gotc/qw_fifo.go @@ -0,0 +1,130 @@ +//go:build gotc_write + +package gotc + +import ( + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// q_fifo.c fifo_parse_opt and q_prio.c prio_parse_opt at iproute2 v7.2.0. + +// fifoParser is fifo_parse_opt for the kind id, which its messages name +// (qu->id): pfifo, bfifo and pfifo_head_drop share it. +func fifoParser(id string) kindParser { + return func(r *runner, args []string, _ string) (func(*xtcpnl.AttrBuilder) error, error) { + ok := 0 + var opt xtcpnl.TcFifoQopt + for ; len(args) > 0; args = args[1:] { + switch args[0] { + case wordLimit: + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + v, good := getSize(args[0]) + if !good { + r.errf("%s: Illegal value for \"limit\": \"%s\"\n", id, args[0]) + return nil, errKindParse + } + opt.Limit = v + ok++ + case helpWord: + r.fifoExplain() + return nil, errKindParse + default: + r.errf("%s: unknown parameter \"%s\"\n", id, args[0]) + r.fifoExplain() + return nil, errKindParse + } + } + if ok == 0 { + return nil, nil + } + return func(ab *xtcpnl.AttrBuilder) error { + var b [xtcpnl.TcFifoQoptSizeCst]byte + return ab.PutBytes(xtcpnl.TcaOptions, opt.Append(b[:0])) + }, nil + } +} + +func (r *runner) fifoExplain() { + r.errf("Usage: ... <[p|b]fifo | pfifo_head_drop> [ limit NUMBER ]\n") +} + +// tcPrioMax is TC_PRIO_MAX. +const tcPrioMax = 15 + +// parsePrioQopt is prio_parse_opt. A band is checked against bands as +// unsigned (`band >= opt.bands`), so a negative bands admits any band. +func parsePrioQopt(r *runner, args []string, _ string) (func(*xtcpnl.AttrBuilder) error, error) { + pmap, idx, mq := false, 0, false + opt := xtcpnl.TcPrioQopt{Bands: 3, Priomap: [16]uint8{1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}} + for ; len(args) > 0; args = args[1:] { + switch a := args[0]; a { + case wordBands: + if pmap { + r.prioExplain() + } + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + v, ok := getInteger(args[0], 10) + if !ok { + r.errf("Illegal \"bands\"\n") + return nil, errKindParse + } + opt.Bands = v + case "priomap": + if pmap { + r.errf("Error: duplicate priomap\n") + return nil, errKindParse + } + pmap = true + case "multiqueue": + mq = true + case helpWord: + r.prioExplain() + return nil, errKindParse + default: + if !pmap { + r.errf("What is \"%s\"?\n", a) + r.prioExplain() + return nil, errKindParse + } + band, ok := getU32(a, 10) // get_unsigned + if !ok { + r.errf("Illegal \"priomap\" element\n") + return nil, errKindParse + } + if band >= cint.Bits(opt.Bands) { + r.errf("\"priomap\" element is out of bands\n") + return nil, errKindParse + } + if idx > tcPrioMax { + r.errf("\"priomap\" index > TC_PRIO_MAX=%d\n", tcPrioMax) + return nil, errKindParse + } + opt.Priomap[idx] = uint8(band & 0xff) + idx++ + } + } + return func(ab *xtcpnl.AttrBuilder) error { + var b [xtcpnl.TcPrioQoptSizeCst]byte + nest, err := ab.BeginNestCompat(xtcpnl.TcaOptions, opt.Append(b[:0])) + if err != nil { + return err + } + if mq { + if err := ab.PutBytes(xtcpnl.TcaPrioMQ, nil); err != nil { + return err + } + } + return ab.EndNestCompat(nest) + }, nil +} + +func (r *runner) prioExplain() { + r.errf("Usage: ... prio bands NUMBER priomap P1 P2...[multiqueue]\n") +} diff --git a/internal/gotc/qw_fq.go b/internal/gotc/qw_fq.go new file mode 100644 index 000000000..c27249148 --- /dev/null +++ b/internal/gotc/qw_fq.go @@ -0,0 +1,524 @@ +//go:build gotc_write + +package gotc + +import ( + "encoding/binary" + "strings" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// tc/q_fq_codel.c fq_codel_parse_opt and tc/q_fq.c fq_parse_opt at +// iproute2 v7.2.0. Each parses every word first, then writes TCA_OPTIONS +// with its attributes in a fixed order, whatever the argv order. + +// getUnsigned is lib/utils.c get_unsigned: strtoul in base, nothing left +// over, no ERANGE, within an unsigned int (get_u32's rules). +func getUnsigned(s string, base uint64) (uint32, bool) { return getU32(s, base) } + +// getU8 is lib/utils.c get_u8. +func getU8(s string, base uint64) (uint8, bool) { + v, ok := getU32(s, base) + if !ok || v > 0xff { + return 0, false + } + return uint8(v), true +} + +// u32Attr is one addattr_l of a __u32 (or int) option. +type u32Attr struct { + t uint16 + v uint32 +} + +// putU32s writes the set attributes in order. +func putU32s(ab *xtcpnl.AttrBuilder, attrs []u32Attr) error { + for _, a := range attrs { + if err := ab.PutU32(a.t, a.v); err != nil { + return err + } + } + return nil +} + +func fqCodelExplain(r *runner) { + r.errf("%s", "Usage: ... fq_codel [ limit PACKETS ] [ flows NUMBER ]\n"+ + "[ memory_limit BYTES ]\n"+ + "[ target TIME ] [ interval TIME ]\n"+ + "[ quantum BYTES ] [ [no]ecn ]\n"+ + "[ ce_threshold TIME ]\n"+ + "[ ce_threshold_selector VALUE/MASK ]\n"+ + "[ drop_batch SIZE ]\n") +} + +// illegal is a parser's `fprintf(stderr, "Illegal \"%s\"\n"); return -1`. +func illegal(r *runner, what string) error { + r.errf("Illegal \"%s\"\n", what) + return errKindParse +} + +// parseFqCodelQopt is fq_codel_parse_opt. +func parseFqCodelQopt(r *runner, args []string, _ string) (func(*xtcpnl.AttrBuilder) error, error) { + var dropBatch, limit, flows, target, interval, quantum uint32 + ceThreshold, memory := ^uint32(0), ^uint32(0) + var ceMask uint8 + ceSel := uint8(0xff) + ecn := int32(-1) + for ; len(args) > 0; args = args[1:] { + a := args[0] + var dst *uint32 + get := getTime + switch a { + case wordLimit: + dst, get = &limit, func(s string) (uint32, bool) { return getUnsigned(s, 0) } + case wordFlows: + dst, get = &flows, func(s string) (uint32, bool) { return getUnsigned(s, 0) } + case wordQuantum: + dst, get = &quantum, func(s string) (uint32, bool) { return getUnsigned(s, 0) } + case "drop_batch": + dst, get = &dropBatch, func(s string) (uint32, bool) { return getUnsigned(s, 0) } + case wordTarget: + dst = &target + case wordCeThreshold: + dst = &ceThreshold + case "memory_limit": + dst, get = &memory, getSize + case "interval": + dst = &interval + case "ce_threshold_selector": + var err error + if args, ceSel, ceMask, err = fqCodelSelector(r, args); err != nil { + return nil, err + } + continue + case wordEcn: + ecn = 1 + continue + case "noecn": + ecn = 0 + continue + case helpWord: + fqCodelExplain(r) + return nil, errKindParse + default: + r.errf("What is \"%s\"?\n", a) + fqCodelExplain(r) + return nil, errKindParse + } + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + v, ok := get(args[0]) + if !ok { + return nil, illegal(r, a) + } + *dst = v + } + return fqCodelAttrs(fqCodelVals{limit, flows, quantum, interval, target, ceThreshold, memory, dropBatch, ecn, ceMask, ceSel}), nil +} + +// fqCodelSelector is the ce_threshold_selector arm: VALUE/MASK, both +// get_u8; args starts at the word and is returned at its value. +func fqCodelSelector(r *runner, args []string) ([]string, uint8, uint8, error) { + if len(args) < 2 { + return nil, 0, 0, r.incomplete() + } + args = args[1:] + val, mask, ok := strings.Cut(args[0], "/") + if !ok { + r.errf("Missing mask for \"ce_threshold_selector\"\n") + return nil, 0, 0, errKindParse + } + m, ok := getU8(mask, 0) + if !ok { + r.errf("Illegal mask for \"ce_threshold_selector\"\n") + return nil, 0, 0, errKindParse + } + v, ok := getU8(val, 0) + if !ok { + return nil, 0, 0, illegal(r, "ce_threshold_selector") + } + return args, v, m, nil +} + +// fqCodelVals is what fq_codel_parse_opt gathered. +type fqCodelVals struct { + limit, flows, quantum, interval, target, ceThreshold, memory, dropBatch uint32 + ecn int32 + ceMask, ceSel uint8 +} + +// fqCodelAttrs is fq_codel_parse_opt's addattrs, in its order. +func fqCodelAttrs(v fqCodelVals) func(*xtcpnl.AttrBuilder) error { + limit, flows, quantum, interval, target, ceThreshold, memory, dropBatch, ecn, ceMask, ceSel := + v.limit, v.flows, v.quantum, v.interval, v.target, v.ceThreshold, v.memory, v.dropBatch, v.ecn, v.ceMask, v.ceSel + var attrs []u32Attr + add := func(cond bool, t uint16, v uint32) { + if cond { + attrs = append(attrs, u32Attr{t, v}) + } + } + add(limit != 0, xtcpnl.TcaFqCodelLimit, limit) + add(flows != 0, xtcpnl.TcaFqCodelFlows, flows) + add(quantum != 0, xtcpnl.TcaFqCodelQuantum, quantum) + add(interval != 0, xtcpnl.TcaFqCodelInterval, interval) + add(target != 0, xtcpnl.TcaFqCodelTarget, target) + add(ecn != -1, xtcpnl.TcaFqCodelEcn, cint.Bits(ecn)) + add(ceThreshold != ^uint32(0), xtcpnl.TcaFqCodelCeThreshold, ceThreshold) + tailAttrs := []u32Attr{} + addT := func(cond bool, t uint16, v uint32) { + if cond { + tailAttrs = append(tailAttrs, u32Attr{t, v}) + } + } + addT(memory != ^uint32(0), xtcpnl.TcaFqCodelMemoryLimit, memory) + addT(dropBatch != 0, xtcpnl.TcaFqCodelDropBatchSize, dropBatch) + return func(ab *xtcpnl.AttrBuilder) error { + m, err := ab.BeginNest(xtcpnl.TcaOptions) + if err != nil { + return err + } + if err := putU32s(ab, attrs); err != nil { + return err + } + if ceSel != 0xff { + if err := ab.PutU8(xtcpnl.TcaFqCodelCeThresholdMask, ceMask); err != nil { + return err + } + if err := ab.PutU8(xtcpnl.TcaFqCodelCeThresholdSelector, ceSel); err != nil { + return err + } + } + if err := putU32s(ab, tailAttrs); err != nil { + return err + } + return ab.EndNest(m) + } +} + +func fqExplain(r *runner) { + r.errf("%s", "Usage: ... fq [ limit PACKETS ] [ flow_limit PACKETS ]\n"+ + " [ quantum BYTES ] [ initial_quantum BYTES ]\n"+ + " [ maxrate RATE ] [ buckets NUMBER ]\n"+ + " [ [no]pacing ] [ refill_delay TIME ]\n"+ + " [ bands 3 priomap P0 P1 ... P14 P15 ]\n"+ + " [ weights W1 W2 W3 ]\n"+ + " [ low_rate_threshold RATE ]\n"+ + " [ orphan_mask MASK]\n"+ + " [ timer_slack TIME]\n"+ + " [ ce_threshold TIME ]\n"+ + " [ horizon TIME ]\n"+ + " [ horizon_{cap|drop} ]\n"+ + " [ offload_horizon TIME ]\n") +} + +// fqIlog2 is q_fq.c ilog2: bits of val-1. +func fqIlog2(val uint32) uint32 { + res := uint32(0) + for val--; val != 0; val >>= 1 { + res++ + } + return res +} + +// fqBands is FQ_BANDS; fqMinWeight is FQ_MIN_WEIGHT. +const ( + fqBands = 3 + fqMinWeight = 16384 +) + +// fqOpt is one of fq's set_* options: its value and whether it was given. +type fqOpt struct { + v uint32 + set bool +} + +// fqState is fq_parse_opt's locals. +type fqState struct { + plimit, flowPlimit, quantum, initQuantum, maxrate, lowRate, defrate fqOpt + refill, orphan, ce, slack, horizon, offload fqOpt + + buckets uint32 + horizonDrop uint8 + pacing int32 + prio xtcpnl.TcPrioQopt + setPriomap bool + setWeights bool + weights [fqBands]int32 +} + +// parseFqQopt is fq_parse_opt. +func parseFqQopt(r *runner, args []string, dev string) (func(*xtcpnl.AttrBuilder) error, error) { + st := &fqState{horizonDrop: 255, pacing: -1} + for ; len(args) > 0; args = args[1:] { + a := args[0] + if dst, get := st.valueOpt(r, a, dev); dst != nil { + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + v, ok := get(args[0]) + if !ok { + return nil, illegal(r, a) + } + *dst = fqOpt{v, true} + continue + } + var err error + if args, err = st.special(r, args); err != nil { + return nil, err + } + } + return st.opts(), nil +} + +// valueOpt is the options that are a word and one value: where it goes +// and how it is read; nil for the others. +func (st *fqState) valueOpt(r *runner, a, dev string) (*fqOpt, func(string) (uint32, bool)) { + unsigned0 := func(s string) (uint32, bool) { return getUnsigned(s, 0) } + rate := func(s string) (uint32, bool) { + if strings.Contains(s, "%") { + return r.getPercentRate(s, dev) + } + return getRate(s) + } + switch a { + case wordLimit: + return &st.plimit, unsigned0 + case "flow_limit": + return &st.flowPlimit, unsigned0 + case "maxrate": + return &st.maxrate, rate + case "low_rate_threshold": + return &st.lowRate, getRate + case wordCeThreshold: + return &st.ce, getTime + case "horizon": + return &st.horizon, getTime + case "offload_horizon": + return &st.offload, getTime + case "defrate": + return &st.defrate, rate + case wordQuantum: + return &st.quantum, unsigned0 + case "initial_quantum": + return &st.initQuantum, unsigned0 + case "refill_delay": + return &st.refill, getTime + } + return nil, nil +} + +// special is the rest of fq_parse_opt's loop: args starts at the word and +// is returned at the last word it took. +func (st *fqState) special(r *runner, args []string) ([]string, error) { + a := args[0] + switch a { + case wordBuckets, "orphan_mask": + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + v, ok := getUnsigned(args[0], 0) + switch { + case !ok && a == wordBuckets: + return nil, illegal(r, a) + case !ok: + return nil, illegal(r, "initial_quantum") // tc's message names the wrong option + case a == wordBuckets: + st.buckets = v + default: + st.orphan = fqOpt{v, true} + } + case "timer_slack": + return st.timerSlack(r, args) + case "horizon_drop": + st.horizonDrop = 1 + case "horizon_cap": + st.horizonDrop = 0 + case "pacing": + st.pacing = 1 + case "nopacing": + st.pacing = 0 + case wordBands: + var err error + if args, err = fqPriomap(r, args, &st.prio, st.setPriomap); err != nil { + return nil, err + } + st.setPriomap = true + case "weights": + return st.parseWeights(r, args) + case helpWord: + fqExplain(r) + return nil, errKindParse + default: + r.errf("What is \"%s\"?\n", a) + fqExplain(r) + return nil, errKindParse + } + return args, nil +} + +func (st *fqState) timerSlack(r *runner, args []string) ([]string, error) { + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + t64, ok := getTime64(args[0]) + if !ok { + return nil, illegal(r, "timer_slack") + } + if t64 < 0 || t64 > 0xffffffff { // timer_slack != t64 + r.errf("Illegal (out of range) \"timer_slack\"\n") + return nil, errKindParse + } + st.slack = fqOpt{uint32(t64), true} + return args, nil +} + +func (st *fqState) parseWeights(r *runner, args []string) ([]string, error) { + if st.setWeights { + r.errf("Duplicate \"weights\"\n") + return nil, errKindParse + } + for i := range fqBands { + if len(args) < 2 { + r.errf("Not enough elements in weights\n") + return nil, errKindParse + } + args = args[1:] + v, ok := getInteger(args[0], 10) + if !ok { + r.errf("Illegal \"weights\" element, positive number expected\n") + return nil, errKindParse + } + if v < fqMinWeight { + r.errf("\"weight\" element %d too small\n", v) + return nil, errKindParse + } + st.weights[i] = v + } + st.setWeights = true + return args, nil +} + +// opts is fq_parse_opt's addattrs, in its order. +func (st *fqState) opts() func(*xtcpnl.AttrBuilder) error { + var head []u32Attr + add := func(o fqOpt, t uint16) { + if o.set { + head = append(head, u32Attr{t, o.v}) + } + } + if st.buckets != 0 { + head = append(head, u32Attr{xtcpnl.TcaFqBucketsLog, fqIlog2(st.buckets)}) + } + add(st.plimit, xtcpnl.TcaFqPlimit) + add(st.flowPlimit, xtcpnl.TcaFqFlowPlimit) + add(st.quantum, xtcpnl.TcaFqQuantum) + add(st.initQuantum, xtcpnl.TcaFqInitialQuantum) + add(fqOpt{cint.Bits(st.pacing), st.pacing != -1}, xtcpnl.TcaFqRateEnable) + add(st.maxrate, xtcpnl.TcaFqFlowMaxRate) + add(st.lowRate, xtcpnl.TcaFqLowRateThreshold) + add(st.defrate, xtcpnl.TcaFqFlowDefaultRate) + add(st.refill, xtcpnl.TcaFqFlowRefillDelay) + add(st.orphan, xtcpnl.TcaFqOrphanMask) + add(st.ce, xtcpnl.TcaFqCeThreshold) + add(st.slack, xtcpnl.TcaFqTimerSlack) + add(st.horizon, xtcpnl.TcaFqHorizon) + return func(ab *xtcpnl.AttrBuilder) error { + m, err := ab.BeginNest(xtcpnl.TcaOptions) + if err != nil { + return err + } + if err := putU32s(ab, head); err != nil { + return err + } + if err := st.putTail(ab); err != nil { + return err + } + return ab.EndNest(m) + } +} + +// putTail is what follows the u32s: horizon_drop, the priomap, the +// weights and offload_horizon. +func (st *fqState) putTail(ab *xtcpnl.AttrBuilder) error { + if st.horizonDrop != 255 { + if err := ab.PutU8(xtcpnl.TcaFqHorizonDrop, st.horizonDrop); err != nil { + return err + } + } + if st.setPriomap { + var b [xtcpnl.TcPrioQoptSizeCst]byte + if err := ab.PutBytes(xtcpnl.TcaFqPriomap, st.prio.Append(b[:0])); err != nil { + return err + } + } + if st.setWeights { + var b [4 * fqBands]byte + w := b[:0] + for _, v := range st.weights { + w = binary.LittleEndian.AppendUint32(w, cint.Bits(v)) + } + if err := ab.PutBytes(xtcpnl.TcaFqWeights, w); err != nil { + return err + } + } + if st.offload.set { + return ab.PutU32(xtcpnl.TcaFqOffloadHorizon, st.offload.v) + } + return nil +} + +// fqPriomap is fq_parse_opt's "bands 3 priomap P0 ... P15": args starts +// at "bands" and is returned at the last element. +func fqPriomap(r *runner, args []string, prio *xtcpnl.TcPrioQopt, dup bool) ([]string, error) { + if dup { + r.errf("Duplicate \"bands\"\n") + return nil, errKindParse + } + *prio = xtcpnl.TcPrioQopt{} + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + bands, ok := getInteger(args[0], 10) + if !ok { + return nil, illegal(r, wordBands) + } + prio.Bands = bands + if bands != fqBands { + r.errf("\"bands\" must be 3\n") + return nil, errKindParse + } + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if args[0] != "priomap" { + r.errf("\"priomap\" expected\n") + return nil, errKindParse + } + for i := range prio.Priomap { + if len(args) < 2 { // NEXT_ARG_OK + r.errf("Not enough elements in priomap\n") + return nil, errKindParse + } + args = args[1:] + band, ok := getUnsigned(args[0], 10) + if !ok { + r.errf("Illegal \"priomap\" element, number in [0..%d] expected\n", bands-1) + return nil, errKindParse + } + if band >= cint.Bits(bands) { + r.errf("\"priomap\" element %d too big\n", band) + return nil, errKindParse + } + prio.Priomap[i] = uint8(band & 0xff) + } + return args, nil +} diff --git a/internal/gotc/qw_fq_test.go b/internal/gotc/qw_fq_test.go new file mode 100644 index 000000000..ad1dd5a46 --- /dev/null +++ b/internal/gotc/qw_fq_test.go @@ -0,0 +1,80 @@ +//go:build gotc_write + +package gotc + +import ( + "bytes" + "encoding/hex" + "errors" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// TestParseFqQopts runs fq_parse_opt's and fq_codel_parse_opt's ports on +// crafted argv: the TCA_OPTIONS bytes, or the error and stderr. +// +// go test -tags gotc_write ./internal/gotc/ -run TestParseFqQopts +func TestParseFqQopts(t *testing.T) { + tests := []struct { + description string + parse kindParser + args string + expected string // hex of the attributes, or "" on error + err error + stderr string // a substring of stderr + }{ + {"positive: fq_codel with no options is an empty nest", parseFqCodelQopt, "", + "04000200", nil, ""}, + {"positive: fq_codel attribute order is fixed, not argv's", parseFqCodelQopt, "flows 8 limit 100", + "14000200" + "0800020064000000" + "0800050008000000", nil, ""}, + {"positive: fq_codel selector writes mask then selector as u8", parseFqCodelQopt, + "ce_threshold_selector 1/3", "14000200" + "05000b0003000000" + "05000a0001000000", nil, ""}, + {"negative: fq_codel selector with no mask", parseFqCodelQopt, "ce_threshold_selector 1", + "", errKindParse, "Missing mask"}, + {"negative: fq_codel unknown word", parseFqCodelQopt, "bogus", "", errKindParse, "What is \"bogus\"?"}, + {"boundary: fq_codel limit at UINT_MAX", parseFqCodelQopt, "limit 4294967295", + "0c000200" + "08000200ffffffff", nil, ""}, + {"boundary: fq_codel limit past UINT_MAX", parseFqCodelQopt, "limit 4294967296", + "", errKindParse, "Illegal \"limit\""}, + {"positive: fq buckets 1024 is log 10", parseFqQopt, "buckets 1024", + "0c000200" + "080008000a000000", nil, ""}, + {"positive: fq horizon_drop is a u8", parseFqQopt, "horizon_drop", + "0c000200" + "05000f0001000000", nil, ""}, + {"negative: fq orphan_mask error names initial_quantum (tc's)", parseFqQopt, "orphan_mask x", + "", errKindParse, "Illegal \"initial_quantum\""}, + {"negative: fq bands must be 3", parseFqQopt, "bands 4 priomap", "", errKindParse, "\"bands\" must be 3"}, + {"negative: fq weight below FQ_MIN_WEIGHT", parseFqQopt, "weights 1 2 3", "", errKindParse, "too small"}, + {"boundary: fq timer_slack past 32 bits", parseFqQopt, "timer_slack 5s", + "", errKindParse, "out of range"}, + {"corner: fq priomap short of 16", parseFqQopt, "bands 3 priomap 0 1", "", errKindParse, + "Not enough elements in priomap"}, + {"corner: fq percent maxrate with no device", parseFqQopt, "maxrate 10%", "", errKindParse, + "No device specified"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + var errb bytes.Buffer + r := &runner{stderr: &errb, sys: emptySys(t)} + opts, err := tc.parse(r, strings.Fields(tc.args), "") + if !errors.Is(err, tc.err) || (tc.err == nil) != (err == nil) { + t.Fatalf("err %v, want %v (stderr %q)", err, tc.err, errb.String()) + } + if !strings.Contains(errb.String(), tc.stderr) { + t.Errorf("stderr %q, want %q in it", errb.String(), tc.stderr) + } + if err != nil { + return + } + buf := make([]byte, 1024) + ab := xtcpnl.NewAttrBuilder(buf) + if err := opts(&ab); err != nil { + t.Fatal(err) + } + if got := hex.EncodeToString(ab.Bytes()); got != tc.expected { + t.Errorf("attrs %s, want %s", got, tc.expected) + } + }) + } +} diff --git a/internal/gotc/qw_htb.go b/internal/gotc/qw_htb.go new file mode 100644 index 000000000..51d628c5a --- /dev/null +++ b/internal/gotc/qw_htb.go @@ -0,0 +1,366 @@ +//go:build gotc_write + +package gotc + +import ( + "encoding/binary" + "math" + "strings" + + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// tc/q_htb.c htb_parse_opt and htb_parse_class_opt at iproute2 v7.2.0. + +// htbExplain is q_htb.c explain. +func (r *runner) htbExplain() { + r.errf("%s", "Usage: ... qdisc add ... htb [default N] [r2q N]\n"+ + " [direct_qlen P] [offload]\n"+ + " default minor id of class to which unclassified packets are sent {0}\n"+ + " r2q DRR quantums are computed as rate in Bps/r2q {10}\n"+ + " debug string of 16 numbers each 0-3 {0}\n\n"+ + " direct_qlen Limit of the direct queue {in packets}\n"+ + " offload enable hardware offload\n"+ + "... class add ... htb rate R1 [burst B1] [mpu B] [overhead O]\n"+ + " [prio P] [slot S] [pslot PS]\n"+ + " [ceil R2] [cburst B2] [mtu MTU] [quantum Q]\n"+ + " rate rate allocated to this class (class can still borrow)\n"+ + " burst max bytes burst which can be accumulated during idle period {computed}\n"+ + " mpu minimum packet size used in rate computations\n"+ + " overhead per-packet size overhead used in rate computations\n"+ + " linklay adapting to a linklayer e.g. atm\n"+ + " ceil definite upper class rate (no borrows) {rate}\n"+ + " cburst burst but for ceil {computed}\n"+ + " mtu max packet size we create rate map for {1600}\n"+ + " prio priority of leaf; lower are served first {0}\n"+ + " quantum how much bytes to serve from leaf at once {use r2q}\n"+ + "\nTC HTB version 3.3\n") +} + +// htbExplain1 is explain1: "Illegal" and the usage; the parser returns -1. +func (r *runner) htbExplain1(arg string) error { + r.errf("Illegal \"%s\"\n", arg) + r.htbExplain() + return errKindParse +} + +// htbWhat is the unknown-word arm. +func (r *runner) htbWhat(arg string) error { + r.errf("What is \"%s\"?\n", arg) + r.htbExplain() + return errKindParse +} + +// parseHtbQopt is htb_parse_opt. +func parseHtbQopt(r *runner, args []string, _ string) (func(*xtcpnl.AttrBuilder) error, error) { + directQlen := uint32(math.MaxUint32) + opt := xtcpnl.TcHtbGlob{Rate2Quantum: 10, Version: 3} + offload := false + for ; len(args) > 0; args = args[1:] { + a := args[0] + var ok bool + switch { + case matches(a, "r2q"): + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if opt.Rate2Quantum, ok = getU32(args[0], 10); !ok { + return nil, r.htbExplain1("r2q") + } + case matches(a, "default"): + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if opt.Defcls, ok = getU32(args[0], 16); !ok { + return nil, r.htbExplain1("default") + } + case matches(a, "debug"): + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + p := args[0] + for i := 0; i < 16 && i < len(p); i++ { + if p[i] < '0' || p[i] > '3' { + break + } + opt.Debug |= uint32(p[i]-'0') << (2 * i) + } + case matches(a, "direct_qlen"): + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + v, ok := getU32(args[0], 10) + if !ok { + return nil, r.htbExplain1("direct_qlen") + } + directQlen = v + case matches(a, "offload"): + offload = true + default: + return nil, r.htbWhat(a) + } + } + return func(ab *xtcpnl.AttrBuilder) error { + m, err := ab.BeginNest(xtcpnl.TcaOptions) + if err != nil { + return err + } + var g [xtcpnl.TcHtbGlobSizeCst]byte + if err := ab.PutBytes(xtcpnl.TcaHtbInit, opt.Append(g[:0])); err != nil { + return err + } + if directQlen != math.MaxUint32 { + if err := ab.PutU32(xtcpnl.TcaHtbDirectQlen, directQlen); err != nil { + return err + } + } + if offload { + if err := ab.PutBytes(xtcpnl.TcaHtbOffload, nil); err != nil { + return err + } + } + return ab.EndNest(m) + }, nil +} + +// getU16 is lib/utils.c get_u16: get_u32's strtoul, capped at 0xffff. +func getU16(s string, base uint64) (uint16, bool) { + v, ok := getU32(s, base) + if !ok || v > math.MaxUint16 { + return 0, false + } + return uint16(v), true +} + +// hzDefault is utils.h HZ, get_hz's fallback. +const hzDefault = 100 + +// getHz is lib/utils.c __get_hz without its HZ, PROC_NET_PSCHED and +// PROC_ROOT overrides: the psched file's fourth word when the third is +// 1000000, else HZ. +func (r *runner) getHz() uint64 { + content, err := r.sys.readFile(pschedPathCst) + if err != nil { + return hzDefault + } + var v [4]uint32 + rest := content + for i := range v { + n, rr, ok := scanHex(rest, 8) + if !ok { + return hzDefault + } + v[i], rest = n, rr + } + if v[2] == 1000000 && v[3] != 0 { + return uint64(v[3]) + } + return hzDefault +} + +// htbRate is the rate and ceil arms: a percent through the device's speed. +func (r *runner) htbRate(s, dev string) (uint64, bool) { + if strings.Contains(s, "%") { + return r.getPercentRate64(s, dev) + } + return getRate64(s) +} + +// htbCopt is htb_parse_class_opt's locals. +type htbCopt struct { + opt xtcpnl.TcHtbOpt + cbuffer uint32 + cellLog, ccellLog int + mtu uint32 + mpu, overhead uint16 + linklayer uint32 + ceil, rate, buffer uint64 +} + +// parseHtbCopt is htb_parse_class_opt. +func parseHtbCopt(r *runner, args []string, dev string) (func(*xtcpnl.AttrBuilder) error, error) { + c := htbCopt{cellLog: -1, ccellLog: -1, mtu: 1600, linklayer: linklayerEthernet} + for ; len(args) > 0; args = args[1:] { + if err := r.htbClassArg(&c, &args, dev); err != nil { + return nil, err + } + } + if c.rate == 0 { + r.errf("\"rate\" is required.\n") + return nil, errKindParse + } + if c.ceil == 0 { + c.ceil = c.rate + } + o := &c.opt + o.Rate.Rate = clampU32(c.rate) + o.Ceil.Rate = clampU32(c.ceil) + hz := r.getHz() + if c.buffer == 0 { + c.buffer = c.rate/hz + uint64(c.mtu) + } + if c.cbuffer == 0 { + c.cbuffer = uint32((c.ceil/hz + uint64(c.mtu)) & math.MaxUint32) + } + var rtab, ctab [256]uint32 + rs := rateSpec{overhead: c.overhead, mpu: c.mpu, rate: o.Rate.Rate} + // tc_calc_rtable takes the spec's own rate: the clamped 32 bits, so a + // rate of 2^32 bytes/s or more gets a table for ~4.3 GB/s. + r.core.calcRtable(&rs, &rtab, c.cellLog, c.mtu, c.linklayer, uint64(rs.rate)) + o.Rate = toTcRateSpec(rs) + o.Buffer = r.core.calcXmittime(c.rate, c.buffer) + if o.Buffer == math.MaxUint32 { + r.errf("htb: burst out of range\n") + return nil, errKindParse + } + cs := rateSpec{overhead: c.overhead, mpu: c.mpu, rate: o.Ceil.Rate} + r.core.calcRtable(&cs, &ctab, c.ccellLog, c.mtu, c.linklayer, uint64(cs.rate)) + o.Ceil = toTcRateSpec(cs) + o.Cbuffer = r.core.calcXmittime(c.ceil, uint64(c.cbuffer)) + return func(ab *xtcpnl.AttrBuilder) error { + m, err := ab.BeginNest(xtcpnl.TcaOptions) + if err != nil { + return err + } + var b8 [8]byte + if c.rate >= 1<<32 { + if err := ab.PutBytes(xtcpnl.TcaHtbRate64, binary.LittleEndian.AppendUint64(b8[:0], c.rate)); err != nil { + return err + } + } + if c.ceil >= 1<<32 { + if err := ab.PutBytes(xtcpnl.TcaHtbCeil64, binary.LittleEndian.AppendUint64(b8[:0], c.ceil)); err != nil { + return err + } + } + var p [xtcpnl.TcHtbOptSizeCst]byte + if err := ab.PutBytes(xtcpnl.TcaHtbParms, o.Append(p[:0])); err != nil { + return err + } + var tb [1024]byte + if err := ab.PutBytes(xtcpnl.TcaHtbRtab, appendTab(tb[:0], &rtab)); err != nil { + return err + } + if err := ab.PutBytes(xtcpnl.TcaHtbCtab, appendTab(tb[:0], &ctab)); err != nil { + return err + } + return ab.EndNest(m) + }, nil +} + +// htbClassArg is one turn of htb_parse_class_opt's loop; args is left at +// the word the loop's step passes. +func (r *runner) htbClassArg(c *htbCopt, args *[]string, dev string) error { + a := (*args)[0] + next := func() (string, error) { + if len(*args) < 2 { + return "", r.incomplete() + } + *args = (*args)[1:] + return (*args)[0], nil + } + var ok bool + switch { + case matches(a, wordPrio), matches(a, wordMtu), matches(a, wordQuantum): + key := wordPrio + dst := &c.opt.Prio + switch { + case matches(a, wordPrio): + case matches(a, wordMtu): + key, dst = wordMtu, &c.mtu + default: + key, dst = wordQuantum, &c.opt.Quantum + } + w, err := next() + if err != nil { + return err + } + if *dst, ok = getU32(w, 10); !ok { + return r.htbExplain1(key) + } + case matches(a, wordMpu), matches(a, wordOverhead): + key, dst := wordMpu, &c.mpu + if !matches(a, wordMpu) { + key, dst = wordOverhead, &c.overhead + } + w, err := next() + if err != nil { + return err + } + if *dst, ok = getU16(w, 10); !ok { + return r.htbExplain1(key) + } + case matches(a, wordLinklayer): + w, err := next() + if err != nil { + return err + } + if c.linklayer, ok = getLinklayer(w); !ok { + return r.htbExplain1(wordLinklayer) + } + case matches(a, wordBurst), a == wordBuffer, a == wordMaxburst: + w, err := next() + if err != nil { + return err + } + if c.buffer, ok = getSize64AndCell(w, &c.cellLog); !ok { + return r.htbExplain1(a) + } + case matches(a, "cburst"), a == "cbuffer", a == "cmaxburst": + w, err := next() + if err != nil { + return err + } + if c.cbuffer, ok = getSizeAndCell(w, &c.ccellLog); !ok { + return r.htbExplain1(a) + } + case a == "ceil", a == wordRate: + w, err := next() + if err != nil { + return err + } + dst := &c.rate + if a == "ceil" { + dst = &c.ceil + } + if *dst != 0 { + r.errf("Double \"%s\" spec\n", a) + return errKindParse + } + if *dst, ok = r.htbRate(w, dev); !ok { + return r.htbExplain1(a) + } + case a == helpWord: + r.htbExplain() + return errKindParse + default: + return r.htbWhat(a) + } + return nil +} + +// clampU32 is `(v >= 1ULL << 32) ? ~0U : v`. +func clampU32(v uint64) uint32 { + if v > math.MaxUint32 { + return math.MaxUint32 + } + return uint32(v) +} + +// toTcRateSpec is the struct tc_ratespec tc_calc_rtable filled. +func toTcRateSpec(s rateSpec) xtcpnl.TcRateSpec { + return xtcpnl.TcRateSpec{CellLog: s.cellLog, Linklayer: s.linklayer, Overhead: s.overhead, + CellAlign: s.cellAlign, Mpu: s.mpu, Rate: s.rate} +} + +// appendTab is a rate table's 256 __u32s. +func appendTab(b []byte, t *[256]uint32) []byte { + for _, v := range t { + b = binary.LittleEndian.AppendUint32(b, v) + } + return b +} diff --git a/internal/gotc/qw_htb_test.go b/internal/gotc/qw_htb_test.go new file mode 100644 index 000000000..0f53298ed --- /dev/null +++ b/internal/gotc/qw_htb_test.go @@ -0,0 +1,82 @@ +//go:build gotc_write + +package gotc + +import ( + "bytes" + "errors" + "testing" + + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// TestParseHtb is q_htb.c's parsers on crafted argv: the return, the +// stderr's first line and, on success, the TCA_OPTIONS length. +// +// go test -tags gotc_write ./internal/gotc/ -run TestParseHtb +func TestParseHtb(t *testing.T) { + type expected struct { + parseErr bool // errKindParse + exit bool // exitCode + stderr string + optLen int + } + tests := []struct { + description string + class bool + args []string + expected expected + }{ + {"positive: qdisc default r2q direct_qlen offload", false, + []string{"default", "10", "r2q", "5", "direct_qlen", "7", "offload"}, expected{optLen: 4 + 24 + 8 + 4}}, + {"positive: class rate alone", true, []string{"rate", "1mbit"}, expected{optLen: 4 + 48 + 2*1028}}, + {"positive: class rate 40gbit adds RATE64", true, []string{"rate", "40gbit"}, + expected{optLen: 4 + 2*12 + 48 + 2*1028}}, + {"negative: qdisc unknown word", false, []string{"bogus"}, + expected{parseErr: true, stderr: "What is \"bogus\"?\n"}}, + {"negative: class needs rate", true, []string{"prio", "1"}, + expected{parseErr: true, stderr: "\"rate\" is required.\n"}}, + {"negative: double rate", true, []string{"rate", "1mbit", "rate", "2mbit"}, + expected{parseErr: true, stderr: "Double \"rate\" spec\n"}}, + {"negative: bad mpu over 16 bits", true, []string{"rate", "1mbit", "mpu", "65536"}, + expected{parseErr: true, stderr: "Illegal \"mpu\"\n"}}, + {"negative: percent rate with no device", true, []string{"rate", "10%"}, + expected{parseErr: true, stderr: "No device specified; specify device to rate limit by percentage\n"}}, + {"boundary: r2q missing its value", false, []string{"r2q"}, expected{exit: true, + stderr: "Command line is not complete. Try option \"help\"\n"}}, + {"boundary: mpu 65535 fits", true, []string{"rate", "1mbit", "mpu", "65535"}, expected{optLen: 4 + 48 + 2*1028}}, + {"corner: class help is explain and -1", true, []string{"help"}, + expected{parseErr: true, stderr: "Usage: ... qdisc add ... htb [default N] [r2q N]\n"}}, + {"corner: debug stops at a bad digit", false, []string{"debug", "0129"}, expected{optLen: 4 + 24}}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + var errb bytes.Buffer + r := &runner{stderr: &errb, sys: emptySys(t), core: tcCore{clockFactor: 1, tickInUsec: 1}} + p := parseHtbQopt + if tc.class { + p = parseHtbCopt + } + opts, err := p(r, tc.args, "") + var code exitCode + if errors.Is(err, errKindParse) != tc.expected.parseErr || errors.As(err, &code) != tc.expected.exit { + t.Fatalf("err %v, want %+v", err, tc.expected) + } + first, _, _ := bytes.Cut(errb.Bytes(), []byte("\n")) + if got := string(first) + "\n"; tc.expected.stderr != "" && got != tc.expected.stderr { + t.Errorf("stderr %q, want %q", got, tc.expected.stderr) + } + if err != nil { + return + } + var buf [8192]byte + ab := xtcpnl.NewAttrBuilder(buf[:]) + if err := opts(&ab); err != nil { + t.Fatal(err) + } + if ab.Len() != tc.expected.optLen { + t.Errorf("TCA_OPTIONS %d bytes, want %d", ab.Len(), tc.expected.optLen) + } + }) + } +} diff --git a/internal/gotc/qw_ingress.go b/internal/gotc/qw_ingress.go new file mode 100644 index 000000000..4f43a0bc2 --- /dev/null +++ b/internal/gotc/qw_ingress.go @@ -0,0 +1,35 @@ +//go:build gotc_write + +package gotc + +import "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + +// q_ingress.c and q_clsact.c parse_qopt at iproute2 v7.2.0. Neither sends +// TCA_OPTIONS. + +// parseIngressQopt is ingress_parse_opt: `handle X` pairs are skipped +// unchecked (NEXT_ARG, then the pair's second word). +func parseIngressQopt(r *runner, args []string, _ string) (func(*xtcpnl.AttrBuilder) error, error) { + for len(args) > 0 { + if args[0] != wordHandle { + r.errf("What is \"%s\"?\n", args[0]) + r.errf("Usage: ... ingress\n") + return nil, errKindParse + } + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[2:] + } + return nil, nil +} + +// parseClsactQopt is clsact_parse_opt: any word is refused. +func parseClsactQopt(r *runner, args []string, _ string) (func(*xtcpnl.AttrBuilder) error, error) { + if len(args) > 0 { + r.errf("What is \"%s\"?\n", args[0]) + r.errf("Usage: ... clsact\n") + return nil, errKindParse + } + return nil, nil +} diff --git a/internal/gotc/qw_netem.go b/internal/gotc/qw_netem.go new file mode 100644 index 000000000..f056f8f2b --- /dev/null +++ b/internal/gotc/qw_netem.go @@ -0,0 +1,679 @@ +//go:build gotc_write + +package gotc + +import ( + "encoding/binary" + "errors" + "math" + "os" + "strings" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// tc/q_netem.c netem_parse_opt at iproute2 v7.2.0, with get_distribution. +// +// TCA_OPTIONS is tc_netem_qopt followed by the netem attributes: tc adds +// it with addattr_l and then stretches its rta_len over everything after +// it (tail->rta_len), with no inner nest header (unlike +// addattr_nest_compat). Every addattr_l is bounded by maxlen 1024 bar the +// two distribution tables (MAX_DIST*2). + +// netemMaxDist is MAX_DIST: a distribution table's entries. +const netemMaxDist = 16 * 1024 + +// netemMaxlen is the maxlen netem passes to addattr_l. +const netemMaxlen = 1024 + +// errNetemBound is an addattr_l over its maxlen: tc prints "addattr_l +// ERROR" and parse_qopt fails; gotc refuses the request instead. +var errNetemBound = errors.New("gotc: netem attribute over addattr_l's maxlen") + +// tcLibDir is get_tc_lib: TC_LIB_DIR, else LIBDIR "/tc/". +func tcLibDir() string { + if d, ok := os.LookupEnv("TC_LIB_DIR"); ok { + return d + } + return "/usr/lib/tc/" +} + +// netemExplain is q_netem.c explain. +func (r *runner) netemExplain() { + r.errf("%s", "Usage: ... netem [ limit PACKETS ]\n"+ + " [ delay TIME [ JITTER [ CORRELATION ] ] ]\n"+ + " [ distribution {uniform|normal|pareto|paretonormal} ]\n"+ + " [ corrupt PERCENT [ CORRELATION ] ]\n"+ + " [ duplicate PERCENT [ CORRELATION ] ]\n"+ + " [ loss random PERCENT [ CORRELATION ] ]\n"+ + " [ loss state P13 [ P31 [ P32 [ P23 [ P14 ] ] ] ] ]\n"+ + " [ loss gemodel PERCENT [ R [ 1-H [ 1-K ] ] ] ]\n"+ + " [ seed SEED ]\n"+ + " [ ecn ]\n"+ + " [ reorder PERCENT [ CORRELATION ] [ gap DISTANCE ] ]\n"+ + " [ rate RATE [ PACKETOVERHEAD ] [ CELLSIZE ] [ CELLOVERHEAD ] ]\n"+ + " [ slot MIN_DELAY [ MAX_DELAY ] [ packets MAX_PACKETS ] [ bytes MAX_BYTES ] ]\n"+ + " [ slot distribution {uniform|normal|pareto|paretonormal|custom}\n"+ + " DELAY JITTER [ packets MAX_PACKETS ] [ bytes MAX_BYTES ] ]\n") +} + +// illegal is explain1 and return -1. +func (r *runner) illegal(arg string) error { + r.errf("Illegal \"%s\"\n", arg) + return errKindParse +} + +// setPercent is set_percent: rint(per * UINT32_MAX) into a __u32. +func setPercent(per float64) uint32 { + return cDoubleToU32(math.RoundToEven(per * math.MaxUint32)) +} + +// getPercent is q_netem.c get_percent. +func getPercent(s string) (uint32, bool) { + per, rc := parsePercent(s) + if rc != 0 { + return 0, false + } + return setPercent(per), true +} + +// getU64 is lib/utils.c get_u64: strtoull, all of it, no ERANGE. +func getU64(s string, base uint64) (uint64, bool) { + if s == "" { + return 0, false + } + v, rest, ok, over := strtoulOver(s, base) + if !ok || rest != "" || over { + return 0, false + } + return v, true +} + +// getS32 is lib/utils.c get_s32: strtol, all of it, within an int32. +func getS32(s string, _ uint64) (int32, bool) { + if s == "" { + return 0, false + } + v, rest, ok, over := strtolOver(s) + if !ok || rest != "" || over || v > math.MaxInt32 || v < math.MinInt32 { + return 0, false + } + return cint.LongToInt(v), true +} + +// isDigitByte is isdigit in the C locale. +func isDigitByte(c byte) bool { return c >= '0' && c <= '9' } + +// nextIsNumber is NEXT_IS_NUMBER: a next word starting with a digit. +func nextIsNumber(a []string) bool { return len(a) > 1 && a[1] != "" && isDigitByte(a[1][0]) } + +// nextIsSigned is NEXT_IS_SIGNED_NUMBER: a digit or '-'. +func nextIsSigned(a []string) bool { + return len(a) > 1 && a[1] != "" && (isDigitByte(a[1][0]) || a[1][0] == '-') +} + +// getDistribution is q_netem.c get_distribution: the numbers of +// /.dist, each strtol'd and kept as an __s16; lines starting +// with '\n' or '#' are skipped. n <= 0 is a failure (an empty table +// silently). +func (r *runner) getDistribution(typ string) ([]int16, int) { + name := tcLibDir() + "/" + typ + ".dist" + if len(name) > 127 { // snprintf(name, 128) + name = name[:127] + } + body, err := r.sys.readFile(name) + if err != nil { + r.errf("No distribution data for %s (%s: %s)\n", typ, name, strerror(errnoOf(err))) + return nil, -1 + } + var data []int16 + for line := range strings.SplitAfterSeq(body, "\n") { + if line == "" || line[0] == '\n' || line[0] == '#' { + continue + } + for p := line; ; { + x, rest, ok, _ := strtolOver(p) + if !ok { + break + } + if len(data) >= netemMaxDist { + r.errf("%s: too much data\n", name) + return nil, -1 + } + data = append(data, cint.Short(uint16(cint.U64Bits(x)&math.MaxUint16))) + p = rest + } + } + return data, len(data) +} + +// netemArgs is what netem_parse_opt gathers. +type netemArgs struct { + opt xtcpnl.TcNetemQopt + cor xtcpnl.TcNetemCorr + reorder xtcpnl.TcNetemProbCorr + corrupt xtcpnl.TcNetemProbCorr + gi xtcpnl.TcNetemGimodel + ge xtcpnl.TcNetemGemodel + rate xtcpnl.TcNetemRate + slot xtcpnl.TcNetemSlot + dist []int16 + slotDist []int16 + lossType uint16 + present [xtcpnl.TcaNetemMaxKnown + 1]int + latency64 int64 + jitter64 int64 + rate64 uint64 + seed uint64 +} + +// parseNetemQopt is netem_parse_opt. +func parseNetemQopt(r *runner, args []string, dev string) (func(*xtcpnl.AttrBuilder) error, error) { + n := &netemArgs{opt: xtcpnl.TcNetemQopt{Limit: 1000}} + for a := args; len(a) > 0; a = a[1:] { + var err error + w := a[0] + switch { + case matches(w, wordLimit): + if a, err = r.nextArg(a); err != nil { + return nil, err + } + v, ok := getSize(a[0]) + if !ok { + return nil, r.illegal(wordLimit) + } + n.opt.Limit = v + case matches(w, wordLatency), matches(w, "delay"): + a, err = r.netemDelay(n, a) + case matches(w, "loss"), matches(w, "drop"): + a, err = r.netemLossArg(n, a) + case matches(w, "seed"): + if a, err = r.nextArg(a); err != nil { + return nil, err + } + n.present[xtcpnl.TcaNetemPrngSeed] = 1 + v, ok := getU64(a[0], 10) + if !ok { + return nil, r.illegal("seed") + } + n.seed = v + case matches(w, wordEcn): + n.present[xtcpnl.TcaNetemEcn] = 1 + case matches(w, "reorder"): + n.present[xtcpnl.TcaNetemReorder] = 1 + a, err = r.netemProbCorr(n, a, &n.reorder, "reorder") + case matches(w, "corrupt"): + n.present[xtcpnl.TcaNetemCorrupt] = 1 + a, err = r.netemProbCorr(n, a, &n.corrupt, "corrupt") + case matches(w, "gap"): + if a, err = r.nextArg(a); err != nil { + return nil, err + } + v, ok := getU32(a[0], 0) + if !ok { + return nil, r.illegal("gap") + } + n.opt.Gap = v + case matches(w, wordDuplicate): + a, err = r.netemDuplicate(n, a) + case matches(w, "distribution"): + if a, err = r.nextArg(a); err != nil { + return nil, err + } + d, sz := r.getDistribution(a[0]) + if sz <= 0 { + return nil, errKindParse + } + n.dist = d + case matches(w, wordRate): + a, err = r.netemRate(n, a, dev) + case matches(w, "slot"): + a, err = r.netemSlot(n, a) + default: + if w != helpWord { + r.errf("What is \"%s\"?\n", w) + } + r.netemExplain() + return nil, errKindParse + } + if err != nil { + return nil, err + } + } + if err := r.netemCheck(n); err != nil { + return nil, err + } + return n.put, nil +} + +// nextArg is NEXT_ARG: the next word, or incomplete_command's exit. +func (r *runner) nextArg(a []string) ([]string, error) { + if len(a) < 2 { + return nil, r.incomplete() + } + return a[1:], nil +} + +// netemDelay is the latency/delay arm: TIME [JITTER [CORRELATION]]. +func (r *runner) netemDelay(n *netemArgs, a []string) ([]string, error) { + a, err := r.nextArg(a) + if err != nil { + return nil, err + } + n.present[xtcpnl.TcaNetemLatency64] = 1 + v, ok := getTime64(a[0]) + if !ok { + return nil, r.illegal(wordLatency) + } + n.latency64 = v + if !nextIsNumber(a) { + return a, nil + } + a = a[1:] + n.present[xtcpnl.TcaNetemJitter64] = 1 + if n.jitter64, ok = getTime64(a[0]); !ok { + return nil, r.illegal(wordLatency) + } + if !nextIsNumber(a) { + return a, nil + } + a = a[1:] + n.present[xtcpnl.TcaNetemCorr]++ + if n.cor.DelayCorr, ok = getPercent(a[0]); !ok { + return nil, r.illegal(wordLatency) + } + return a, nil +} + +// netemLossArg is the loss/drop arm: random (or a bare percent), state or +// gemodel. A second loss is refused with explain1's text and its stray +// newline. +func (r *runner) netemLossArg(n *netemArgs, a []string) ([]string, error) { + if n.opt.Loss > 0 || n.lossType != 0 { + return nil, r.illegal("duplicate loss argument\n") + } + a, err := r.nextArg(a) + if err != nil { + return nil, err + } + switch { + case a[0] != "" && isDigitByte(a[0][0]): + return r.netemRandomLoss(n, a) + case a[0] == "random": + if a, err = r.nextArg(a); err != nil { + return nil, err + } + return r.netemRandomLoss(n, a) + case a[0] == "state": + return r.netemLossState(n, a) + case a[0] == "gemodel": + return r.netemLossGemodel(n, a) + } + r.errf("Unknown loss parameter: %s\n", a[0]) + return nil, errKindParse +} + +func (r *runner) netemRandomLoss(n *netemArgs, a []string) ([]string, error) { + var ok bool + if n.opt.Loss, ok = getPercent(a[0]); !ok { + return nil, r.illegal("loss percent") + } + if nextIsNumber(a) { + a = a[1:] + n.present[xtcpnl.TcaNetemCorr]++ + if n.cor.LossCorr, ok = getPercent(a[0]); !ok { + return nil, r.illegal("loss correlation") + } + } + return a, nil +} + +// netemOptional reads up to len(dst) more percents while the next word is +// a number, each failure naming its own label. +func (r *runner) netemOptional(a []string, dst []*uint32, labels []string) ([]string, error) { + for i := range dst { + if !nextIsNumber(a) { + return a, nil + } + a = a[1:] + v, ok := getPercent(a[0]) + if !ok { + return nil, r.illegal(labels[i]) + } + *dst[i] = v + } + return a, nil +} + +func (r *runner) netemLossState(n *netemArgs, a []string) ([]string, error) { + a, err := r.nextArg(a) + if err != nil { + return nil, err + } + p13, rc := parsePercent(a[0]) + if rc != 0 { + return nil, r.illegal("loss p13") + } + g := &n.gi + g.P13, g.P31, g.P32, g.P23, g.P14 = setPercent(p13), setPercent(1.-p13), setPercent(0), setPercent(1.), setPercent(0) + n.lossType = xtcpnl.NetemLossGI + return r.netemOptional(a, []*uint32{&g.P31, &g.P32, &g.P23, &g.P14}, + []string{"loss p31", "loss p32", "loss p23", "loss p14"}) +} + +func (r *runner) netemLossGemodel(n *netemArgs, a []string) ([]string, error) { + a, err := r.nextArg(a) + if err != nil { + return nil, err + } + p, rc := parsePercent(a[0]) + if rc != 0 { + return nil, r.illegal("loss gemodel p") + } + g := &n.ge + g.P, g.R, g.H, g.K1 = setPercent(p), setPercent(1.-p), setPercent(0), setPercent(0) + n.lossType = xtcpnl.NetemLossGE + if a, err = r.netemOptional(a, []*uint32{&g.R}, []string{"loss gemodel r"}); err != nil || !nextIsNumber(a) { + return a, err + } + a = a[1:] + var ok bool + if g.H, ok = getPercent(a[0]); !ok { + return nil, r.illegal("loss gemodel h") + } + g.H = math.MaxUint32 - g.H // netem's option is 1-h; the kernel takes h + return r.netemOptional(a, []*uint32{&g.K1}, []string{"loss gemodel k"}) +} + +func (r *runner) netemProbCorr(n *netemArgs, a []string, pc *xtcpnl.TcNetemProbCorr, label string) ([]string, error) { + a, err := r.nextArg(a) + if err != nil { + return nil, err + } + var ok bool + if pc.Probability, ok = getPercent(a[0]); !ok { + return nil, r.illegal(label) + } + if nextIsNumber(a) { + a = a[1:] + n.present[xtcpnl.TcaNetemCorr]++ + if pc.Correlation, ok = getPercent(a[0]); !ok { + return nil, r.illegal(label) + } + } + return a, nil +} + +// netemDuplicate is the duplicate arm. Its correlation does not count +// toward present[TCA_NETEM_CORR], so alone it is never sent (W lead). +func (r *runner) netemDuplicate(n *netemArgs, a []string) ([]string, error) { + a, err := r.nextArg(a) + if err != nil { + return nil, err + } + var ok bool + if n.opt.Duplicate, ok = getPercent(a[0]); !ok { + return nil, r.illegal(wordDuplicate) + } + if nextIsNumber(a) { + a = a[1:] + if n.cor.DupCorr, ok = getPercent(a[0]); !ok { + return nil, r.illegal(wordDuplicate) + } + } + return a, nil +} + +func (r *runner) netemRate(n *netemArgs, a []string, dev string) ([]string, error) { + n.present[xtcpnl.TcaNetemRate]++ + a, err := r.nextArg(a) + if err != nil { + return nil, err + } + var ok bool + if strings.Contains(a[0], "%") { + n.rate64, ok = r.getPercentRate64(a[0], dev) + } else { + n.rate64, ok = getRate64(a[0]) + } + if !ok { + return nil, r.illegal(wordRate) + } + if nextIsSigned(a) { + a = a[1:] + if n.rate.PacketOverhead, ok = getS32(a[0], 0); !ok { + return nil, r.illegal(wordRate) + } + } + if nextIsNumber(a) { + a = a[1:] + if n.rate.CellSize, ok = getU32(a[0], 0); !ok { + return nil, r.illegal(wordRate) + } + } + if nextIsSigned(a) { + a = a[1:] + if n.rate.CellOverhead, ok = getS32(a[0], 0); !ok { + return nil, r.illegal(wordRate) + } + } + return a, nil +} + +func (r *runner) netemSlot(n *netemArgs, a []string) ([]string, error) { + var err error + var ok bool + s := &n.slot + if nextIsNumber(a) { + a = a[1:] + n.present[xtcpnl.TcaNetemSlot] = 1 + if s.MinDelay, ok = getTime64(a[0]); !ok { + return nil, r.illegal("slot min_delay") + } + if nextIsNumber(a) { + a = a[1:] + if s.MaxDelay, ok = getTime64(a[0]); !ok || s.MaxDelay < s.MinDelay { + return nil, r.illegal("slot max_delay") + } + } else { + s.MaxDelay = s.MinDelay + } + } else { + if a, err = r.nextArg(a); err != nil { + return nil, err + } + if a[0] != "distribution" { + r.errf("Unknown slot parameter: %s\n", a[0]) + return nil, errKindParse + } + if a, err = r.netemSlotDist(n, a); err != nil { + return nil, err + } + } + if len(a) > 1 && matches(a[1], "packets") { + a = a[1:] + if len(a) < 2 { + return nil, r.illegal("slot packets") + } + if s.MaxPackets, ok = getS32(a[1], 0); !ok { + return nil, r.illegal("slot packets") + } + a = a[1:] + } + if len(a) > 1 && matches(a[1], "bytes") { + a = a[1:] + if len(a) < 2 { + return nil, r.illegal("slot bytes") + } + v, ok := getSize(a[1]) + if !ok { + return nil, r.illegal("slot bytes") + } + s.MaxBytes = cint.Int(v) + a = a[1:] + } + return a, nil +} + +// netemSlotDist is `slot distribution TYPE DELAY JITTER`. +func (r *runner) netemSlotDist(n *netemArgs, a []string) ([]string, error) { + n.present[xtcpnl.TcaNetemSlot] = 1 + a, err := r.nextArg(a) + if err != nil { + return nil, err + } + d, sz := r.getDistribution(a[0]) + if sz <= 0 { + return nil, errKindParse + } + n.slotDist = d + if a, err = r.nextArg(a); err != nil { + return nil, err + } + var ok bool + if n.slot.DistDelay, ok = getTime64(a[0]); !ok { + return nil, r.illegal("slot delay") + } + if a, err = r.nextArg(a); err != nil { + return nil, err + } + if n.slot.DistJitter, ok = getTime64(a[0]); !ok { + return nil, r.illegal("slot jitter") + } + if n.slot.DistJitter <= 0 { + r.errf("Non-positive jitter\n") + return nil, errKindParse + } + return a, nil +} + +// netemCheck is the checks after the loop. +func (r *runner) netemCheck(n *netemArgs) error { + fail := func(msg string) error { + r.errf("%s", msg) + r.netemExplain() + return errKindParse + } + if n.reorder.Probability != 0 { + if n.latency64 == 0 { + return fail("reordering not possible without specifying some delay\n") + } + if n.opt.Gap == 0 { + n.opt.Gap = 1 + } + } else if n.opt.Gap > 0 { + return fail("gap specified without reorder probability\n") + } + if n.present[xtcpnl.TcaNetemEcn] != 0 && n.opt.Loss == 0 && n.lossType == 0 { + return fail("ecn requested without loss model\n") + } + if n.dist != nil && (n.latency64 == 0 || n.jitter64 == 0) { + return fail("distribution specified but no latency and jitter values\n") + } + return nil +} + +// netemAttrs lays out TCA_OPTIONS's payload, checking each addattr_l +// against its maxlen as tc does, from base (the TCA_OPTIONS offset). +type netemAttrs struct { + b []byte + base int +} + +func rtaAlign(n int) int { return (n + 3) &^ 3 } + +// add is addattr_l(n, maxlen, typ, data). +func (p *netemAttrs) add(maxlen int, typ uint16, data []byte) error { + if rtaAlign(4+len(data)) > xtcpnl.TcMaxlenRoom(maxlen, p.base+4+len(p.b)) { + return errNetemBound + } + l, _ := cint.U16(4 + len(data)) + p.b = binary.LittleEndian.AppendUint16(p.b, l) + p.b = binary.LittleEndian.AppendUint16(p.b, typ) + p.b = append(p.b, data...) + for len(p.b)%4 != 0 { + p.b = append(p.b, 0) + } + return nil +} + +func netemLE64(v uint64) []byte { return binary.LittleEndian.AppendUint64(nil, v) } + +func s16s(d []int16) []byte { + b := make([]byte, 0, 2*len(d)) + for _, v := range d { + b = binary.LittleEndian.AppendUint16(b, cint.ShortBits(v)) + } + return b +} + +// put writes TCA_OPTIONS in tc's order. +func (n *netemArgs) put(ab *xtcpnl.AttrBuilder) error { + opt := n.opt.Append(nil) + if rtaAlign(4+len(opt)) > xtcpnl.TcMaxlenRoom(netemMaxlen, ab.Len()) { + return errNetemBound + } + p := &netemAttrs{b: opt, base: ab.Len()} + var err error + add := func(maxlen int, on bool, typ uint16, data func() []byte) { + if err == nil && on { + err = p.add(maxlen, typ, data()) + } + } + pr := n.present + add(netemMaxlen, pr[xtcpnl.TcaNetemLatency64] != 0, xtcpnl.TcaNetemLatency64, + func() []byte { return netemLE64(cint.U64Bits(n.latency64)) }) + add(netemMaxlen, pr[xtcpnl.TcaNetemJitter64] != 0, xtcpnl.TcaNetemJitter64, + func() []byte { return netemLE64(cint.U64Bits(n.jitter64)) }) + add(netemMaxlen, pr[xtcpnl.TcaNetemCorr] != 0, xtcpnl.TcaNetemCorr, func() []byte { return n.cor.Append(nil) }) + add(netemMaxlen, pr[xtcpnl.TcaNetemReorder] != 0, xtcpnl.TcaNetemReorder, + func() []byte { return n.reorder.Append(nil) }) + add(netemMaxlen, pr[xtcpnl.TcaNetemEcn] != 0, xtcpnl.TcaNetemEcn, func() []byte { + u, _ := cint.U32(pr[xtcpnl.TcaNetemEcn]) + return binary.LittleEndian.AppendUint32(nil, u) + }) + add(netemMaxlen, pr[xtcpnl.TcaNetemCorrupt] != 0, xtcpnl.TcaNetemCorrupt, + func() []byte { return n.corrupt.Append(nil) }) + add(netemMaxlen, pr[xtcpnl.TcaNetemSlot] != 0, xtcpnl.TcaNetemSlot, func() []byte { return n.slot.Append(nil) }) + if err == nil && n.lossType != 0 { + err = n.putLoss(p) + } + if pr[xtcpnl.TcaNetemRate] != 0 { + if n.rate64 >= 1<<32 { + add(netemMaxlen, true, xtcpnl.TcaNetemRate64, func() []byte { return netemLE64(n.rate64) }) + n.rate.Rate = math.MaxUint32 + } else { + n.rate.Rate = cint.Low32(n.rate64) + } + add(netemMaxlen, true, xtcpnl.TcaNetemRate, func() []byte { return n.rate.Append(nil) }) + } + add(netemMaxlen, pr[xtcpnl.TcaNetemPrngSeed] != 0, xtcpnl.TcaNetemPrngSeed, func() []byte { return netemLE64(n.seed) }) + add(netemMaxDist*2, n.dist != nil, xtcpnl.TcaNetemDelayDist, func() []byte { return s16s(n.dist) }) + add(netemMaxDist*2, n.slotDist != nil, xtcpnl.TcaNetemSlotDist, func() []byte { return s16s(n.slotDist) }) + if err != nil { + return err + } + return ab.PutBytes(xtcpnl.TcaOptions, p.b) +} + +// putLoss is TCA_NETEM_LOSS|NLA_F_NESTED holding the GI or GE model. +func (n *netemArgs) putLoss(p *netemAttrs) error { + if err := p.add(netemMaxlen, xtcpnl.TcaNetemLoss|unix.NLA_F_NESTED, nil); err != nil { + return err + } + start := len(p.b) - 4 + var err error + if n.lossType == xtcpnl.NetemLossGI { + err = p.add(netemMaxlen, xtcpnl.NetemLossGI, n.gi.Append(nil)) + } else { + err = p.add(netemMaxlen, xtcpnl.NetemLossGE, n.ge.Append(nil)) + } + if err != nil { + return err + } + l, _ := cint.U16(len(p.b) - start) + binary.LittleEndian.PutUint16(p.b[start:], l) + return nil +} diff --git a/internal/gotc/qw_netem_test.go b/internal/gotc/qw_netem_test.go new file mode 100644 index 000000000..8870f1cdd --- /dev/null +++ b/internal/gotc/qw_netem_test.go @@ -0,0 +1,141 @@ +//go:build gotc_write + +package gotc + +import ( + "bytes" + "encoding/binary" + "errors" + "math" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// TestParseNetemQopt is netem_parse_opt's arms and checks, and the +// TCA_OPTIONS it lays out (gotc 17W). +// +// go test -tags gotc_write ./internal/gotc/ -run TestParseNetemQopt +func TestParseNetemQopt(t *testing.T) { + type expected struct { + err error // errKindParse, an exitCode, or nil + stderr string // a substring of stderr ("" is empty stderr) + optsLen int // TCA_OPTIONS's rta_len when err is nil + check func(t *testing.T, opts []byte) + } + attrAt := func(opts []byte, typ uint16) []byte { + for p := 4 + xtcpnl.TcNetemQoptSizeCst; p+4 <= len(opts); { + l := int(binary.LittleEndian.Uint16(opts[p:])) + if binary.LittleEndian.Uint16(opts[p+2:])&^0xc000 == typ { + return opts[p+4 : p+l] + } + p += rtaAlign(l) + } + return nil + } + tests := []struct { + description string + args string + expected expected + }{ + {"positive: delay alone is LATENCY64 after the qopt", "delay 10ms", + expected{optsLen: 4 + 24 + 12, check: func(t *testing.T, o []byte) { + if v := binary.LittleEndian.Uint64(attrAt(o, xtcpnl.TcaNetemLatency64)); v != 10_000_000 { + t.Errorf("latency %d", v) + } + }}}, + {"positive: gemodel sends h as 1-(1-h)", "loss gemodel 1% 10% 70% 0.1%", + expected{optsLen: 4 + 24 + 4 + 20, check: func(t *testing.T, o []byte) { + ge := attrAt(o, xtcpnl.TcaNetemLoss) + if h := binary.LittleEndian.Uint32(ge[4+8:]); h != math.MaxUint32-setPercent(0.7) { + t.Errorf("h %d", h) + } + }}}, + {"negative: reorder without delay", "reorder 25%", + expected{err: errKindParse, stderr: "reordering not possible without specifying some delay\nUsage: ... netem"}}, + {"negative: a second loss is explain1 with its stray newline", "loss 1% loss 2%", + expected{err: errKindParse, stderr: "Illegal \"duplicate loss argument\n\"\n"}}, + {"negative: a missing distribution file", "delay 1ms 1ms distribution nosuch", + expected{err: errKindParse, stderr: "No distribution data for nosuch (/usr/lib/tc//nosuch.dist: "}}, + {"negative: an unknown word", "bogus", expected{err: errKindParse, stderr: "What is \"bogus\"?\nUsage:"}}, + {"boundary: a rate at 2^32 bytes/s sends RATE64 and ~0", "rate 34359738368bit", + expected{optsLen: 4 + 24 + 12 + 20, check: func(t *testing.T, o []byte) { + if attrAt(o, xtcpnl.TcaNetemRate64) == nil || + binary.LittleEndian.Uint32(attrAt(o, xtcpnl.TcaNetemRate)) != math.MaxUint32 { + t.Error("no RATE64 or rate not ~0") + } + }}}, + {"boundary: limit with no value exits", "limit", expected{err: exitCode(-1), stderr: "Command line is not complete"}}, + {"corner: a duplicate correlation alone is not sent (present[CORR] unset)", "duplicate 1% 30%", + expected{optsLen: 4 + 24}}, + {"corner: help is the usage with no What is", "help", expected{err: errKindParse, stderr: "Usage: ... netem"}}, + {"corner: slot distribution with a zero jitter", "slot distribution normal 1ms 0", + expected{err: errKindParse, stderr: "Non-positive jitter\n"}}, + {"corner: ecn with no loss model", "ecn", expected{err: errKindParse, stderr: "ecn requested without loss model\n"}}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + sys := emptySys(t) + writeFiles(t, sys.root, map[string]string{"usr/lib/tc/normal.dist": "# t\n 1 -2 3\n"}) + var errb bytes.Buffer + r := &runner{stderr: &errb, sys: sys} + opts, err := parseNetemQopt(r, strings.Fields(tc.args), "") + if tc.expected.stderr == "" && errb.Len() != 0 || !strings.Contains(errb.String(), tc.expected.stderr) { + t.Errorf("stderr %q, want it to hold %q", errb.String(), tc.expected.stderr) + } + if tc.expected.err != nil { + if !errors.Is(err, tc.expected.err) { + t.Fatalf("err %v, want %v", err, tc.expected.err) + } + return + } + if err != nil { + t.Fatal(err) + } + ab := xtcpnl.NewAttrBuilder(make([]byte, 4096)) + if err := opts(&ab); err != nil { + t.Fatal(err) + } + o := ab.Bytes() + if l := int(binary.LittleEndian.Uint16(o)); l != tc.expected.optsLen || len(o) != rtaAlign(l) { + t.Fatalf("TCA_OPTIONS rta_len %d (%d bytes), want %d", l, len(o), tc.expected.optsLen) + } + if tc.expected.check != nil { + tc.expected.check(t, o) + } + }) + } +} + +// TestGetDistribution is get_distribution's reading of a .dist file. +func TestGetDistribution(t *testing.T) { + tests := []struct { + description string + body string + expected []int16 + n int + }{ + {"positive: comments and blank lines skipped", "# c\n\n 1 2\n-3\n", []int16{1, 2, -3}, 3}, + {"negative: an empty table is a silent failure", "# only\n", nil, 0}, + {"boundary: a long is kept as its low 16 bits", "65537 0x8000\n", []int16{1, math.MinInt16}, 2}, + {"corner: a line's junk ends that line only", "4 x 5\n6\n", []int16{4, 6}, 2}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + sys := emptySys(t) + writeFiles(t, sys.root, map[string]string{"usr/lib/tc/t.dist": tc.body}) + var errb bytes.Buffer + r := &runner{stderr: &errb, sys: sys} + got, n := r.getDistribution("t") + if n != tc.n || len(got) != len(tc.expected) { + t.Fatalf("got %v n=%d, want %v n=%d", got, n, tc.expected, tc.n) + } + for i := range got { + if got[i] != tc.expected[i] { + t.Fatalf("got %v, want %v", got, tc.expected) + } + } + }) + } +} diff --git a/internal/gotc/qw_tbf.go b/internal/gotc/qw_tbf.go new file mode 100644 index 000000000..402d364c3 --- /dev/null +++ b/internal/gotc/qw_tbf.go @@ -0,0 +1,516 @@ +//go:build gotc_write + +package gotc + +import ( + "encoding/binary" + "fmt" + "math" + "strings" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// The words sfq_parse_opt and tbf_parse_opt take more than twice. +const ( + wordFlows = "flows" + wordRedflowlimit = "redflowlimit" + wordMin = "min" + wordMax = "max" + wordBurst = "burst" + wordQuantum = "quantum" +) + +// tc/q_tbf.c tbf_parse_opt and tc/q_sfq.c sfq_parse_opt at iproute2 +// v7.2.0, with tc/tc_red.c tc_red_eval_ewma and tc_red_eval_P. + +func (r *runner) tbfExplain() { + r.errf("%s", "Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS [ mtu BYTES[/BYTES] ]\n"+ + "\t[ peakrate KBPS ] [ latency TIME ] "+ + "[ overhead BYTES ] [ linklayer TYPE ]\n") +} + +func (r *runner) tbfExplain1(arg, val string) { + r.errf("tbf: illegal value for \"%s\": \"%s\"\n", arg, val) +} + +// tbfArgs is tbf_parse_opt's locals. +type tbfArgs struct { + limit, mtu, mpu, latency uint32 + rcell, pcell int + overhead uint16 + linklayer uint32 + rate64, prate64, buf64 uint64 +} + +// tbfRate is the rate and peakrate arms: a '%' is get_percent_rate64. +func (r *runner) tbfRate(name, arg, dev string, v *uint64) bool { + var ok bool + if strings.Contains(arg, "%") { + *v, ok = r.getPercentRate64(arg, dev) + } else { + *v, ok = getRate64(arg) + } + if !ok { + r.tbfExplain1(name, arg) + } + return ok +} + +// tbfWord is one turn of tbf_parse_opt's loop; args[0] is the word, and +// the value (NEXT_ARG) is args[1]. It returns false for tc's return -1. +func (r *runner) tbfWord(t *tbfArgs, a, v, dev string) bool { + dup := func(what string) bool { r.errf("tbf: duplicate \"%s\" specification\n", what); return false } + ok := true + switch { + case matches(a, wordLimit): + if t.limit != 0 { + return dup(wordLimit) + } + if t.latency != 0 { + r.errf("tbf: specifying both \"latency\" and \"limit\" is not allowed\n") + return false + } + if t.limit, ok = getSize(v); !ok { + r.tbfExplain1(wordLimit, v) + } + case matches(a, wordLatency): + if t.latency != 0 { + return dup(wordLatency) + } + if t.limit != 0 { + r.errf("tbf: specifying both \"limit\" and \"/latency\" is not allowed\n") + return false + } + if t.latency, ok = getTime(v); !ok { + r.tbfExplain1(wordLatency, v) + } + case matches(a, wordBurst), a == wordBuffer, a == wordMaxburst: + if t.buf64 != 0 { + return dup("buffer/burst/maxburst") + } + if t.buf64, ok = getSize64AndCell(v, &t.rcell); !ok { + r.tbfExplain1(a, v) + } + case a == wordMtu, a == "minburst": + if t.mtu != 0 { + return dup("mtu/minburst") + } + if t.mtu, ok = getSizeAndCell(v, &t.pcell); !ok { + r.tbfExplain1(a, v) + } + case a == wordMpu: + if t.mpu != 0 { + return dup(wordMpu) + } + if t.mpu, ok = getSize(v); !ok { + r.tbfExplain1(wordMpu, v) + } + case a == wordRate: + if t.rate64 != 0 { + return dup(wordRate) + } + ok = r.tbfRate(wordRate, v, dev, &t.rate64) + case matches(a, wordPeakrate): + if t.prate64 != 0 { + return dup(wordPeakrate) + } + ok = r.tbfRate(wordPeakrate, v, dev, &t.prate64) + case matches(a, wordOverhead): + if t.overhead != 0 { + return dup(wordOverhead) + } + u, good := getU32(v, 10) + if !good || u > math.MaxUint16 { + r.tbfExplain1(wordOverhead, v) + return false + } + t.overhead = uint16(u) + default: // linklayer + if t.linklayer, ok = getLinklayer(v); !ok { + r.tbfExplain1(wordLinklayer, v) + } + } + return ok +} + +// tbfTakesValue is whether the word is one of tbf's options (all take a +// value) or "help"/unknown. +func tbfTakesValue(a string) bool { + return matches(a, wordLimit) || matches(a, wordLatency) || matches(a, wordBurst) || a == wordBuffer || + a == wordMaxburst || a == wordMtu || a == "minburst" || a == wordMpu || a == wordRate || + matches(a, wordPeakrate) || matches(a, wordOverhead) || matches(a, wordLinklayer) +} + +// parseTbfQopt is tbf_parse_opt. +func parseTbfQopt(r *runner, args []string, dev string) (func(*xtcpnl.AttrBuilder) error, error) { + t := tbfArgs{rcell: -1, pcell: -1, linklayer: linklayerEthernet} + for ; len(args) > 0; args = args[1:] { + a := args[0] + if !tbfTakesValue(a) { + if a != helpWord { + r.errf("tbf: unknown parameter \"%s\"\n", a) + } + r.tbfExplain() + return nil, errKindParse + } + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if !r.tbfWord(&t, a, args[0], dev) { + return nil, errKindParse + } + } + bad := false + if t.rate64 == 0 { + r.errf("tbf: the \"rate\" parameter is mandatory.\n") + bad = true + } + if t.buf64 == 0 { + r.errf("tbf: the \"burst\" parameter is mandatory.\n") + bad = true + } + if t.prate64 != 0 && t.mtu == 0 { + r.errf("tbf: when \"peakrate\" is specified, \"mtu\" must also be specified.\n") + bad = true + } + if t.limit == 0 && t.latency == 0 { + r.errf("tbf: either \"limit\" or \"latency\" is required.\n") + bad = true + } + if bad { + r.tbfExplain() + return nil, errKindParse + } + return r.tbfBuild(&t) +} + +// sat32 is `v >= 1ULL<<32 ? ~0U : v`. +func sat32(v uint64) uint32 { + if v > math.MaxUint32 { + return math.MaxUint32 + } + return cint.Low32(v) +} + +// tbfBuild is tbf_parse_opt after the checks: the limit from latency, the +// tables, and the attributes. +func (r *runner) tbfBuild(t *tbfArgs) (func(*xtcpnl.AttrBuilder) error, error) { + var opt xtcpnl.TcTbfQopt + opt.Limit = t.limit + if opt.Limit == 0 { + lim := float64(t.rate64)*float64(t.latency)/timeUnitsPerSec + float64(t.buf64) + if t.prate64 != 0 { + lim2 := float64(t.prate64)*float64(t.latency)/timeUnitsPerSec + float64(t.mtu) + if lim2 < lim { + lim = lim2 + } + } + opt.Limit = cDoubleToU32(lim) + } + var rtab, ptab [256]uint32 + rs := rateSpec{rate: sat32(t.rate64), mpu: uint16(t.mpu & math.MaxUint16), overhead: t.overhead} + r.core.calcRtable(&rs, &rtab, t.rcell, t.mtu, t.linklayer, uint64(rs.rate)) + opt.Buffer = r.core.calcXmittime(uint64(rs.rate), t.buf64) + if opt.Buffer == math.MaxUint32 { + r.errf("tbf: burst out of range\n") + return nil, errKindParse + } + ps := rateSpec{rate: sat32(t.prate64)} + if ps.rate != 0 { + ps.mpu, ps.overhead = rs.mpu, t.overhead + r.core.calcRtable(&ps, &ptab, t.pcell, t.mtu, t.linklayer, uint64(ps.rate)) + opt.Mtu = r.core.calcXmittime(uint64(ps.rate), uint64(t.mtu)) + } + opt.Rate, opt.Peakrate = rs.spec(), ps.spec() + return func(ab *xtcpnl.AttrBuilder) error { + nest, err := ab.BeginNest(xtcpnl.TcaOptions) + if err != nil { + return err + } + var pb [xtcpnl.TcTbfQoptSizeCst]byte + if err := ab.PutBytes(xtcpnl.TcaTbfParms, opt.Append(pb[:0])); err != nil { + return err + } + if t.buf64 <= math.MaxUint32 { + if err := ab.PutU32(xtcpnl.TcaTbfBurst, cint.Low32(t.buf64)); err != nil { + return err + } + } + if t.rate64 > math.MaxUint32 { + if err := putU64(ab, xtcpnl.TcaTbfRate64, t.rate64); err != nil { + return err + } + } + if err := putTable(ab, xtcpnl.TcaTbfRtab, &rtab); err != nil { + return err + } + if ps.rate != 0 { + if t.prate64 > math.MaxUint32 { + if err := putU64(ab, xtcpnl.TcaTbfPrate64, t.prate64); err != nil { + return err + } + } + if err := ab.PutU32(xtcpnl.TcaTbfPburst, t.mtu); err != nil { + return err + } + if err := putTable(ab, xtcpnl.TcaTbfPtab, &ptab); err != nil { + return err + } + } + return ab.EndNest(nest) + }, nil +} + +// spec is the rateSpec as the wire struct. +func (s rateSpec) spec() xtcpnl.TcRateSpec { + return xtcpnl.TcRateSpec{CellLog: s.cellLog, Linklayer: s.linklayer, Overhead: s.overhead, + CellAlign: s.cellAlign, Mpu: s.mpu, Rate: s.rate} +} + +// putU64 is addattr_l of a __u64. +func putU64(ab *xtcpnl.AttrBuilder, t uint16, v uint64) error { + var b [8]byte + return ab.PutBytes(t, binary.LittleEndian.AppendUint64(b[:0], v)) +} + +// putTable is addattr_l of a __u32 rtab[256]. +func putTable(ab *xtcpnl.AttrBuilder, t uint16, tab *[256]uint32) error { + var b [1024]byte + o := b[:0] + for _, v := range tab { + o = binary.LittleEndian.AppendUint32(o, v) + } + return ab.PutBytes(t, o) +} + +func (r *runner) sfqExplain() { + r.errf("%s", "Usage: ... sfq\t[ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]\n"+ + "\t\t[ divisor NUMBER ] [ flows NUMBER] [ depth NUMBER ]\n"+ + "\t\t[ headdrop ]\n"+ + "\t\t[ redflowlimit BYTES ] [ min BYTES ] [ max BYTES ]\n"+ + "\t\t[ avpkt BYTES ] [ burst PACKETS ] [ probability P ]\n"+ + "\t\t[ ecn ] [ harddrop ]\n") +} + +// sfqArgs is sfq_parse_opt's locals. +type sfqArgs struct { + opt xtcpnl.TcSfqQoptV1 + ok, red int + burst uint32 + avpkt uint32 + probability float64 +} + +// sfqU32 are sfq's get_u32 (and get_unsigned) words: the field and the +// word its message names ("depth" says "flows", tc's own slip). +func (s *sfqArgs) sfqU32(a string) (*uint32, string, *int) { + switch a { + case wordLimit: + return &s.opt.V0.Limit, wordLimit, &s.ok + case wordDivisor: + return &s.opt.V0.Divisor, wordDivisor, &s.ok + case wordFlows: + return &s.opt.V0.Flows, wordFlows, &s.ok + case "depth": + return &s.opt.Depth, wordFlows, &s.ok + case wordRedflowlimit: + return &s.opt.Limit, wordRedflowlimit, &s.red + case wordMin: + return &s.opt.QthMin, wordMin, &s.red + case wordMax: + return &s.opt.QthMax, wordMax, &s.red + case wordBurst: + return &s.burst, wordBurst, &s.red + } + return nil, "", nil +} + +// sfqWord is one valued word of sfq_parse_opt's loop. +func (r *runner) sfqWord(s *sfqArgs, a, v string) bool { + if p, name, cnt := s.sfqU32(a); p != nil { + u, ok := getU32(v, 0) + if !ok { + r.errf("Illegal \"%s\"\n", name) + return false + } + *p = u + if a == wordLimit && u < 2 { + r.errf("Illegal \"limit\", must be > 1\n") + return false + } + *cnt++ + return true + } + switch a { + case wordQuantum: + u, ok := getSize(v) + if !ok { + r.errf("Illegal \"limit\"\n") // tc's message for quantum + return false + } + s.opt.V0.Quantum = u + s.ok++ + case "perturb": + n, ok := getInteger(v, 0) + if !ok { + r.errf("Illegal \"perturb\"\n") + return false + } + s.opt.V0.PerturbPeriod = n + s.ok++ + case "avpkt": + u, ok := getSize(v) + if !ok { + r.errf("Illegal \"avpkt\"\n") + return false + } + s.avpkt = u + s.red++ + default: // probability: sscanf %lg + p, rest, _ := cStrtod(v) + if rest == v { + r.errf("Illegal \"probability\"\n") + return false + } + s.probability = p + s.red++ + } + return true +} + +// parseSfqQopt is sfq_parse_opt. +func parseSfqQopt(r *runner, args []string, _ string) (func(*xtcpnl.AttrBuilder) error, error) { + s := sfqArgs{avpkt: 1000, probability: 0.02} + for ; len(args) > 0; args = args[1:] { + a := args[0] + switch a { + case "headdrop": + s.opt.Headdrop = 1 + s.ok++ + continue + case wordEcn: + s.opt.Flags |= xtcpnl.TcRedEcn + s.red++ + continue + case "harddrop": + s.opt.Flags |= xtcpnl.TcRedHarddrop + s.red++ + continue + case wordQuantum, "perturb", wordLimit, wordDivisor, wordFlows, "depth", wordRedflowlimit, wordMin, wordMax, + wordBurst, "avpkt", "probability": + default: + if a != helpWord { + r.errf("What is \"%s\"?\n", a) + } + r.sfqExplain() + return nil, errKindParse + } + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if !r.sfqWord(&s, a, args[0]) { + return nil, errKindParse + } + } + if s.red != 0 && s.opt.Limit != 0 && s.avpkt == 0 { + return nil, fmt.Errorf("%w: sfq red with avpkt 0 (tc divides by it, SIGFPE)", errNotImplemented) + } + if s.red != 0 && !r.sfqRedParse(&s) { + return nil, errKindParse + } + if s.ok == 0 && s.red == 0 { + return nil, nil + } + opt := s.opt + return func(ab *xtcpnl.AttrBuilder) error { + var b [xtcpnl.TcSfqQoptV1SizeCst]byte + return ab.PutBytes(xtcpnl.TcaOptions, opt.Append(b[:0])) + }, nil +} + +// sfqRedParse is sfq_parse_opt's red block. +func (r *runner) sfqRedParse(s *sfqArgs) bool { + o := &s.opt + if o.Limit == 0 { + r.errf("Required parameter (redflowlimit) is missing\n") + return false + } + if o.QthMax == 0 { + o.QthMax = o.Limit / 4 + } + if o.QthMin == 0 { + o.QthMin = o.QthMax / 3 + } + if s.burst == 0 { + s.burst = (2*o.QthMin + o.QthMax) / (3 * s.avpkt) // unsigned, wraps as C's; avpkt 0 is SIGFPE in tc + } + if o.QthMax > o.Limit { + r.errf("\"max\" is larger than \"limit\"\n") + return false + } + if o.QthMin >= o.QthMax { + r.errf("\"min\" is not smaller than \"max\"\n") + return false + } + wlog := r.redEvalEwma(o.QthMin, s.burst, s.avpkt) + if wlog < 0 { + r.errf("SFQ: failed to calculate EWMA constant.\n") + return false + } + if wlog >= 10 { + r.errf("SFQ: WARNING. Burst %d seems to be too large.\n", s.burst) + } + o.Wlog = uint8(wlog) + plog := redEvalP(o.QthMin, o.QthMax, s.probability) + if plog < 0 { + r.errf("SFQ: failed to calculate probability.\n") + return false + } + o.Plog = uint8(plog) + o.MaxP = cDoubleToU32(s.probability * math.Pow(2, 32)) + return true +} + +// redEvalP is tc_red_eval_P. +func redEvalP(qmin, qmax uint32, prob float64) int { + i := cint.Int(qmax - qmin) + if i == 0 { + return 0 + } + if i < 0 { + return -1 + } + prob /= float64(i) + n := 0 + for ; n < 32; n++ { + if prob > 1.0 { + break + } + prob *= 2 + } + if n >= 32 { + return -1 + } + return n +} + +// redEvalEwma is tc_red_eval_ewma. +func (r *runner) redEvalEwma(qmin, burst, avpkt uint32) int { + w := 0.5 + a := float64(burst) + 1 - float64(qmin)/float64(avpkt) + if a < 1.0 { + r.errf("tc_red_eval_ewma() burst %d is too small ? Try burst %d\n", burst, 1+qmin/avpkt) + return -1 + } + for wlog := 1; wlog < 32; wlog++ { + if a <= (1-math.Pow(1-w, float64(burst)))/w { + return wlog + } + w /= 2 + } + return -1 +} diff --git a/internal/gotc/qw_tbf_test.go b/internal/gotc/qw_tbf_test.go new file mode 100644 index 000000000..d7db6e259 --- /dev/null +++ b/internal/gotc/qw_tbf_test.go @@ -0,0 +1,128 @@ +//go:build gotc_write + +package gotc + +import ( + "bytes" + "errors" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// TestParseTbfSfq is tbf_parse_opt's and sfq_parse_opt's refusals and +// messages, and their attribute layout's length (the bytes are the +// tcqwrite corpus's). +// +// go test -tags gotc_write ./internal/gotc/ -run TestParseTbfSfq +func TestParseTbfSfq(t *testing.T) { + tests := []struct { + description string + parse kindParser + args []string + expected struct { + ok bool + stderr string // a substring + attrs int // the opts' length, when ok and non-zero + } + }{} + add := func(d string, p kindParser, args string, ok bool, stderr string, attrs int) { + tests = append(tests, struct { + description string + parse kindParser + args []string + expected struct { + ok bool + stderr string + attrs int + } + }{d, p, strings.Fields(args), struct { + ok bool + stderr string + attrs int + }{ok, stderr, attrs}}) + } + // TCA_OPTIONS nest 4 + PARMS 4+36 + BURST 8 + RTAB 4+1024. + add("positive: tbf rate burst limit", parseTbfQopt, "rate 1mbit burst 10k limit 3000", true, "", 1080) + add("positive: tbf peakrate adds PBURST and PTAB", parseTbfQopt, + "rate 1mbit burst 10k latency 50ms peakrate 2mbit mtu 1600", true, "", 1080+8+1028) + add("positive: tbf rate64 above 2^32 bytes/s", parseTbfQopt, "rate 40gbit burst 1m limit 10m", true, "", 1080+12) + add("negative: tbf with nothing lists every missing one", parseTbfQopt, "", false, + "tbf: the \"rate\" parameter is mandatory.\ntbf: the \"burst\" parameter is mandatory.\n", 0) + add("negative: tbf limit then latency", parseTbfQopt, "limit 1k latency 1ms", false, + "specifying both \"limit\" and \"/latency\"", 0) + add("negative: tbf an unknown word", parseTbfQopt, "foo", false, "tbf: unknown parameter \"foo\"", 0) + add("negative: tbf duplicate rate", parseTbfQopt, "rate 1mbit rate 2mbit", false, "duplicate \"rate\"", 0) + add("boundary: tbf overhead 65536 is not a u16", parseTbfQopt, "overhead 65536", false, + "illegal value for \"overhead\"", 0) + add("corner: tbf help is explain and -1", parseTbfQopt, "help", false, "Usage: ... tbf", 0) + add("positive: sfq perturb", parseSfqQopt, "perturb 10", true, "", 4+xtcpnl.TcSfqQoptV1SizeCst) + add("positive: sfq no words sends no options", parseSfqQopt, "", true, "", 0) + add("positive: sfq red mode", parseSfqQopt, "redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn", + true, "", 4+xtcpnl.TcSfqQoptV1SizeCst) + add("negative: sfq red without redflowlimit", parseSfqQopt, "ecn", false, + "Required parameter (redflowlimit) is missing", 0) + add("boundary: sfq limit 1", parseSfqQopt, "limit 1", false, "Illegal \"limit\", must be > 1", 0) + add("corner: sfq depth's message says flows", parseSfqQopt, "depth x", false, "Illegal \"flows\"", 0) + add("corner: sfq quantum's message says limit", parseSfqQopt, "quantum x", false, "Illegal \"limit\"", 0) + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + var errb bytes.Buffer + r := &runner{stderr: &errb, core: tcCore{clockFactor: 1, tickInUsec: 1}} + opts, err := tc.parse(r, tc.args, "d0") + if (err == nil) != tc.expected.ok { + t.Fatalf("err %v, want ok=%t; stderr %q", err, tc.expected.ok, errb.String()) + } + if err != nil && !errors.Is(err, errKindParse) { + t.Fatalf("err %v is not errKindParse", err) + } + if !strings.Contains(errb.String(), tc.expected.stderr) { + t.Errorf("stderr %q lacks %q", errb.String(), tc.expected.stderr) + } + if err != nil { + return + } + n := 0 + if opts != nil { + ab := xtcpnl.NewAttrBuilder(make([]byte, 8192)) + if err := opts(&ab); err != nil { + t.Fatal(err) + } + n = ab.Len() + } + if n != tc.expected.attrs { + t.Errorf("attrs %d bytes, want %d", n, tc.expected.attrs) + } + }) + } +} + +// TestRedEval is tc_red_eval_P and tc_red_eval_ewma; expected values are +// tc_red.c compiled with gcc. +func TestRedEval(t *testing.T) { + tests := []struct { + description string + qmin, qmax uint32 + prob float64 + burst, avpkt uint32 + expectedP, ewmaW int + }{ + {"positive: sfq's defaults", 8000, 60000, 0.02, 0, 1000, 22, -1}, + {"positive: a burst that fits", 8000, 60000, 0.2, 30, 1000, 18, 6}, + {"boundary: qmin == qmax is 0; burst 30 never fits", 5, 5, 0.5, 30, 1000, 0, -1}, + {"corner: qmax below qmin is -1", 6, 5, 0.5, 30, 1000, -1, -1}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := redEvalP(tc.qmin, tc.qmax, tc.prob); got != tc.expectedP { + t.Errorf("redEvalP = %d, want %d", got, tc.expectedP) + } + var errb bytes.Buffer + r := &runner{stderr: &errb} + if got := r.redEvalEwma(tc.qmin, tc.burst, tc.avpkt); got != tc.ewmaW { + t.Errorf("redEvalEwma = %d, want %d", got, tc.ewmaW) + } + }) + } +} diff --git a/internal/gotc/qwrite.go b/internal/gotc/qwrite.go new file mode 100644 index 000000000..b1de7b9c6 --- /dev/null +++ b/internal/gotc/qwrite.go @@ -0,0 +1,778 @@ +//go:build gotc_write + +// gotc_write builds gotc's qdisc and class writes. Without the tag gotc +// refuses every write (qwrite_off.go), as it did before increment 17. + +package gotc + +import ( + "errors" + "fmt" + "math" + "os" + "strconv" + "strings" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// tc/tc_qdisc.c tc_qdisc_modify and tc/tc_class.c tc_class_modify at +// iproute2 v7.2.0, with m_estimator.c parse_estimator, tc_stab.c +// parse_size_table and the kinds' parse_qopt and parse_copt (qw_*.go). +// +// gotc never applies a write (gotc-status.md, increment 17: dry-run, as +// goip's decision 5). A replay source compares the request with tc's, +// byte for byte, and answers with the kernel's recorded ack; on the kernel +// socket the request goes to the file GOTC_WRITE_OUT names, and without it +// gotc refuses (ErrWriteNotApplied). + +// ErrWriteNotApplied is a write with no replay and no GOTC_WRITE_OUT. +var ErrWriteNotApplied = errors.New("gotc never applies a write; set " + writeOutEnvCst + + " to receive the request it would send") + +// writeOutEnvCst names the file the requests of a run are written to, one +// after another. +const writeOutEnvCst = "GOTC_WRITE_OUT" + +// errKindParse is a kind's parse_qopt or parse_copt returning non-zero: +// tc_qdisc_modify and tc_class_modify return 1 for it (W4). +var errKindParse = errors.New("gotc: the kind's parser failed") + +// kindParser is a qdisc_util's parse_qopt or parse_copt: args are the +// words after the kind and dev is the device (`d`, "" for none). It +// returns what it would addattr, run later in tc's attribute order, or +// errKindParse (or an exitCode, for invarg and the like). +type kindParser func(r *runner, args []string, dev string) (func(*xtcpnl.AttrBuilder) error, error) + +// qoptParsers are the parse_qopts gotc clones: increment 9's kinds. A nil +// parser is a qdisc_util with no parse_qopt. A kind in qdiscUtils outside +// the map is refused by name until its increment (18, 19). +var qoptParsers = map[string]kindParser{ + xtcpnl.TcKindPfifo: fifoParser(xtcpnl.TcKindPfifo), + xtcpnl.TcKindBfifo: fifoParser(xtcpnl.TcKindBfifo), + xtcpnl.TcKindPfifoHeadDrop: fifoParser(xtcpnl.TcKindPfifoHeadDrop), + xtcpnl.TcKindPrio: parsePrioQopt, + xtcpnl.TcKindPfifoFast: nil, // q_fifo.c's pfifo_fast_qdisc_util has no parse_qopt (W8) + xtcpnl.TcKindFqCodel: parseFqCodelQopt, + xtcpnl.TcKindFq: parseFqQopt, + xtcpnl.TcKindHtb: parseHtbQopt, + xtcpnl.TcKindTbf: parseTbfQopt, + xtcpnl.TcKindSfq: parseSfqQopt, + xtcpnl.TcKindNetem: parseNetemQopt, + xtcpnl.TcKindIngress: parseIngressQopt, + xtcpnl.TcKindClsact: parseClsactQopt, +} + +// coptParsers are the parse_copts gotc clones. A kind whose qdisc_util has +// a parse_copt (printCopt stands for it) but is not here is refused. +var coptParsers = map[string]kindParser{ + xtcpnl.TcKindHtb: parseHtbCopt, +} + +// Words the kind parsers take more than twice. +const ( + wordBuckets = "buckets" + wordDivisor = "divisor" + wordDuplicate = "duplicate" + wordEstimator = "estimator" + wordLatency = "latency" + wordLinklayer = "linklayer" + wordMpu = "mpu" + wordMtu = "mtu" + wordOverhead = "overhead" + wordPeakrate = "peakrate" + wordPrio = "prio" + wordRate = "rate" +) + +// More words the kind parsers share. +const ( + wordBands = "bands" + wordBuffer = "buffer" + wordMaxburst = "maxburst" +) + +// wordHandle is the qdisc and class handle keyword. +const wordHandle = "handle" + +// truncKind is `k`, FILTER_NAMESZ: the kind's first 15 bytes. +func truncKind(s string) string { return cutName(s, filterNameSize-1) } + +// qdiscWrite is do_qdisc's write verbs. +func (r *runner) qdiscWrite(verb string, args []string) error { + switch { + case matches(verb, "add"): + return r.qdiscModify(unix.RTM_NEWQDISC, unix.NLM_F_EXCL|unix.NLM_F_CREATE, args) + case matches(verb, "change"): + return r.qdiscModify(unix.RTM_NEWQDISC, 0, args) + case matches(verb, "replace"): + return r.qdiscModify(unix.RTM_NEWQDISC, unix.NLM_F_CREATE|unix.NLM_F_REPLACE, args) + case matches(verb, "link"): + return r.qdiscModify(unix.RTM_NEWQDISC, unix.NLM_F_REPLACE, args) + } + return r.qdiscModify(unix.RTM_DELQDISC, 0, args) +} + +// classWrite is do_class's write verbs: replace is CREATE alone. +func (r *runner) classWrite(verb string, args []string) error { + switch { + case matches(verb, "add"): + return r.classModify(unix.RTM_NEWTCLASS, unix.NLM_F_EXCL|unix.NLM_F_CREATE, args) + case matches(verb, "change"): + return r.classModify(unix.RTM_NEWTCLASS, 0, args) + case matches(verb, "replace"): + return r.classModify(unix.RTM_NEWTCLASS, unix.NLM_F_CREATE, args) + } + return r.classModify(unix.RTM_DELTCLASS, 0, args) +} + +// qmod is what the two modify loops gather. +type qmod struct { + w xtcpnl.TcWrite + dev string + kind string + q *qdiscUtil // get_qdisc_kind's; nil when no kind was named + rest []string // the words after the kind + stab sizeSpec +} + +// qdiscModify is tc_qdisc_modify. +func (r *runner) qdiscModify(cmd uint16, flags int, args []string) error { + m := qmod{w: xtcpnl.TcWrite{MsgType: cmd, Flags: uint16(flags | unix.NLM_F_ACK)}} + if err := r.qdiscModifyArgs(&m, args); err != nil { + return err + } + if err := r.modifyKind(&m, true); err != nil { + return err + } + if m.stab.linklayer >= linklayerEthernet || m.stab.mpu != 0 || m.stab.overhead != 0 { + data, ok := calcSizeTable(&m.stab) + if !ok { + return fmt.Errorf("%w: stab tsize %d with mtu %d (tc_calc_size_table never returns, W13)", + errNotImplemented, m.stab.tsize, m.stab.mtu) + } + m.w.HasStab, m.w.StabData = true, data + m.w.Stab = xtcpnl.TcSizespec{CellLog: m.stab.cellLog, SizeLog: m.stab.sizeLog, CellAlign: m.stab.cellAlign, + Overhead: m.stab.overhead, Linklayer: m.stab.linklayer, Mpu: m.stab.mpu, Mtu: m.stab.mtu, + Tsize: m.stab.tsize} + } + if m.dev != "" { + idx, err := r.nameToIndex(m.dev) + if err != nil { + return err + } + if idx == 0 { + return r.nodev(m.dev) + } + m.w.Ifindex = cint.Int(idx) + } + return r.sendWrite(&m.w) +} + +// qdiscModifyArgs is tc_qdisc_modify's argument loop. +func (r *runner) qdiscModifyArgs(m *qmod, args []string) error { + for len(args) > 0 { + a := args[0] + switch { + case a == wordDev: + if len(args) < 2 { + return r.incomplete() + } + args = args[1:] + if m.dev != "" { + return r.duparg(wordDev, args[0]) + } + m.dev = truncName(args[0]) + case a == wordHandle: + if m.w.Handle != 0 { + return r.duparg(wordHandle, a) // W3: duparg names the word "handle" itself + } + if len(args) < 2 { + return r.incomplete() + } + args = args[1:] + h, ok := qdiscHandle(args[0]) + if !ok { + return r.invarg("invalid qdisc ID", args[0]) + } + m.w.Handle = h + case a == wordRoot: + if m.w.Parent != 0 { + r.errf("Error: \"root\" is duplicate parent ID\n") + return retCode(-1) + } + m.w.Parent = tcHRoot + case a == "clsact", a == wordIngress: + return r.qdiscIngress(m, args) + case a == wordParent: + if len(args) < 2 { + return r.incomplete() + } + args = args[1:] + if m.w.Parent != 0 { + return r.duparg(wordParent, args[0]) + } + h, ok := tcClassid(args[0]) + if !ok { + return r.invarg("invalid parent ID", args[0]) + } + m.w.Parent = h + case matches(a, wordEstimator): + var err error + if args, err = r.parseEstimator(args, &m.w.Est); err != nil { + return err + } + case matches(a, "stab"): + var err error + if args, err = r.parseSizeTable(args, &m.stab); err != nil { + return err + } + continue + case matches(a, "ingress_block"), matches(a, "egress_block"): + var err error + if args, err = r.qdiscBlock(m, args); err != nil { + return err + } + case matches(a, helpWord): + r.qdiscUsage() // W1: and the loop goes on + default: + m.kind = truncKind(a) + m.q = qdiscKindAny(m.kind) + m.rest = args[1:] + return nil + } + args = args[1:] + } + return nil +} + +// qdiscIngress is the ingress and clsact arms: TC_H_CLSACT is +// TC_H_INGRESS; the handle an earlier `handle` set is overwritten, and +// NEXT_ARG_FWD; break hands the rest to the kind's parser (W2). +func (r *runner) qdiscIngress(m *qmod, args []string) error { + a := args[0] + if m.w.Parent != 0 { + r.errf("Error: \"%s\" is a duplicate parent ID\n", a) + return retCode(-1) + } + m.w.Parent = tcHIngress + m.kind = a + m.q = qdiscKindAny(a) + m.w.Handle = tcHIngress & 0xffff0000 // TC_H_MAKE(TC_H_INGRESS, 0) + m.rest = args[1:] + return nil +} + +// qdiscBlock is the ingress_block and egress_block arms: get_u32 base 0, +// and 0 is invalid. args is returned at the value. +func (r *runner) qdiscBlock(m *qmod, args []string) ([]string, error) { + ingress := matches(args[0], "ingress_block") + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + v, ok := getU32(args[0], 0) + if !ok || v == 0 { + if ingress { + return nil, r.invarg("invalid ingress block index value", args[0]) + } + return nil, r.invarg("invalid egress block index value", args[0]) + } + if ingress { + m.w.IngressBlock = v + } else { + m.w.EgressBlock = v + } + return args, nil +} + +// classModify is tc_class_modify. +func (r *runner) classModify(cmd uint16, flags int, args []string) error { + m := qmod{w: xtcpnl.TcWrite{MsgType: cmd, Flags: uint16(flags | unix.NLM_F_ACK)}} + if err := r.classModifyArgs(&m, args); err != nil { + return err + } + if err := r.modifyKind(&m, false); err != nil { + return err + } + if m.dev != "" { + idx, err := r.nameToIndex(m.dev) + if err != nil { + return err + } + if idx == 0 { + return r.nodev(m.dev) + } + m.w.Ifindex = cint.Int(idx) + } else if err := r.initMap(); err != nil { + return err + } + return r.sendWrite(&m.w) +} + +// classModifyArgs is tc_class_modify's argument loop. +func (r *runner) classModifyArgs(m *qmod, args []string) error { + for len(args) > 0 { + a := args[0] + switch { + case a == wordDev: + if len(args) < 2 { + return r.incomplete() + } + args = args[1:] + if m.dev != "" { + return r.duparg(wordDev, args[0]) + } + m.dev = truncName(args[0]) + case a == wordClassid: + if len(args) < 2 { + return r.incomplete() + } + args = args[1:] + if m.w.Handle != 0 { + return r.duparg(wordClassid, args[0]) + } + h, ok := tcClassid(args[0]) + if !ok { + return r.invarg("invalid class ID", args[0]) + } + m.w.Handle = h + case a == wordHandle: + r.errf("Error: try \"classid\" instead of \"handle\"\n") + return retCode(-1) + case a == wordRoot: + if m.w.Parent != 0 { + r.errf("Error: \"root\" is duplicate parent ID.\n") + return retCode(-1) + } + m.w.Parent = tcHRoot + case a == wordParent: + if len(args) < 2 { + return r.incomplete() + } + args = args[1:] + if m.w.Parent != 0 { + return r.duparg(wordParent, args[0]) + } + h, ok := tcClassid(args[0]) + if !ok { + return r.invarg("invalid parent ID", args[0]) + } + m.w.Parent = h + case matches(a, wordEstimator): + var err error + if args, err = r.parseEstimator(args, &m.w.Est); err != nil { + return err + } + case matches(a, helpWord): + r.classUsage() + default: + m.kind = truncKind(a) + m.q = qdiscKindAny(m.kind) + m.rest = args[1:] + return nil + } + args = args[1:] + } + return nil +} + +// modifyKind is TCA_KIND and the kind's parser: parse_qopt for a qdisc, +// parse_copt for a class. get_qdisc_kind never returns NULL for a name (an +// unknown one gets parse_noqopt and no parse_copt), so the "Garbage +// instead of arguments" arm is reached only with no kind (W5). +func (r *runner) modifyKind(m *qmod, qdisc bool) error { + m.w.Kind = m.kind + if m.q == nil { + if len(m.rest) > 0 { + return r.garbage(m.rest[0], qdisc) + } + return nil + } + p, err := r.kindParserFor(m, qdisc) + if err != nil || p == nil { + return err + } + opts, err := p(r, m.rest, m.dev) + if errors.Is(err, errKindParse) { + return retCode(1) + } + if err != nil { + return err + } + m.w.Opts = opts + return nil +} + +// kindParserFor finds the kind's parser, or says what tc does without one. +// A nil parser and nil error is parse_noqopt's empty success. +func (r *runner) kindParserFor(m *qmod, qdisc bool) (kindParser, error) { + known := m.q.id != "" + if qdisc { + if p, ok := qoptParsers[m.kind]; ok { + if p == nil && len(m.rest) > 0 { + r.errf("qdisc '%s' does not support option parsing\n", m.kind) + return nil, retCode(-1) + } + return p, nil + } + if known { + return nil, fmt.Errorf("%w: tc qdisc write of kind %s", errNotImplemented, m.kind) + } + if len(m.rest) > 0 { // parse_noqopt + r.errf("Unknown qdisc \"%s\", hence option \"%s\" is unparsable\n", m.kind, m.rest[0]) + return nil, retCode(1) + } + return nil, nil + } + if p, ok := coptParsers[m.kind]; ok { + return p, nil + } + if known && m.q.printCopt != nil { + return nil, fmt.Errorf("%w: tc class write of kind %s", errNotImplemented, m.kind) + } + r.errf("Error: Qdisc \"%s\" is classless.\n", m.kind) + return nil, retCode(1) +} + +// garbage is the "Garbage instead of arguments" arm, with the class one's +// missing newline (W5). +func (r *runner) garbage(word string, qdisc bool) error { + if matches(word, helpWord) { + if qdisc { + r.qdiscUsage() + } else { + r.classUsage() + } + } + if qdisc { + r.errf("Garbage instead of arguments \"%s ...\". Try \"tc qdisc help\".\n", word) + } else { + r.errf("Garbage instead of arguments \"%s ...\". Try \"tc class help\".", word) + } + return retCode(-1) +} + +// qdiscKindAny is get_qdisc_kind: the kind's qdisc_util, or for a name tc +// does not link, one with no id (parse_noqopt, no parse_copt). +func qdiscKindAny(kind string) *qdiscUtil { + if q, ok := qdiscUtils[kind]; ok { + return q + } + return &qdiscUtil{} +} + +// parseEstimator is m_estimator.c parse_estimator: args starts at +// "estimator"; it returns args at the time constant, which the caller's +// step passes (W7). +func (r *runner) parseEstimator(args []string, est *xtcpnl.TcEstimator) ([]string, error) { + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if est.EwmaLog != 0 { + return nil, r.duparg(wordEstimator, args[0]) + } + if matches(args[0], helpWord) { + r.estHelp() + } + a, ok := getTime(args[0]) + if !ok { + return nil, r.invarg(wordEstimator, "invalid estimator interval") + } + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if matches(args[0], helpWord) { + r.estHelp() + } + tconst, ok := getTime(args[0]) + if !ok { + return nil, r.invarg(wordEstimator, "invalid estimator time constant") + } + var e estimator + if !setupEstimator(a, tconst, &e) { + r.errf("Error: estimator parameters are out of range.\n") + return nil, retCode(-1) + } + est.Interval, est.EwmaLog = e.interval, e.ewmaLog + if r.raw != 0 { + r.errf("[estimator i=%d e=%d]\n", e.interval, e.ewmaLog) + } + return args, nil +} + +func (r *runner) estHelp() { + r.errf("%s", "Usage: ... estimator INTERVAL TIME-CONST\n"+ + " INTERVAL is interval between measurements\n"+ + " TIME-CONST is averaging time constant\n"+ + "Example: ... est 1sec 8sec\n") +} + +// parseSizeTable is tc_stab.c parse_size_table: args starts at "stab"; it +// returns args at the first word it does not take. `stab help` and a stab +// of only mtu or tsize (check_size_table_opts false) return -1, the second +// silently (W14). +func (r *runner) parseSizeTable(args []string, sp *sizeSpec) ([]string, error) { + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if matches(args[0], helpWord) { + r.stabHelp() + return nil, retCode(-1) + } + var s sizeSpec + for len(args) > 0 { + a := args[0] + var dup bool + var err error + switch { + case matches(a, wordMtu): + dup, err = r.stabU32(&args, &s.mtu, wordMtu, "invalid mtu") + case matches(a, wordMpu): + dup, err = r.stabU32(&args, &s.mpu, wordMpu, "invalid mpu") + case matches(a, wordOverhead): + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if s.overhead != 0 { + return nil, r.duparg(wordOverhead, args[0]) + } + v, ok := getInteger(args[0], 10) + if !ok { + return nil, r.invarg(wordOverhead, "invalid overhead") + } + s.overhead = v + case matches(a, "tsize"): + dup, err = r.stabU32(&args, &s.tsize, "tsize", "invalid table size") + case matches(a, wordLinklayer): + if len(args) < 2 { + return nil, r.incomplete() + } + args = args[1:] + if s.linklayer != 0 { + return nil, r.duparg(wordLinklayer, args[0]) + } + v, ok := getLinklayer(args[0]) + if !ok { + return nil, r.invarg(wordLinklayer, "invalid linklayer") + } + s.linklayer = v + default: + if s.linklayer < linklayerEthernet && s.mpu == 0 && s.overhead == 0 { + return nil, retCode(-1) + } + *sp = s + return args, nil + } + if dup || err != nil { + return nil, err + } + args = args[1:] + } + if s.linklayer < linklayerEthernet && s.mpu == 0 && s.overhead == 0 { + return nil, retCode(-1) + } + *sp = s + return args, nil +} + +// stabU32 is one of parse_size_table's get_u32 options: NEXT_ARG, the +// duplicate check on a non-zero value, get_u32 base 10. +func (r *runner) stabU32(args *[]string, v *uint32, key, msg string) (bool, error) { + if len(*args) < 2 { + return true, r.incomplete() + } + *args = (*args)[1:] + if *v != 0 { + return true, r.duparg(key, (*args)[0]) + } + u, ok := getU32((*args)[0], 10) + if !ok { + return true, r.invarg(key, msg) + } + *v = u + return false, nil +} + +func (r *runner) stabHelp() { + r.errf("%s", "Usage: ... stab [ mtu BYTES ] [ tsize SLOTS ] [ mpu BYTES ]\n"+ + " [ overhead BYTES ] [ linklayer TYPE ] ...\n"+ + " mtu : max packet size we create rate map for {2047}\n"+ + " tsize : how many slots should size table have {512}\n"+ + " mpu : minimum packet size used in rate computations\n"+ + " overhead : per-packet size overhead used in rate computations\n"+ + " linklayer : adapting to a linklayer e.g. atm\n"+ + "Example: ... stab overhead 20 linklayer atm\n") +} + +// readProp is lib/utils.c read_prop: /sys/class/net/DEV/PROP as a long. +func (r *runner) readProp(dev, prop string) (int64, bool) { + fname := "/sys/class/net/" + dev + "/" + prop + if len(fname) >= 128 { + r.errf("could not build pathname for property\n") + return 0, false + } + f, err := os.Open(r.sys.path(fname)) + if err != nil { + r.errf("fopen %s: %s\n", fname, strerror(errnoOf(err))) + return 0, false + } + buf := make([]byte, 79) // fgets(buf, 80) + n, rerr := f.Read(buf) + if cerr := f.Close(); cerr != nil && rerr == nil { + rerr = cerr + } + if rerr != nil || n == 0 { + r.errf("property \"%s\" in file %s is currently unknown\n", prop, fname) + r.errf("Failed to parse %s\n", fname) + return 0, false + } + line, _, _ := strings.Cut(string(buf[:n]), "\n") + v, rest, ok, over := strtolOver(line) + if !ok || rest != "" { + r.errf("value \"%s\" in file %s is not a number\n", line, fname) + r.errf("Failed to parse %s\n", fname) + return 0, false + } + if over { + r.errf("strtol %s: %s", fname, strerror(unix.ERANGE)) + r.errf("Failed to parse %s\n", fname) + return 0, false + } + return v, true +} + +// sendWrite builds the request and delivers it: to a replay, which +// matches it with tc's and answers with the kernel's recorded ack (rtnl_talk +// and return 2 on an error), or, on the kernel socket, to GOTC_WRITE_OUT. +func (r *runner) sendWrite(w *xtcpnl.TcWrite) error { + req, err := xtcpnl.BuildTcWriteRequest(w, r.nextSeq()) + if err != nil { + return fmt.Errorf("%w: a request tc would truncate or cannot be laid out: %w", errNotImplemented, err) + } + if _, live := r.src.(*LiveSource); live { + return r.writeOut(req) + } + if _, ok, err := r.talkAnswer(req, nil); err != nil || !ok { + if err != nil { + return err + } + return retCode(2) + } + return nil +} + +// writeOut appends req to GOTC_WRITE_OUT, which a run's first write +// truncates. +func (r *runner) writeOut(req []byte) error { + path, ok := os.LookupEnv(writeOutEnvCst) + if !ok || path == "" { + return ErrWriteNotApplied + } + flag := os.O_WRONLY | os.O_CREATE | os.O_APPEND + if !r.wroteOut { + flag |= os.O_TRUNC + } + f, err := os.OpenFile(path, flag, 0o600) + if err != nil { + return fmt.Errorf("gotc: %s: %w", writeOutEnvCst, err) + } + _, werr := f.Write(req) + if err := errors.Join(werr, f.Close()); err != nil { + return fmt.Errorf("gotc: %s: %w", writeOutEnvCst, err) + } + r.wroteOut = true + return nil +} + +// strtolOver is strtol(s, &end, 0) for read_prop: ok is false when no +// digit was read; over is ERANGE, the result saturated. +func strtolOver(s string) (v int64, rest string, ok, over bool) { + t := strings.TrimLeft(s, " \t\n\v\f\r") + neg := false + if t != "" && (t[0] == '+' || t[0] == '-') { + neg, t = t[0] == '-', t[1:] + } + if t == "" || t[0] == '+' || t[0] == '-' || cIsSpace(t[0]) { + return 0, s, false, false + } + mag, rest, ok, over := strtoulOver(t, 0) + if !ok { + return 0, s, false, false + } + if neg { + if over || mag > 1<<63 { + return math.MinInt64, rest, true, true + } + n, _ := cint.NegInt64(mag) + return n, rest, true, false + } + if over || mag > math.MaxInt64 { + return math.MaxInt64, rest, true, true + } + return cint.LongLong(mag), rest, true, false +} + +// percentRate is tc_util.c parse_percent_rate: the device's speed (Mbit/s) +// times the percentage, formatted "%lf" into r_str[20], which get_rate or +// get_rate64 then parses. ok false is its -1, after its message. +func (r *runner) percentRate(str, dev string) (string, bool) { + if dev == "" { + r.errf("No device specified; specify device to rate limit by percentage\n") + return "", false + } + mbit, ok := r.readProp(dev, "speed") + if !ok { + return "", false + } + n := 0 // sscanf %m[0-9.%] + for n < len(str) && (str[n] >= '0' && str[n] <= '9' || str[n] == '.' || str[n] == '%') { + n++ + } + if n == 0 { + r.errf("Specified rate value could not be read or is malformed\n") + return "", false + } + perc, rc := parsePercent(str[:n]) + switch rc { + case 1: + r.errf("Invalid rate specified; should be between [0,100]%% but is %s\n", str) + return "", false + case -1: + r.errf("Specified rate value could not be read or is malformed\n") + return "", false + } + s := strconv.FormatFloat(perc*float64(mbit)*1000*1000, 'f', 6, 64) + if len(s) >= 20 { + r.errf("Unable to parse calculated rate\n") + return "", false + } + return s, true +} + +// getPercentRate is get_percent_rate. +func (r *runner) getPercentRate(str, dev string) (uint32, bool) { + s, ok := r.percentRate(str, dev) + if !ok { + return 0, false + } + return getRate(s) +} + +// getPercentRate64 is get_percent_rate64. +func (r *runner) getPercentRate64(str, dev string) (uint64, bool) { + s, ok := r.percentRate(str, dev) + if !ok { + return 0, false + } + return getRate64(s) +} + +// writesBuilt is whether this build lays out qdisc and class writes. +const writesBuilt = true diff --git a/internal/gotc/qwrite_off.go b/internal/gotc/qwrite_off.go new file mode 100644 index 000000000..7c31ee337 --- /dev/null +++ b/internal/gotc/qwrite_off.go @@ -0,0 +1,22 @@ +//go:build !gotc_write + +package gotc + +import "fmt" + +// Without gotc_write gotc cannot lay out a write: every qdisc and class +// write verb is refused, as before increment 17 (qwrite.go is the tagged +// build's). + +// qdiscWrite refuses do_qdisc's write verbs. +func (r *runner) qdiscWrite(verb string, _ []string) error { + return fmt.Errorf("%w: tc qdisc %s", errNotImplemented, verb) +} + +// classWrite refuses do_class's write verbs. +func (r *runner) classWrite(verb string, _ []string) error { + return fmt.Errorf("%w: tc class %s", errNotImplemented, verb) +} + +// writesBuilt is whether this build lays out qdisc and class writes. +const writesBuilt = false diff --git a/internal/gotc/qwrite_tdc_test.go b/internal/gotc/qwrite_tdc_test.go new file mode 100644 index 000000000..945c3d7d1 --- /dev/null +++ b/internal/gotc/qwrite_tdc_test.go @@ -0,0 +1,129 @@ +//go:build gotc_write + +package gotc + +import ( + "bytes" + "encoding/json" + "io/fs" + "path/filepath" + "regexp" + "slices" + "strconv" + "strings" + "testing" +) + +// The tdc corpus's own commands are tc's request oracle for writes: each +// row's ip.pcap holds what tc sent for cmd and the kernel's answer, ip.out, +// ip.err and ip.rc what tc printed. A qdisc or class write of a kind gotc +// parses must match all of it, request bytes included; a write of a kind +// whose parser waits for increment 18 or 19 is refused, counted by kind. + +// tdcWriteSkips pins the refusals by kind. +var tdcWriteSkips = map[string]int{ + "cake": 21, "cake_mq": 22, "cbs": 11, "choke": 7, "codel": 13, "drr": 3, "dualpi2": 12, "etf": 4, "ets": 49, + "fq_pie": 2, "gred": 7, "hfsc": 9, "hhf": 16, "mqprio": 4, "multiq": 4, "pie": 2, "plug": 9, "qfq": 10, "red": 9, + "sfb": 12, "skbprio": 4, "taprio": 7, +} + +// tdcWriteKnown are the rows gotc cannot match, each with why. +var tdcWriteKnown = map[string]string{} + +// tdcWritesSent pins how many tdc writes gotc sends exactly. +const tdcWritesSent = 173 + +var writeKindRefused = regexp.MustCompile(`not implemented: tc (?:qdisc|class) write of kind (\S+)`) + +type tdcCmdRow struct { + ID string `json:"id"` + Cmd string `json:"cmd"` +} + +// TestGotcTdcWrites replays every tdc qdisc and class write. +// +// go test -tags gotc_write ./internal/gotc/ -run TestGotcTdcWrites +func TestGotcTdcWrites(t *testing.T) { + roots, err := filepath.Glob(tdcGlob) + if err != nil || len(roots) == 0 { + t.Fatalf("no tdc corpus: %v", err) + } + pschedContent = readFile(t, pschedRow) + var dirs []string + for _, root := range roots { + err := filepath.WalkDir(root, func(p string, d fs.DirEntry, err error) error { + if err == nil && d.Name() == "ip.pcap" { + dirs = append(dirs, filepath.Dir(p)) + } + return err + }) + if err != nil { + t.Fatal(err) + } + } + slices.Sort(dirs) + skips := map[string]int{} + sent := 0 + for _, dir := range dirs { + var row tdcCmdRow + if err := json.Unmarshal([]byte(readFile(t, filepath.Join(dir, "cmd.json"))), &row); err != nil { + t.Fatal(err) + } + args := strings.Fields(row.Cmd) + if len(args) < 3 || args[0] != "tc" || strings.ContainsAny(row.Cmd, "|;&<>$'\"") { + continue + } + obj := tcShowObject(args[1:]) + i := slices.Index(args, obj) + if i+1 >= len(args) { + continue + } + verb := args[i+1] + qdisc := obj == "qdisc" && writeVerb(verb, "add", "change", "replace", "link", "delete") + class := obj == "class" && writeVerb(verb, "add", "change", "replace", "delete") + if !qdisc && !class { + continue + } + src, err := NewReplaySource(filepath.Join(dir, "ip.pcap")) + if err != nil { + t.Fatal(err) + } + var out, errb bytes.Buffer + rc := run(config{src: src, sys: testSys(t, dir)}, args[1:], &out, &errb) + if m := writeKindRefused.FindStringSubmatch(errb.String()); m != nil { + skips[m[1]]++ + continue + } + wantRC, err := strconv.Atoi(strings.TrimSpace(readFile(t, filepath.Join(dir, "ip.rc")))) + if err != nil { + t.Fatal(err) + } + got := result{stdout: out.String(), stderr: errb.String(), rc: rc, pending: src.Pending()} + want := result{stdout: readFile(t, filepath.Join(dir, "ip.out")), stderr: readFile(t, filepath.Join(dir, "ip.err")), rc: wantRC} + if got != want { + if _, ok := tdcWriteKnown[row.ID]; ok { + continue + } + t.Errorf("%s: %s\n got %#v\n want %#v", row.ID, row.Cmd, got, want) + continue + } + if _, ok := tdcWriteKnown[row.ID]; ok { + t.Errorf("%s now matches; drop it from tdcWriteKnown", row.ID) + } + sent++ + } + t.Logf("matched %d tdc writes; refused by kind %v", sent, skips) + if sent != tdcWritesSent { + t.Errorf("matched %d tdc writes, want %d", sent, tdcWritesSent) + } + for k, n := range skips { + if tdcWriteSkips[k] != n { + t.Errorf("kind %s refused %d times, want %d", k, n, tdcWriteSkips[k]) + } + } + for k, n := range tdcWriteSkips { + if skips[k] != n { + t.Errorf("kind %s refused %d times, want %d", k, skips[k], n) + } + } +} diff --git a/internal/gotc/qwrite_test.go b/internal/gotc/qwrite_test.go new file mode 100644 index 000000000..a27d571f3 --- /dev/null +++ b/internal/gotc/qwrite_test.go @@ -0,0 +1,382 @@ +//go:build gotc_write + +package gotc + +import ( + "bytes" + "encoding/binary" + "errors" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// ack is the kernel's NLMSG_ERROR of 0. +func ack() Msg { return nlErr(0) } + +// sentWrite is what TestGotcQwrite reads back from the last request. +type sentWrite struct { + typ, flags uint16 + ifindex uint32 + handle, parent uint32 + attrs []byte +} + +func lastWrite(t *testing.T, reqs [][]byte) sentWrite { + t.Helper() + if len(reqs) == 0 { + t.Fatal("no request sent") + } + b := reqs[len(reqs)-1] + if len(b) < nlHeaderLen+xtcpnl.TcMsgSizeCst { + t.Fatalf("request of %d bytes", len(b)) + } + tc := b[nlHeaderLen:] + return sentWrite{ + typ: binary.LittleEndian.Uint16(b[4:6]), flags: binary.LittleEndian.Uint16(b[6:8]), + ifindex: binary.LittleEndian.Uint32(tc[4:8]), handle: binary.LittleEndian.Uint32(tc[8:12]), + parent: binary.LittleEndian.Uint32(tc[12:16]), attrs: tc[xtcpnl.TcMsgSizeCst:], + } +} + +const ( + fReq = unix.NLM_F_REQUEST | unix.NLM_F_ACK +) + +// TestGotcQwrite is tc_qdisc_modify and tc_class_modify's framework: the +// verbs' flags, the argument loops and their leads, the kind dispatch and +// the ack (gotc 17W). +// +// go test -tags gotc_write ./internal/gotc/ -run TestGotcQwrite +func TestGotcQwrite(t *testing.T) { + pfifo := kind("pfifo") + tests := []struct { + description string + args []string + replies []Reply + stderr string + rc int + reqs int + expected *sentWrite // nil: no write checked + }{ + // Positive: do_qdisc's and do_class's flags. + {"positive: qdisc add is EXCL|CREATE", []string{"qdisc", "add", "root", "pfifo"}, []Reply{rep(ack())}, "", 0, 1, + &sentWrite{typ: unix.RTM_NEWQDISC, flags: fReq | unix.NLM_F_EXCL | unix.NLM_F_CREATE, parent: tcHRoot, attrs: pfifo}}, + {"positive: qdisc change is 0", []string{"qdisc", "change", "root", "pfifo"}, []Reply{rep(ack())}, "", 0, 1, + &sentWrite{typ: unix.RTM_NEWQDISC, flags: fReq, parent: tcHRoot, attrs: pfifo}}, + {"positive: qdisc replace is CREATE|REPLACE", []string{"qdisc", "replace", "root", "pfifo"}, []Reply{rep(ack())}, "", 0, 1, + &sentWrite{typ: unix.RTM_NEWQDISC, flags: fReq | unix.NLM_F_CREATE | unix.NLM_F_REPLACE, parent: tcHRoot, attrs: pfifo}}, + {"positive: qdisc link is REPLACE alone", []string{"qdisc", "link", "root", "pfifo"}, []Reply{rep(ack())}, "", 0, 1, + &sentWrite{typ: unix.RTM_NEWQDISC, flags: fReq | unix.NLM_F_REPLACE, parent: tcHRoot, attrs: pfifo}}, + {"positive: qdisc del is RTM_DELQDISC, 0", []string{"qdisc", "del", "root"}, []Reply{rep(ack())}, "", 0, 1, + &sentWrite{typ: unix.RTM_DELQDISC, flags: fReq, parent: tcHRoot}}, + {"positive: class replace is CREATE alone, after ll_init_map", []string{"class", "replace", "classid", "1:1"}, + []Reply{rep(done()), rep(ack())}, "", 0, 2, + &sentWrite{typ: unix.RTM_NEWTCLASS, flags: fReq | unix.NLM_F_CREATE, handle: 0x10001}}, + {"positive: class delete with dev looks d0 up", []string{"class", "del", "dev", "d0", "classid", "1:1"}, + []Reply{rep(linkMsg(2, "d0")), rep(ack())}, "", 0, 2, + &sentWrite{typ: unix.RTM_DELTCLASS, flags: fReq, ifindex: 2, handle: 0x10001}}, + {"positive: blocks come after the kind", []string{"qdisc", "add", "ingress_block", "5", "egress_block", "0x6", "root", "pfifo"}, + []Reply{rep(ack())}, "", 0, 1, &sentWrite{typ: unix.RTM_NEWQDISC, flags: fReq | unix.NLM_F_EXCL | unix.NLM_F_CREATE, + parent: tcHRoot, attrs: cat(pfifo, attr(xtcpnl.TcaIngressBlock, u32le(5)), attr(xtcpnl.TcaEgressBlock, u32le(6)))}}, + // Negative. + {"negative: class add on pfifo is classless, rc 1 (W4)", []string{"class", "add", "classid", "1:1", "pfifo"}, nil, + "Error: Qdisc \"pfifo\" is classless.\n", 1, 0, nil}, + {"negative: a kernel EEXIST is RTNETLINK answers, rc 2", []string{"qdisc", "add", "root", "pfifo"}, + []Reply{rep(nlErr(unix.EEXIST))}, "RTNETLINK answers: File exists\n", 2, 1, nil}, + {"negative: a write of a deferred kind is refused by name", []string{"qdisc", "add", "root", "red"}, nil, + notImpl + "tc qdisc write of kind red\n", 255, 0, nil}, + {"negative: a class write of a deferred classful kind is refused", []string{"class", "add", "classid", "1:1", "drr"}, nil, + notImpl + "tc class write of kind drr\n", 255, 0, nil}, + {"negative: an unknown kind with options is parse_noqopt's, rc 1", []string{"qdisc", "add", "root", "nosuch", "x"}, nil, + "Unknown qdisc \"nosuch\", hence option \"x\" is unparsable\n", 1, 0, nil}, + {"negative: pfifo_fast takes no options, rc 255 (W8)", []string{"qdisc", "add", "root", "pfifo_fast", "x"}, nil, + "qdisc 'pfifo_fast' does not support option parsing\n", 255, 0, nil}, + {"negative: class handle says try classid", []string{"class", "add", "handle", "1:"}, nil, + "Error: try \"classid\" instead of \"handle\"\n", 255, 0, nil}, + {"negative: root twice", []string{"qdisc", "add", "root", "root"}, nil, "Error: \"root\" is duplicate parent ID\n", 255, 0, nil}, + {"negative: class root twice has a full stop", []string{"class", "add", "root", "root"}, nil, + "Error: \"root\" is duplicate parent ID.\n", 255, 0, nil}, + {"negative: ingress after parent", []string{"qdisc", "add", "parent", "1:", "ingress"}, nil, + "Error: \"ingress\" is a duplicate parent ID\n", 255, 0, nil}, + {"negative: ingress_block 0", []string{"qdisc", "add", "ingress_block", "0"}, nil, + "Error: argument \"0\" is wrong: invalid ingress block index value\n", 255, 0, nil}, + {"negative: estimator out of range", []string{"qdisc", "add", "est", "10s", "1s", "pfifo"}, nil, + "Error: estimator parameters are out of range.\n", 255, 0, nil}, + {"negative: estimator twice is duparg", []string{"qdisc", "add", "est", "1s", "8s", "est", "1s", "8s"}, nil, + "Error: duplicate \"estimator\": \"1s\" is the second value.\n", 255, 0, nil}, + {"negative: stab help prints and fails", []string{"qdisc", "add", "stab", "help"}, nil, + "Usage: ... stab [ mtu BYTES ] [ tsize SLOTS ] [ mpu BYTES ]\n" + + " [ overhead BYTES ] [ linklayer TYPE ] ...\n" + + " mtu : max packet size we create rate map for {2047}\n" + + " tsize : how many slots should size table have {512}\n" + + " mpu : minimum packet size used in rate computations\n" + + " overhead : per-packet size overhead used in rate computations\n" + + " linklayer : adapting to a linklayer e.g. atm\n" + + "Example: ... stab overhead 20 linklayer atm\n", 255, 0, nil}, + {"negative: a missing device is nodev, rc 1", []string{"qdisc", "add", "dev", "zz", "root", "pfifo"}, + []Reply{rep(nlErr(unix.ENODEV))}, "Cannot find device \"zz\"\n", 1, 1, nil}, + // Boundary. + {"boundary: handle 0: then handle 1: is accepted (W3)", []string{"qdisc", "add", "handle", "0:", "handle", "1:", "root", "pfifo"}, + []Reply{rep(ack())}, "", 0, 1, &sentWrite{typ: unix.RTM_NEWQDISC, flags: fReq | unix.NLM_F_EXCL | unix.NLM_F_CREATE, + handle: 0x10000, parent: tcHRoot, attrs: pfifo}}, + {"boundary: handle 1: twice is duparg naming the word handle", []string{"qdisc", "add", "handle", "1:", "handle", "2:"}, nil, + "Error: duplicate \"handle\": \"handle\" is the second value.\n", 255, 0, nil}, + {"boundary: a stab of mtu alone fails silently (W14)", []string{"qdisc", "add", "stab", "mtu", "100", "pfifo"}, nil, "", 255, 0, nil}, + {"boundary: a stab whose size table never ends is refused (W13)", + []string{"qdisc", "add", "stab", "mpu", "1", "tsize", "1", "mtu", "2147483648", "root", "pfifo"}, nil, + notImpl + "stab tsize 1 with mtu 2147483648 (tc_calc_size_table never returns, W13)\n", 255, 0, nil}, + {"boundary: the kind keeps 15 bytes", []string{"qdisc", "add", "root", "abcdefghijklmnopq"}, []Reply{rep(ack())}, "", 0, 1, + &sentWrite{typ: unix.RTM_NEWQDISC, flags: fReq | unix.NLM_F_EXCL | unix.NLM_F_CREATE, parent: tcHRoot, + attrs: kind("abcdefghijklmno")}}, + // Corner. + {"corner: help mid-line prints usage and goes on (W1)", []string{"qdisc", "add", "help", "root", "pfifo"}, + []Reply{rep(ack())}, qdiscUsageText, 0, 1, nil}, + {"corner: handle 5: then ingress takes ingress's handle (W2)", []string{"qdisc", "add", "handle", "5:", "ingress"}, + []Reply{rep(ack())}, "", 0, 1, &sentWrite{typ: unix.RTM_NEWQDISC, flags: fReq | unix.NLM_F_EXCL | unix.NLM_F_CREATE, + handle: 0xffff0000, parent: tcHIngress, attrs: kind("ingress")}}, + {"corner: words after ingress go to its parser (W2)", []string{"qdisc", "add", "ingress", "dev", "d0"}, nil, + "What is \"dev\"?\nUsage: ... ingress\n", 1, 0, nil}, + {"corner: ingress skips handle pairs", []string{"qdisc", "add", "ingress", "handle", "ffff:"}, []Reply{rep(ack())}, "", 0, 1, nil}, + {"corner: clsact refuses any word", []string{"qdisc", "add", "clsact", "foo"}, nil, + "What is \"foo\"?\nUsage: ... clsact\n", 1, 0, nil}, + {"corner: an unknown class kind is classless", []string{"class", "add", "classid", "1:1", "nosuch"}, nil, + "Error: Qdisc \"nosuch\" is classless.\n", 1, 0, nil}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + t.Parallel() + src := &fakeSource{replies: tc.replies} + var out, errb bytes.Buffer + rc := run(config{src: src, stdin: strings.NewReader(""), sys: emptySys(t)}, tc.args, &out, &errb) + if rc != tc.rc || errb.String() != tc.stderr || len(src.reqs) != tc.reqs || out.String() != "" { + t.Fatalf("rc %d reqs %d stdout %q stderr %q; want rc %d reqs %d stderr %q", + rc, len(src.reqs), out.String(), errb.String(), tc.rc, tc.reqs, tc.stderr) + } + if tc.expected == nil { + return + } + got := lastWrite(t, src.reqs) + if got.typ != tc.expected.typ || got.flags != tc.expected.flags || got.ifindex != tc.expected.ifindex || + got.handle != tc.expected.handle || got.parent != tc.expected.parent || + !bytes.Equal(got.attrs, tc.expected.attrs) && tc.expected.attrs != nil { + t.Errorf("sent %+v\nwant %+v", got, *tc.expected) + } + }) + } +} + +func u32le(v uint32) []byte { return binary.LittleEndian.AppendUint32(nil, v) } + +// TestGotcPercentRate is parse_percent_rate over a sysfs speed file (W9). +func TestGotcPercentRate(t *testing.T) { + tests := []struct { + description string + speed *string // nil: no file + str, dev string + expected uint64 + ok bool + stderr string + }{ + {"positive: 10% of 1000 Mbit/s", ptr("1000\n"), "10%", "d0", 12500000, true, ""}, + {"positive: 100% of 10 Mbit/s", ptr("10"), "100%", "d0", 1250000, true, ""}, + {"negative: no device", ptr("1000"), "10%", "", 0, false, + "No device specified; specify device to rate limit by percentage\n"}, + {"negative: a speed that reads empty is unknown (the dummy's EINVAL)", ptr(""), "10%", "d0", 0, false, + "property \"speed\" in file /sys/class/net/d0/speed is currently unknown\n" + + "Failed to parse /sys/class/net/d0/speed\n"}, + {"negative: no speed file is fopen's errno", nil, "10%", "d0", 0, false, + "fopen /sys/class/net/d0/speed: No such file or directory\n"}, + {"negative: a speed that is not a number", ptr("fast\n"), "10%", "d0", 0, false, + "value \"fast\" in file /sys/class/net/d0/speed is not a number\nFailed to parse /sys/class/net/d0/speed\n"}, + {"negative: over 100%", ptr("1000"), "150%", "d0", 0, false, + "Invalid rate specified; should be between [0,100]% but is 150%\n"}, + {"negative: malformed", ptr("1000"), "x%", "d0", 0, false, "Specified rate value could not be read or is malformed\n"}, + {"boundary: -1 speed gives a negative rate get_rate refuses", ptr("-1"), "10%", "d0", 0, false, ""}, + {"corner: a huge speed overflows r_str[20]", ptr("99999999999999"), "100%", "d0", 0, false, + "Unable to parse calculated rate\n"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + root := t.TempDir() + if tc.speed != nil { + d := filepath.Join(root, "sys", "class", "net", "d0") + if err := os.MkdirAll(d, 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(d, "speed"), []byte(*tc.speed), 0o600); err != nil { + t.Fatal(err) + } + } + var errb bytes.Buffer + r := &runner{stderr: &errb, sys: sysFS{root: root}} + got, ok := r.getPercentRate64(tc.str, tc.dev) + if got != tc.expected || ok != tc.ok || errb.String() != tc.stderr { + t.Errorf("got %d %t %q; want %d %t %q", got, ok, errb.String(), tc.expected, tc.ok, tc.stderr) + } + }) + } +} + +// TestGotcWriteOut is the kernel socket's path: GOTC_WRITE_OUT or +// ErrWriteNotApplied, and never the socket. +func TestGotcWriteOut(t *testing.T) { + path := filepath.Join(t.TempDir(), "w.bin") + tests := []struct { + description string + env *string + writes int + expected error + size int // file bytes after + }{ + {"negative: no GOTC_WRITE_OUT is ErrWriteNotApplied", nil, 1, ErrWriteNotApplied, -1}, + {"negative: an empty GOTC_WRITE_OUT is ErrWriteNotApplied", ptr(""), 1, ErrWriteNotApplied, -1}, + {"positive: one write is one request", &path, 1, nil, 52}, + {"corner: a second write appends; a new run truncates", &path, 2, nil, 104}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if tc.env == nil { + t.Setenv(writeOutEnvCst, "") + if err := os.Unsetenv(writeOutEnvCst); err != nil { + t.Fatal(err) + } + } else { + t.Setenv(writeOutEnvCst, *tc.env) + } + r := &runner{src: &LiveSource{fd: -1}, stderr: &bytes.Buffer{}} + w := xtcpnl.TcWrite{MsgType: unix.RTM_NEWQDISC, Kind: "pfifo_fast"} + var err error + for range tc.writes { + if err = r.sendWrite(&w); err != nil { + break + } + } + if !errors.Is(err, tc.expected) { + t.Fatalf("err %v, want %v", err, tc.expected) + } + if tc.size < 0 { + return + } + st, err := os.Stat(path) + if err != nil || int(st.Size()) != tc.size { + t.Fatalf("file %v %v, want %d bytes", st, err, tc.size) + } + }) + } +} + +// TestIsGetRequest is the kernel socket's guard: only RTM_GET* goes out. +func TestIsGetRequest(t *testing.T) { + hdr := func(typ uint16) []byte { + b := make([]byte, nlHeaderLen) + binary.LittleEndian.PutUint16(b[4:], typ) + return b + } + tests := []struct { + description string + req []byte + expected bool + }{ + {"positive: RTM_GETQDISC", hdr(unix.RTM_GETQDISC), true}, + {"positive: RTM_GETLINK", hdr(unix.RTM_GETLINK), true}, + {"positive: RTM_GETCHAIN", hdr(unix.RTM_GETCHAIN), true}, + {"negative: RTM_NEWQDISC", hdr(unix.RTM_NEWQDISC), false}, + {"negative: RTM_DELTCLASS", hdr(unix.RTM_DELTCLASS), false}, + {"negative: RTM_SETLINK", hdr(unix.RTM_SETLINK), false}, + {"boundary: a short request", make([]byte, nlHeaderLen-1), false}, + {"corner: NLMSG_DONE (3) is under RTM_BASE", hdr(unix.NLMSG_DONE), false}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := isGetRequest(tc.req); got != tc.expected { + t.Errorf("got %t, want %t", got, tc.expected) + } + }) + } +} + +// TestGotcGarbage is the "Garbage instead of arguments" arm the loops +// never reach (W5), called directly: the class one has no newline. +func TestGotcGarbage(t *testing.T) { + tests := []struct { + description string + word string + qdisc bool + expected string + }{ + {"positive: qdisc ends in a newline", "x", true, "Garbage instead of arguments \"x ...\". Try \"tc qdisc help\".\n"}, + {"negative: class has none (W5)", "x", false, "Garbage instead of arguments \"x ...\". Try \"tc class help\"."}, + {"corner: help prints usage first", "help", true, + qdiscUsageText + "Garbage instead of arguments \"help ...\". Try \"tc qdisc help\".\n"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + var errb bytes.Buffer + r := &runner{stderr: &errb} + var rc retCode + if err := r.garbage(tc.word, tc.qdisc); !errors.As(err, &rc) || rc != -1 || errb.String() != tc.expected { + t.Errorf("got %v %q; want return -1 %q", err, errb.String(), tc.expected) + } + }) + } +} + +// TestGotcStabDefaultTable is a stab whose tsize defaults to 512: its +// TCA_STAB_DATA is 512 __u16s, after TCA_STAB_BASE. +func TestGotcStabDefaultTable(t *testing.T) { + tests := []struct { + description string + args []string + expected int // TCA_STAB payload bytes + }{ + {"positive: linklayer atm sends the default 512-slot table", []string{"qdisc", "add", "stab", "linklayer", "atm", "root", "pfifo"}, + 4 + xtcpnl.TcSizespecSizeCst + 4 + 2*512}, + {"boundary: overhead alone sends BASE only", []string{"qdisc", "add", "stab", "overhead", "4", "root", "pfifo"}, + 4 + xtcpnl.TcSizespecSizeCst}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + src := &fakeSource{replies: []Reply{rep(ack())}} + var out, errb bytes.Buffer + if rc := run(config{src: src, stdin: strings.NewReader(""), sys: emptySys(t)}, tc.args, &out, &errb); rc != 0 { + t.Fatalf("rc %d: %s", rc, errb.String()) + } + a := lastWrite(t, src.reqs).attrs[len(kind("pfifo")):] + if got := int(binary.LittleEndian.Uint16(a)) - 4; got != tc.expected { + t.Errorf("TCA_STAB payload %d, want %d", got, tc.expected) + } + }) + } +} + +// TestGotcHexOverflow is strtod's ERANGE on a hex float: tc's get_time and +// get_rate64 reject it as they reject a decimal overflow, before sending. +// +// go test -tags gotc_write ./internal/gotc/ -run TestGotcHexOverflow +func TestGotcHexOverflow(t *testing.T) { + tests := []struct { + description string + args string + expected string // stderr; rc is 1 and nothing is sent + }{ + {"negative: fq_codel target", "qdisc add root fq_codel target 0x1p1024", "Illegal \"target\"\n"}, + {"negative: netem delay", "qdisc add root netem delay 0x1p1024", "Illegal \"latency\"\n"}, + {"negative: netem rate", "qdisc add root netem rate 0x1p1024", "Illegal \"rate\"\n"}, + {"negative: fq timer_slack", "qdisc add root fq timer_slack 0x1p1024", "Illegal \"timer_slack\"\n"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + src := &fakeSource{replies: []Reply{rep(ack())}} + var out, errb bytes.Buffer + rc := run(config{src: src, stdin: strings.NewReader(""), sys: emptySys(t)}, strings.Fields(tc.args), &out, &errb) + if rc != 1 || len(src.reqs) != 0 || errb.String() != tc.expected { + t.Errorf("rc=%d requests=%d stderr=%q, want rc=1, no request, %q", rc, len(src.reqs), errb.String(), tc.expected) + } + }) + } +} diff --git a/internal/gotc/source.go b/internal/gotc/source.go index 54ca8d19d..0caec0ba0 100644 --- a/internal/gotc/source.go +++ b/internal/gotc/source.go @@ -1,6 +1,7 @@ package gotc import ( + "encoding/binary" "errors" "fmt" @@ -72,6 +73,9 @@ func (s *LiveSource) Close() error { return unix.Close(s.fd) } // Talk sends req and reads until the dump's NLMSG_DONE or NLMSG_ERROR, or a // get's one reply. func (s *LiveSource) Talk(req []byte) (Reply, error) { + if !isGetRequest(req) { + return Reply{}, fmt.Errorf("%w: refusing to send a request that is not a get or dump", errLive) + } if err := unix.Sendto(s.fd, req, 0, &unix.SockaddrNetlink{Family: unix.AF_NETLINK}); err != nil { return Reply{}, fmt.Errorf("%w: send: %w", errLive, err) } @@ -93,3 +97,15 @@ func (s *LiveSource) Talk(req []byte) (Reply, error) { // nlHeaderLen is the nlmsghdr length. const nlHeaderLen = xtcpnl.NlMsgHdrSizeCst + +// isGetRequest reports whether req is an rtnetlink RTM_GET*: every get +// type is 2 mod 4 (RTM_BASE is 16, and each object's NEW, DEL, GET, SET +// come in fours). The kernel socket never carries a write, whatever the +// build (increment 17: writes are dry-run). +func isGetRequest(req []byte) bool { + if len(req) < nlHeaderLen { + return false + } + t := binary.LittleEndian.Uint16(req[4:6]) + return t >= unix.RTM_BASE && t%4 == unix.RTM_GETLINK%4 +} diff --git a/internal/gotc/testdata/tc-lib/experimental.dist b/internal/gotc/testdata/tc-lib/experimental.dist new file mode 100644 index 000000000..025c198c6 --- /dev/null +++ b/internal/gotc/testdata/tc-lib/experimental.dist @@ -0,0 +1,513 @@ +# This is the distribution table for the experimental distribution. +-10576 -10197 -10134 -10071 -10008 -9945 -9882 -9819 +-9788 -9756 -9725 -9693 -9672 -9651 -9630 -9615 +-9599 -9583 -9567 -9546 -9525 -9504 -9483 -9462 +-9441 -9420 -9399 -9378 -9366 -9353 -9341 -9328 +-9315 -9303 -9290 -9278 -9265 -9252 -9245 -9237 +-9229 -9221 -9213 -9205 -9197 -9189 -9183 -9177 +-9171 -9164 -9158 -9152 -9145 -9139 -9133 -9126 +-9119 -9111 -9103 -9095 -9087 -9079 -9071 -9063 +-9054 -9045 -9036 -9027 -9018 -9009 -9000 -8993 +-8986 -8979 -8972 -8965 -8958 -8951 -8944 -8937 +-8932 -8927 -8922 -8916 -8911 -8906 -8901 -8895 +-8890 -8885 -8880 -8874 -8867 -8859 -8851 -8843 +-8835 -8827 -8819 -8811 -8804 -8797 -8790 -8783 +-8776 -8769 -8762 -8755 -8748 -8744 -8740 -8736 +-8732 -8727 -8723 -8719 -8715 -8711 -8706 -8702 +-8698 -8694 -8690 -8685 -8681 -8676 -8671 -8666 +-8661 -8656 -8652 -8647 -8642 -8637 -8632 -8627 +-8622 -8618 -8613 -8609 -8604 -8600 -8595 -8591 +-8586 -8582 -8577 -8573 -8568 -8564 -8559 -8556 +-8552 -8548 -8545 -8541 -8537 -8534 -8530 -8526 +-8522 -8519 -8515 -8511 -8508 -8504 -8500 -8496 +-8492 -8487 -8482 -8477 -8472 -8467 -8463 -8458 +-8453 -8448 -8443 -8438 -8433 -8429 -8425 -8421 +-8416 -8412 -8408 -8404 -8399 -8395 -8391 -8387 +-8382 -8378 -8374 -8369 -8366 -8362 -8358 -8354 +-8350 -8346 -8342 -8338 -8334 -8330 -8326 -8322 +-8318 -8314 -8310 -8306 -8303 -8299 -8295 -8292 +-8288 -8284 -8281 -8277 -8273 -8269 -8266 -8262 +-8258 -8255 -8251 -8247 -8243 -8240 -8236 -8232 +-8229 -8225 -8221 -8218 -8214 -8210 -8206 -8203 +-8199 -8195 -8192 -8188 -8184 -8180 -8176 -8172 +-8168 -8164 -8159 -8155 -8151 -8147 -8143 -8138 +-8134 -8130 -8126 -8122 -8117 -8114 -8111 -8108 +-8105 -8102 -8099 -8095 -8092 -8089 -8086 -8083 +-8080 -8077 -8073 -8070 -8067 -8064 -8061 -8058 +-8054 -8051 -8047 -8043 -8040 -8036 -8032 -8029 +-8025 -8021 -8017 -8014 -8010 -8006 -8003 -7999 +-7995 -7991 -7988 -7984 -7981 -7977 -7974 -7970 +-7967 -7963 -7960 -7956 -7953 -7949 -7946 -7942 +-7939 -7935 -7932 -7928 -7925 -7921 -7917 -7914 +-7910 -7906 -7903 -7899 -7895 -7891 -7888 -7884 +-7880 -7877 -7873 -7869 -7865 -7861 -7857 -7853 +-7849 -7844 -7840 -7836 -7832 -7828 -7823 -7819 +-7815 -7811 -7807 -7802 -7800 -7797 -7794 -7792 +-7789 -7786 -7783 -7781 -7778 -7775 -7772 -7770 +-7767 -7764 -7761 -7759 -7756 -7753 -7750 -7748 +-7745 -7742 -7739 -7736 -7733 -7730 -7727 -7724 +-7721 -7717 -7714 -7711 -7708 -7705 -7702 -7699 +-7695 -7692 -7689 -7686 -7683 -7680 -7676 -7674 +-7671 -7668 -7665 -7662 -7659 -7656 -7654 -7651 +-7648 -7645 -7642 -7639 -7636 -7634 -7631 -7628 +-7625 -7622 -7619 -7616 -7613 -7611 -7609 -7606 +-7604 -7601 -7599 -7597 -7594 -7592 -7589 -7587 +-7584 -7582 -7580 -7577 -7575 -7572 -7570 -7567 +-7565 -7563 -7560 -7558 -7555 -7553 -7550 -7547 +-7544 -7541 -7537 -7534 -7531 -7527 -7524 -7521 +-7517 -7514 -7511 -7507 -7504 -7501 -7497 -7494 +-7491 -7487 -7484 -7480 -7477 -7473 -7470 -7466 +-7463 -7459 -7456 -7452 -7449 -7445 -7442 -7438 +-7435 -7431 -7428 -7424 -7420 -7416 -7412 -7408 +-7403 -7399 -7395 -7391 -7387 -7382 -7378 -7374 +-7370 -7366 -7361 -7359 -7357 -7354 -7352 -7349 +-7347 -7345 -7342 -7340 -7337 -7335 -7332 -7330 +-7328 -7325 -7323 -7320 -7318 -7315 -7313 -7311 +-7308 -7306 -7303 -7301 -7298 -7296 -7294 -7291 +-7289 -7286 -7284 -7282 -7279 -7277 -7274 -7272 +-7269 -7267 -7265 -7262 -7260 -7257 -7255 -7252 +-7250 -7248 -7245 -7243 -7240 -7238 -7235 -7232 +-7229 -7226 -7222 -7219 -7216 -7212 -7209 -7206 +-7202 -7199 -7196 -7192 -7189 -7186 -7182 -7179 +-7176 -7172 -7169 -7165 -7162 -7158 -7155 -7151 +-7148 -7144 -7141 -7137 -7134 -7130 -7127 -7123 +-7120 -7116 -7113 -7109 -7107 -7104 -7101 -7098 +-7095 -7092 -7089 -7087 -7084 -7081 -7078 -7075 +-7072 -7069 -7067 -7064 -7061 -7058 -7055 -7052 +-7049 -7046 -7043 -7040 -7037 -7034 -7031 -7028 +-7025 -7022 -7019 -7016 -7013 -7010 -7007 -7004 +-7001 -6998 -6995 -6992 -6989 -6986 -6983 -6980 +-6977 -6974 -6970 -6967 -6964 -6960 -6957 -6954 +-6950 -6947 -6944 -6940 -6937 -6934 -6930 -6927 +-6924 -6920 -6918 -6915 -6912 -6909 -6906 -6903 +-6900 -6898 -6895 -6892 -6889 -6886 -6883 -6880 +-6878 -6875 -6872 -6869 -6866 -6863 -6860 -6857 +-6855 -6852 -6850 -6847 -6844 -6842 -6839 -6836 +-6834 -6831 -6829 -6826 -6823 -6821 -6818 -6815 +-6813 -6810 -6808 -6805 -6802 -6800 -6797 -6794 +-6792 -6789 -6786 -6783 -6780 -6777 -6774 -6772 +-6769 -6766 -6763 -6760 -6757 -6754 -6752 -6749 +-6746 -6743 -6740 -6737 -6734 -6731 -6729 -6727 +-6725 -6722 -6720 -6718 -6715 -6713 -6711 -6709 +-6706 -6704 -6702 -6699 -6697 -6695 -6693 -6690 +-6688 -6686 -6683 -6681 -6679 -6677 -6674 -6672 +-6670 -6667 -6665 -6662 -6659 -6656 -6653 -6651 +-6648 -6645 -6642 -6639 -6636 -6634 -6631 -6628 +-6625 -6622 -6620 -6617 -6614 -6611 -6608 -6605 +-6602 -6599 -6596 -6593 -6589 -6586 -6583 -6580 +-6577 -6573 -6570 -6567 -6564 -6561 -6557 -6554 +-6551 -6548 -6545 -6541 -6539 -6537 -6534 -6532 +-6530 -6527 -6525 -6523 -6520 -6518 -6516 -6513 +-6511 -6509 -6506 -6504 -6502 -6499 -6497 -6495 +-6492 -6490 -6488 -6485 -6483 -6481 -6478 -6475 +-6472 -6469 -6465 -6462 -6459 -6455 -6452 -6449 +-6445 -6442 -6439 -6435 -6432 -6429 -6425 -6422 +-6419 -6415 -6412 -6408 -6405 -6401 -6398 -6394 +-6391 -6387 -6384 -6380 -6377 -6373 -6370 -6366 +-6363 -6359 -6356 -6352 -6349 -6346 -6343 -6340 +-6337 -6334 -6331 -6328 -6325 -6322 -6319 -6316 +-6313 -6310 -6307 -6304 -6301 -6298 -6295 -6292 +-6289 -6287 -6284 -6282 -6279 -6276 -6274 -6271 +-6268 -6266 -6263 -6261 -6258 -6255 -6253 -6250 +-6247 -6245 -6242 -6240 -6237 -6234 -6232 -6229 +-6226 -6223 -6219 -6216 -6212 -6209 -6205 -6202 +-6198 -6195 -6191 -6188 -6184 -6181 -6177 -6174 +-6170 -6167 -6163 -6160 -6156 -6152 -6149 -6145 +-6141 -6138 -6134 -6130 -6126 -6123 -6119 -6115 +-6112 -6108 -6104 -6100 -6098 -6095 -6092 -6089 +-6086 -6083 -6080 -6078 -6075 -6072 -6069 -6066 +-6063 -6060 -6058 -6055 -6052 -6049 -6046 -6043 +-6040 -6037 -6035 -6032 -6029 -6027 -6024 -6021 +-6018 -6016 -6013 -6010 -6007 -6005 -6002 -5999 +-5996 -5994 -5991 -5988 -5985 -5983 -5980 -5977 +-5974 -5971 -5968 -5965 -5962 -5959 -5956 -5952 +-5949 -5946 -5943 -5940 -5937 -5934 -5930 -5927 +-5924 -5921 -5918 -5915 -5911 -5909 -5906 -5903 +-5900 -5897 -5894 -5891 -5889 -5886 -5883 -5880 +-5877 -5874 -5871 -5869 -5866 -5863 -5860 -5857 +-5854 -5851 -5848 -5846 -5843 -5840 -5837 -5834 +-5831 -5828 -5826 -5823 -5820 -5817 -5814 -5811 +-5808 -5806 -5803 -5800 -5797 -5794 -5791 -5788 +-5785 -5782 -5779 -5776 -5772 -5769 -5766 -5762 +-5759 -5756 -5752 -5749 -5746 -5742 -5739 -5736 +-5732 -5729 -5726 -5722 -5720 -5717 -5714 -5711 +-5708 -5705 -5702 -5700 -5697 -5694 -5691 -5688 +-5685 -5682 -5680 -5677 -5674 -5671 -5668 -5665 +-5662 -5659 -5657 -5655 -5652 -5650 -5647 -5645 +-5643 -5640 -5638 -5635 -5633 -5630 -5628 -5626 +-5623 -5621 -5618 -5616 -5613 -5611 -5609 -5606 +-5604 -5601 -5599 -5596 -5592 -5587 -5583 -5578 +-5574 -5569 -5565 -5560 -5556 -5551 -5547 -5542 +-5538 -5533 -5531 -5528 -5526 -5523 -5521 -5518 +-5516 -5513 -5511 -5508 -5506 -5503 -5501 -5498 +-5496 -5493 -5491 -5488 -5486 -5483 -5481 -5478 +-5476 -5473 -5470 -5467 -5464 -5461 -5457 -5454 +-5451 -5447 -5444 -5441 -5437 -5434 -5431 -5427 +-5424 -5421 -5417 -5414 -5411 -5407 -5404 -5401 +-5398 -5394 -5391 -5388 -5384 -5381 -5378 -5374 +-5371 -5368 -5364 -5361 -5358 -5354 -5351 -5348 +-5344 -5341 -5338 -5335 -5331 -5328 -5325 -5321 +-5318 -5315 -5311 -5308 -5305 -5301 -5298 -5295 +-5291 -5288 -5285 -5281 -5278 -5274 -5270 -5267 +-5263 -5259 -5256 -5252 -5248 -5244 -5241 -5237 +-5233 -5230 -5226 -5222 -5218 -5216 -5214 -5212 +-5210 -5208 -5205 -5203 -5201 -5199 -5197 -5195 +-5192 -5190 -5188 -5186 -5184 -5182 -5179 -5177 +-5175 -5173 -5171 -5169 -5166 -5164 -5162 -5160 +-5158 -5155 -5152 -5148 -5144 -5140 -5136 -5132 +-5128 -5124 -5120 -5116 -5112 -5108 -5104 -5100 +-5096 -5092 -5089 -5086 -5083 -5079 -5076 -5073 +-5069 -5066 -5063 -5059 -5056 -5053 -5049 -5046 +-5043 -5039 -5036 -5033 -5029 -5027 -5024 -5022 +-5019 -5017 -5014 -5012 -5009 -5007 -5004 -5002 +-4999 -4997 -4994 -4992 -4989 -4987 -4984 -4982 +-4979 -4977 -4974 -4972 -4969 -4966 -4963 -4960 +-4957 -4954 -4951 -4948 -4944 -4941 -4938 -4935 +-4932 -4929 -4926 -4922 -4919 -4916 -4913 -4910 +-4907 -4903 -4899 -4895 -4891 -4887 -4882 -4878 +-4874 -4870 -4866 -4861 -4857 -4853 -4849 -4845 +-4840 -4837 -4833 -4829 -4825 -4822 -4818 -4814 +-4810 -4807 -4803 -4799 -4795 -4792 -4788 -4784 +-4780 -4776 -4774 -4771 -4768 -4765 -4762 -4759 +-4756 -4753 -4750 -4747 -4744 -4741 -4738 -4735 +-4732 -4729 -4726 -4723 -4720 -4717 -4714 -4711 +-4708 -4705 -4702 -4699 -4696 -4693 -4690 -4687 +-4684 -4681 -4678 -4675 -4672 -4669 -4666 -4663 +-4660 -4657 -4654 -4650 -4647 -4643 -4639 -4636 +-4632 -4628 -4625 -4621 -4617 -4613 -4610 -4606 +-4602 -4599 -4595 -4591 -4587 -4584 -4580 -4576 +-4572 -4568 -4564 -4560 -4556 -4552 -4548 -4544 +-4540 -4536 -4532 -4528 -4524 -4520 -4516 -4512 +-4508 -4503 -4499 -4495 -4491 -4487 -4482 -4478 +-4474 -4470 -4466 -4461 -4459 -4456 -4453 -4450 +-4447 -4444 -4441 -4439 -4436 -4433 -4430 -4427 +-4424 -4421 -4419 -4416 -4413 -4410 -4407 -4404 +-4401 -4398 -4395 -4391 -4388 -4384 -4381 -4377 +-4374 -4370 -4367 -4363 -4360 -4356 -4353 -4349 +-4346 -4342 -4339 -4335 -4332 -4329 -4326 -4323 +-4320 -4317 -4314 -4311 -4308 -4305 -4302 -4299 +-4296 -4293 -4290 -4287 -4284 -4281 -4278 -4275 +-4272 -4268 -4263 -4258 -4253 -4248 -4243 -4239 +-4234 -4229 -4224 -4219 -4214 -4209 -4206 -4202 +-4199 -4195 -4192 -4188 -4185 -4181 -4178 -4174 +-4171 -4167 -4164 -4160 -4157 -4153 -4150 -4146 +-4142 -4138 -4134 -4130 -4125 -4121 -4117 -4113 +-4109 -4104 -4100 -4096 -4092 -4088 -4083 -4080 +-4076 -4073 -4069 -4066 -4062 -4059 -4055 -4052 +-4048 -4045 -4041 -4038 -4034 -4031 -4027 -4024 +-4020 -4017 -4013 -4010 -4006 -4003 -3999 -3996 +-3992 -3989 -3985 -3982 -3978 -3975 -3971 -3968 +-3964 -3961 -3957 -3954 -3950 -3947 -3943 -3940 +-3936 -3933 -3929 -3926 -3922 -3919 -3915 -3912 +-3908 -3905 -3901 -3898 -3894 -3891 -3887 -3884 +-3880 -3877 -3873 -3870 -3866 -3863 -3859 -3856 +-3852 -3849 -3845 -3842 -3838 -3835 -3831 -3827 +-3823 -3819 -3815 -3810 -3806 -3802 -3798 -3794 +-3789 -3785 -3781 -3777 -3773 -3768 -3765 -3761 +-3757 -3754 -3750 -3746 -3743 -3739 -3735 -3731 +-3728 -3724 -3720 -3717 -3713 -3709 -3705 -3702 +-3699 -3696 -3692 -3689 -3686 -3682 -3679 -3676 +-3672 -3669 -3666 -3662 -3659 -3656 -3652 -3649 +-3646 -3642 -3639 -3635 -3631 -3628 -3624 -3620 +-3617 -3613 -3609 -3605 -3602 -3598 -3594 -3591 +-3587 -3583 -3579 -3575 -3570 -3566 -3561 -3557 +-3552 -3548 -3543 -3539 -3534 -3530 -3525 -3521 +-3516 -3513 -3509 -3505 -3501 -3497 -3493 -3489 +-3485 -3481 -3477 -3473 -3469 -3465 -3461 -3457 +-3453 -3450 -3446 -3442 -3439 -3435 -3431 -3428 +-3424 -3420 -3416 -3413 -3409 -3405 -3402 -3398 +-3394 -3390 -3387 -3383 -3380 -3376 -3373 -3369 +-3366 -3362 -3359 -3355 -3352 -3348 -3345 -3341 +-3338 -3334 -3331 -3327 -3323 -3318 -3314 -3309 +-3305 -3300 -3296 -3291 -3287 -3282 -3278 -3273 +-3269 -3264 -3260 -3255 -3250 -3245 -3240 -3235 +-3231 -3226 -3221 -3216 -3211 -3206 -3201 -3198 +-3194 -3190 -3186 -3182 -3178 -3174 -3170 -3166 +-3162 -3158 -3154 -3150 -3146 -3142 -3138 -3135 +-3131 -3128 -3124 -3121 -3117 -3114 -3110 -3107 +-3103 -3100 -3096 -3093 -3089 -3086 -3082 -3079 +-3075 -3072 -3068 -3065 -3061 -3058 -3054 -3051 +-3047 -3044 -3040 -3037 -3033 -3030 -3026 -3023 +-3019 -3016 -3012 -3008 -3004 -3000 -2995 -2991 +-2987 -2983 -2978 -2974 -2970 -2966 -2961 -2957 +-2953 -2948 -2945 -2942 -2939 -2935 -2932 -2929 +-2925 -2922 -2919 -2915 -2912 -2909 -2905 -2902 +-2899 -2895 -2892 -2889 -2885 -2882 -2878 -2874 +-2870 -2866 -2862 -2858 -2854 -2850 -2846 -2842 +-2838 -2834 -2830 -2826 -2822 -2819 -2815 -2811 +-2807 -2803 -2799 -2795 -2791 -2787 -2783 -2779 +-2775 -2771 -2767 -2763 -2759 -2755 -2750 -2745 +-2740 -2735 -2730 -2726 -2721 -2716 -2711 -2706 +-2701 -2696 -2692 -2688 -2684 -2680 -2675 -2671 +-2667 -2663 -2659 -2654 -2650 -2646 -2642 -2638 +-2633 -2630 -2626 -2622 -2618 -2614 -2610 -2606 +-2602 -2598 -2594 -2590 -2586 -2582 -2578 -2574 +-2570 -2566 -2561 -2557 -2552 -2548 -2543 -2539 +-2534 -2530 -2525 -2521 -2516 -2512 -2507 -2502 +-2497 -2492 -2486 -2481 -2476 -2471 -2465 -2460 +-2455 -2450 -2444 -2439 -2434 -2429 -2423 -2418 +-2413 -2408 -2402 -2397 -2392 -2387 -2381 -2376 +-2371 -2366 -2360 -2355 -2350 -2345 -2339 -2334 +-2329 -2324 -2318 -2314 -2309 -2305 -2300 -2296 +-2291 -2287 -2282 -2278 -2273 -2269 -2264 -2260 +-2255 -2251 -2246 -2242 -2237 -2233 -2228 -2224 +-2219 -2215 -2210 -2206 -2201 -2197 -2192 -2188 +-2183 -2179 -2174 -2170 -2165 -2161 -2156 -2152 +-2147 -2143 -2138 -2134 -2129 -2125 -2121 -2117 +-2113 -2108 -2104 -2100 -2096 -2092 -2087 -2083 +-2079 -2075 -2071 -2066 -2062 -2057 -2052 -2047 +-2042 -2037 -2033 -2028 -2023 -2018 -2013 -2008 +-2003 -1999 -1994 -1989 -1984 -1979 -1974 -1970 +-1965 -1960 -1955 -1950 -1945 -1940 -1936 -1931 +-1926 -1921 -1916 -1911 -1907 -1902 -1897 -1892 +-1887 -1882 -1877 -1873 -1869 -1865 -1861 -1856 +-1852 -1848 -1844 -1840 -1835 -1831 -1827 -1823 +-1819 -1814 -1811 -1807 -1803 -1800 -1796 -1792 +-1789 -1785 -1781 -1777 -1774 -1770 -1766 -1763 +-1759 -1755 -1751 -1747 -1742 -1737 -1732 -1727 +-1722 -1718 -1713 -1708 -1703 -1698 -1693 -1688 +-1684 -1679 -1674 -1669 -1664 -1659 -1655 -1650 +-1645 -1640 -1635 -1630 -1625 -1620 -1615 -1610 +-1604 -1599 -1594 -1589 -1583 -1578 -1573 -1568 +-1562 -1557 -1552 -1547 -1541 -1536 -1531 -1526 +-1520 -1515 -1510 -1505 -1499 -1495 -1490 -1485 +-1480 -1475 -1470 -1466 -1461 -1456 -1451 -1446 +-1441 -1436 -1431 -1426 -1421 -1415 -1410 -1405 +-1400 -1394 -1389 -1384 -1379 -1373 -1369 -1364 +-1360 -1355 -1351 -1346 -1342 -1337 -1333 -1328 +-1324 -1319 -1315 -1310 -1307 -1303 -1299 -1295 +-1292 -1288 -1284 -1280 -1277 -1273 -1269 -1265 +-1262 -1258 -1254 -1250 -1246 -1242 -1238 -1233 +-1229 -1224 -1220 -1215 -1211 -1207 -1202 -1198 +-1193 -1189 -1184 -1180 -1175 -1171 -1166 -1162 +-1157 -1153 -1148 -1144 -1139 -1135 -1130 -1126 +-1121 -1116 -1110 -1104 -1098 -1092 -1087 -1081 +-1075 -1069 -1063 -1057 -1052 -1047 -1042 -1036 +-1031 -1026 -1021 -1015 -1010 -1005 -1000 -994 +-990 -985 -981 -976 -972 -967 -963 -958 +-954 -949 -945 -940 -936 -931 -927 -923 +-919 -915 -910 -906 -902 -898 -894 -889 +-885 -881 -877 -873 -868 -861 -854 -847 +-840 -833 -826 -819 -812 -805 -800 -794 +-788 -783 -777 -771 -765 -760 -754 -748 +-742 -737 -731 -725 -720 -714 -708 -702 +-697 -691 -685 -679 -675 -670 -666 -661 +-657 -652 -648 -643 -639 -634 -630 -625 +-621 -616 -611 -605 -599 -594 -588 -582 +-576 -571 -565 -559 -553 -548 -542 -536 +-531 -525 -519 -513 -508 -502 -496 -490 +-485 -480 -475 -469 -464 -459 -454 -448 +-443 -438 -433 -427 -420 -412 -404 -396 +-388 -380 -372 -364 -355 -346 -337 -328 +-319 -310 -301 -294 -287 -280 -273 -266 +-259 -252 -245 -238 -234 -229 -224 -219 +-214 -209 -205 -200 -195 -190 -185 -180 +-175 -168 -161 -154 -147 -140 -133 -126 +-119 -112 -107 -101 -95 -90 -84 -78 +-72 -67 -61 -55 -49 -43 -37 -31 +-24 -18 -12 -5 1 7 14 21 +28 35 42 49 56 63 70 77 +83 89 95 102 108 114 121 127 +133 140 147 154 161 168 175 182 +189 196 203 210 217 224 231 238 +245 252 259 266 272 278 284 291 +297 303 310 316 322 329 334 339 +344 350 355 360 365 371 376 381 +386 392 399 406 413 420 427 434 +441 448 455 462 470 478 486 494 +502 510 518 523 529 535 540 546 +552 558 563 569 575 581 590 599 +608 617 626 635 645 652 659 666 +673 680 687 694 701 708 714 720 +726 733 739 745 752 758 764 771 +775 780 784 789 793 798 802 807 +811 816 820 825 829 834 839 845 +851 856 862 868 874 879 885 891 +897 902 907 912 918 923 928 933 +939 944 949 954 960 969 978 987 +996 1005 1014 1023 1033 1044 1054 1065 +1075 1086 1093 1101 1109 1117 1125 1133 +1141 1149 1158 1167 1176 1185 1194 1203 +1212 1218 1224 1230 1237 1243 1249 1256 +1262 1268 1275 1281 1287 1293 1300 1306 +1312 1319 1325 1331 1338 1347 1356 1365 +1374 1383 1392 1401 1406 1412 1418 1423 +1429 1435 1441 1446 1452 1458 1464 1469 +1475 1481 1486 1492 1498 1504 1509 1515 +1521 1527 1536 1545 1554 1563 1572 1581 +1590 1599 1608 1617 1626 1635 1644 1653 +1660 1667 1674 1681 1688 1695 1702 1709 +1716 1722 1728 1734 1741 1747 1753 1760 +1766 1772 1779 1789 1800 1810 1821 1831 +1842 1847 1853 1859 1864 1870 1876 1882 +1887 1893 1899 1905 1915 1926 1936 1947 +1957 1968 1975 1983 1991 1999 2007 2015 +2023 2031 2038 2046 2054 2062 2070 2078 +2086 2094 2101 2108 2115 2122 2129 2136 +2143 2150 2157 2164 2172 2180 2188 2196 +2204 2212 2220 2225 2231 2237 2242 2248 +2254 2260 2265 2271 2277 2283 2292 2301 +2310 2319 2328 2337 2347 2352 2358 2363 +2369 2375 2380 2386 2392 2397 2403 2409 +2417 2425 2433 2441 2449 2457 2465 2473 +2480 2488 2496 2504 2512 2520 2528 2536 +2542 2548 2554 2561 2567 2573 2580 2586 +2592 2599 2611 2624 2636 2649 2662 2669 +2676 2683 2690 2697 2704 2711 2718 2725 +2732 2740 2748 2756 2764 2772 2780 2788 +2795 2803 2811 2819 2827 2835 2843 2851 +2857 2863 2869 2876 2882 2888 2895 2901 +2907 2914 2921 2929 2937 2945 2953 2961 +2969 2977 2986 2995 3004 3013 3022 3031 +3040 3050 3061 3071 3082 3092 3103 3110 +3117 3124 3131 3138 3145 3152 3159 3166 +3173 3180 3187 3194 3201 3208 3215 3222 +3229 3235 3241 3247 3254 3260 3266 3273 +3279 3285 3292 3298 3304 3310 3317 3323 +3329 3336 3342 3348 3355 3361 3367 3373 +3380 3386 3392 3399 3405 3411 3418 3427 +3436 3445 3454 3463 3472 3481 3491 3502 +3512 3523 3533 3544 3551 3559 3567 3575 +3583 3591 3599 3607 3619 3632 3644 3657 +3670 3676 3682 3688 3695 3701 3707 3714 +3720 3726 3733 3738 3744 3750 3755 3761 +3767 3773 3778 3784 3790 3796 3803 3811 +3819 3827 3835 3843 3851 3859 3866 3874 +3882 3890 3898 3906 3914 3922 3932 3943 +3953 3964 3974 3985 3992 3999 4006 4013 +4020 4027 4034 4041 4048 4058 4069 4079 +4090 4100 4111 4120 4129 4138 4147 4156 +4165 4174 4180 4186 4193 4199 4206 4212 +4218 4225 4231 4238 4245 4253 4261 4269 +4276 4284 4292 4300 4308 4316 4324 4332 +4340 4348 4356 4364 4371 4379 4387 4395 +4403 4411 4419 4427 4434 4441 4448 4455 +4462 4469 4476 4483 4490 4505 4521 4537 +4553 4560 4567 4574 4581 4588 4595 4602 +4609 4616 4625 4634 4643 4652 4661 4670 +4679 4688 4697 4706 4715 4724 4733 4742 +4751 4760 4769 4778 4787 4796 4805 4812 +4819 4826 4833 4840 4847 4854 4861 4868 +4875 4882 4889 4896 4903 4910 4917 4924 +4931 4941 4952 4962 4973 4983 4994 5004 +5015 5025 5036 5046 5057 5064 5071 5078 +5085 5092 5099 5106 5113 5120 5129 5138 +5147 5156 5165 5174 5183 5193 5204 5214 +5225 5235 5246 5258 5271 5283 5296 5309 +5318 5327 5336 5345 5354 5363 5372 5382 +5393 5403 5414 5424 5435 5445 5456 5466 +5477 5487 5498 5505 5513 5521 5529 5537 +5545 5553 5561 5568 5576 5584 5592 5600 +5608 5616 5624 5634 5645 5655 5666 5676 +5687 5696 5705 5714 5723 5732 5741 5750 +5757 5764 5771 5778 5785 5792 5799 5806 +5813 5818 5824 5830 5835 5841 5847 5853 +5858 5864 5870 5876 5886 5897 5907 5918 +5928 5939 5951 5964 5976 5989 6002 6011 +6020 6029 6038 6047 6056 6066 6075 6084 +6093 6102 6111 6120 6129 6138 6147 6156 +6165 6174 6183 6192 6199 6207 6215 6223 +6231 6239 6247 6255 6262 6269 6276 6283 +6290 6297 6304 6311 6318 6325 6333 6341 +6349 6357 6365 6373 6381 6391 6402 6412 +6423 6433 6444 6453 6462 6471 6480 6489 +6498 6507 6514 6521 6528 6535 6542 6549 +6556 6563 6570 6579 6588 6597 6606 6615 +6624 6633 6640 6648 6656 6664 6672 6680 +6688 6696 6705 6714 6723 6732 6741 6750 +6759 6771 6784 6796 6809 6822 6837 6853 +6869 6885 6892 6900 6908 6916 6924 6932 +6940 6948 6957 6966 6975 6984 6993 7002 +7011 7021 7032 7042 7053 7063 7074 7083 +7092 7101 7110 7119 7128 7137 7142 7148 +7154 7159 7165 7171 7177 7182 7188 7194 +7200 7210 7221 7231 7242 7252 7263 7269 +7275 7281 7288 7294 7300 7307 7313 7319 +7326 7341 7357 7373 7389 7399 7410 7420 +7431 7441 7452 7459 7466 7473 7480 7487 +7494 7501 7508 7515 7522 7530 7538 7546 +7554 7562 7570 7578 7588 7599 7609 7620 +7630 7641 7651 7662 7672 7683 7693 7704 +7714 7725 7735 7746 7756 7767 7777 7788 +7798 7809 7819 7830 7839 7848 7857 7866 +7875 7884 7893 7902 7911 7920 7929 7938 +7947 7957 7966 7975 7984 7993 8002 8011 +8020 8030 8041 8051 8062 8072 8083 8090 +8098 8106 8114 8122 8130 8138 8146 8158 +8171 8183 8196 8209 8219 8230 8240 8251 +8261 8272 8281 8290 8299 8308 8317 8326 +8335 8345 8356 8366 8377 8387 8398 8413 +8429 8445 8461 8471 8482 8492 8503 8513 +8524 8531 8539 8547 8555 8563 8571 8579 +8587 8597 8608 8618 8629 8639 8650 8657 +8665 8673 8681 8689 8697 8705 8713 8722 +8731 8740 8749 8758 8767 8776 8783 8790 +8797 8804 8811 8818 8825 8832 8839 8849 +8860 8870 8881 8891 8902 8914 8927 8939 +8952 8965 8974 8983 8992 9001 9010 9019 +9028 9038 9049 9059 9070 9080 9091 9101 +9112 9122 9133 9143 9154 9166 9179 9191 +9204 9217 9223 9229 9235 9242 9248 9254 +9261 9267 9273 9280 9290 9301 9311 9322 +9332 9343 9353 9364 9374 9385 9395 9406 +9421 9437 9453 9469 9481 9494 9506 9519 +9532 9542 9553 9563 9574 9584 9595 9607 +9620 9633 9646 9659 9669 9679 9690 9700 +9710 9721 9733 9746 9759 9772 9785 9795 +9806 9816 9827 9837 9848 9858 9869 9879 +9890 9900 9911 9921 9932 9942 9953 9963 +9974 9981 9989 9997 10005 10013 10021 10029 +10037 10046 10055 10064 10073 10082 10091 10100 +10115 10131 10147 10163 10173 10184 10194 10205 +10215 10226 10235 10244 10253 10262 10271 10280 +10289 10299 10310 10320 10331 10341 10352 10373 +10394 10415 10430 10446 10462 10478 10487 10496 +10505 10514 10523 10532 10541 10553 10566 10578 +10591 10604 10619 10635 10651 10667 10676 10685 +10694 10703 10712 10721 10730 10742 10755 10767 +10780 10793 10803 10814 10824 10835 10845 10856 +10868 10881 10893 10906 10919 10929 10940 10950 +10961 10971 10982 10992 11003 11013 11024 11034 +11045 11060 11076 11092 11108 11123 11139 11155 +11171 11181 11192 11202 11213 11223 11234 11244 +11255 11265 11276 11286 11297 11307 11318 11329 +11339 11350 11361 11371 11381 11392 11402 11412 +11423 11433 11444 11454 11465 11475 11486 11518 +11550 11560 11571 11581 11592 11602 11613 11628 +11644 11660 11676 11697 11718 11739 11749 11760 +11770 11781 11791 11802 11817 11833 11849 11865 +11875 11886 11896 11907 11917 11928 11959 11991 +12006 12022 12038 12054 12069 12085 12101 12117 +12127 12138 12148 12159 12169 12180 12201 12222 +12243 12274 12306 12321 12337 12353 12369 12384 +12400 12416 12432 12453 12474 12495 12507 12520 +12532 12545 12558 12579 12600 12621 12642 12663 +12684 12705 12726 12747 12759 12772 12784 12797 +12810 12822 12835 12847 12860 12873 12894 12915 +12936 12948 12961 12973 12986 12999 13020 13041 +13062 13093 13125 13140 13156 13172 13188 13209 +13230 13252 13283 13314 13378 13399 13420 13441 +13451 13462 13472 13483 13493 13504 13519 13535 +13551 13567 13630 13651 13672 13693 13714 13735 +13756 13787 13819 13882 13897 13913 13929 13945 +13966 13987 14008 14029 14050 14071 14092 14113 +14134 14197 14212 14228 14244 14260 14281 14302 +14323 14354 14386 14417 14449 14480 14512 14533 +14554 14575 14606 14638 14669 14701 14764 14795 +14827 14842 14858 14874 14890 14953 14984 15016 +15048 15080 15111 15143 15174 15205 15226 15247 +15269 15284 15300 15316 15332 15395 15458 15479 +15500 15521 15584 15615 15647 15668 15689 15710 +15741 15773 15836 15899 15930 15962 15993 16025 +16056 16088 16151 16214 16245 16277 16340 16403 +16466 16529 16592 16718 16781 16844 16907 16971 +17034 17065 17097 17160 17223 17254 17286 17412 +17443 17475 17538 17601 17664 17727 17916 18042 +18105 18136 18168 18294 18325 18357 18546 18577 +18609 18735 18830 18925 18956 18988 19114 19177 +19240 19303 19366 19429 19555 19618 19681 19807 +19870 19933 20185 20374 20564 20753 20942 21068 +21509 21761 22139 22455 22644 23148 23400 23652 +24030 24913 25985 26174 26993 28128 28947 29136 +30082 30712 32767 32767 32767 32767 32767 32767 +32767 32767 32767 32767 32767 32767 32767 32767 diff --git a/internal/gotc/testdata/tc-lib/normal.dist b/internal/gotc/testdata/tc-lib/normal.dist new file mode 100644 index 000000000..8cfe76866 --- /dev/null +++ b/internal/gotc/testdata/tc-lib/normal.dist @@ -0,0 +1,513 @@ +# This is the distribution table for the normal distribution. + -32768 -28307 -26871 -25967 -25298 -24765 -24320 -23937 + -23600 -23298 -23025 -22776 -22546 -22333 -22133 -21946 + -21770 -21604 -21445 -21295 -21151 -21013 -20882 -20755 + -20633 -20516 -20403 -20293 -20187 -20084 -19984 -19887 + -19793 -19702 -19612 -19526 -19441 -19358 -19277 -19198 + -19121 -19045 -18971 -18899 -18828 -18758 -18690 -18623 + -18557 -18492 -18429 -18366 -18305 -18245 -18185 -18127 + -18070 -18013 -17957 -17902 -17848 -17794 -17741 -17690 + -17638 -17588 -17538 -17489 -17440 -17392 -17345 -17298 + -17252 -17206 -17160 -17116 -17071 -17028 -16984 -16942 + -16899 -16857 -16816 -16775 -16735 -16694 -16654 -16615 + -16576 -16538 -16499 -16461 -16424 -16386 -16350 -16313 + -16277 -16241 -16205 -16170 -16135 -16100 -16066 -16031 + -15998 -15964 -15931 -15897 -15865 -15832 -15800 -15768 + -15736 -15704 -15673 -15642 -15611 -15580 -15550 -15519 + -15489 -15460 -15430 -15401 -15371 -15342 -15313 -15285 + -15256 -15228 -15200 -15172 -15144 -15116 -15089 -15062 + -15035 -15008 -14981 -14954 -14928 -14902 -14875 -14850 + -14823 -14798 -14772 -14747 -14722 -14696 -14671 -14647 + -14622 -14597 -14573 -14549 -14524 -14500 -14476 -14453 + -14429 -14405 -14382 -14359 -14335 -14312 -14289 -14266 + -14243 -14221 -14198 -14176 -14153 -14131 -14109 -14087 + -14065 -14043 -14021 -14000 -13978 -13957 -13935 -13914 + -13893 -13872 -13851 -13830 -13809 -13788 -13768 -13747 + -13727 -13706 -13686 -13666 -13646 -13626 -13606 -13586 + -13566 -13547 -13527 -13507 -13488 -13468 -13449 -13430 + -13411 -13392 -13373 -13354 -13335 -13316 -13297 -13278 + -13260 -13242 -13223 -13204 -13186 -13168 -13150 -13131 + -13113 -13095 -13077 -13060 -13042 -13024 -13006 -12988 + -12971 -12954 -12936 -12918 -12901 -12884 -12867 -12850 + -12832 -12815 -12798 -12781 -12764 -12748 -12731 -12714 + -12697 -12681 -12664 -12648 -12631 -12615 -12598 -12582 + -12566 -12549 -12533 -12517 -12501 -12485 -12469 -12453 + -12437 -12422 -12406 -12390 -12374 -12358 -12343 -12327 + -12312 -12296 -12281 -12265 -12250 -12235 -12220 -12204 + -12189 -12174 -12159 -12144 -12129 -12114 -12099 -12084 + -12069 -12054 -12039 -12025 -12010 -11995 -11981 -11966 + -11952 -11937 -11923 -11908 -11894 -11879 -11865 -11851 + -11837 -11822 -11808 -11794 -11780 -11766 -11752 -11737 + -11724 -11710 -11696 -11682 -11668 -11654 -11640 -11627 + -11613 -11599 -11586 -11572 -11559 -11545 -11531 -11518 + -11504 -11491 -11478 -11464 -11451 -11438 -11425 -11411 + -11398 -11385 -11372 -11359 -11346 -11332 -11319 -11306 + -11293 -11280 -11268 -11255 -11242 -11229 -11216 -11203 + -11191 -11178 -11165 -11153 -11140 -11127 -11114 -11102 + -11090 -11077 -11065 -11052 -11040 -11027 -11015 -11002 + -10990 -10978 -10965 -10953 -10941 -10929 -10917 -10904 + -10892 -10880 -10868 -10856 -10844 -10832 -10820 -10808 + -10796 -10784 -10772 -10760 -10748 -10736 -10725 -10713 + -10701 -10689 -10677 -10666 -10654 -10643 -10631 -10619 + -10607 -10596 -10584 -10573 -10562 -10550 -10539 -10527 + -10516 -10504 -10493 -10481 -10470 -10459 -10447 -10436 + -10425 -10414 -10402 -10391 -10380 -10369 -10358 -10346 + -10335 -10324 -10313 -10302 -10291 -10280 -10269 -10258 + -10247 -10236 -10225 -10214 -10203 -10192 -10181 -10171 + -10160 -10149 -10138 -10127 -10117 -10106 -10095 -10085 + -10074 -10063 -10052 -10042 -10031 -10021 -10010 -10000 + -9989 -9978 -9968 -9957 -9947 -9936 -9926 -9916 + -9905 -9895 -9884 -9874 -9864 -9853 -9843 -9833 + -9822 -9812 -9802 -9791 -9781 -9771 -9761 -9751 + -9741 -9730 -9720 -9710 -9700 -9690 -9680 -9670 + -9660 -9650 -9640 -9630 -9619 -9610 -9600 -9590 + -9580 -9570 -9560 -9550 -9540 -9530 -9520 -9511 + -9501 -9491 -9481 -9472 -9462 -9452 -9442 -9432 + -9423 -9413 -9403 -9394 -9384 -9374 -9365 -9355 + -9345 -9336 -9326 -9317 -9307 -9298 -9288 -9278 + -9269 -9259 -9250 -9241 -9231 -9221 -9212 -9202 + -9193 -9184 -9175 -9165 -9156 -9146 -9137 -9128 + -9119 -9109 -9100 -9090 -9081 -9072 -9063 -9053 + -9044 -9035 -9026 -9017 -9008 -8998 -8989 -8980 + -8971 -8962 -8953 -8944 -8934 -8925 -8916 -8907 + -8898 -8889 -8880 -8871 -8862 -8853 -8844 -8835 + -8826 -8817 -8808 -8799 -8790 -8781 -8772 -8764 + -8755 -8746 -8737 -8728 -8719 -8711 -8702 -8693 + -8684 -8675 -8667 -8658 -8649 -8640 -8632 -8623 + -8614 -8605 -8597 -8588 -8579 -8570 -8562 -8553 + -8545 -8536 -8527 -8519 -8510 -8502 -8493 -8484 + -8476 -8467 -8459 -8450 -8442 -8433 -8425 -8416 + -8408 -8399 -8391 -8382 -8374 -8365 -8357 -8348 + -8340 -8332 -8323 -8315 -8306 -8298 -8290 -8281 + -8273 -8264 -8256 -8248 -8240 -8231 -8223 -8215 + -8206 -8198 -8190 -8182 -8174 -8165 -8157 -8149 + -8140 -8132 -8124 -8116 -8108 -8099 -8091 -8083 + -8075 -8067 -8059 -8051 -8042 -8034 -8027 -8018 + -8010 -8002 -7994 -7986 -7978 -7970 -7962 -7954 + -7946 -7938 -7930 -7922 -7913 -7906 -7897 -7890 + -7882 -7874 -7866 -7858 -7850 -7842 -7834 -7826 + -7818 -7810 -7802 -7795 -7787 -7779 -7771 -7763 + -7755 -7748 -7739 -7732 -7724 -7716 -7708 -7700 + -7693 -7685 -7677 -7669 -7662 -7654 -7646 -7638 + -7630 -7623 -7615 -7608 -7600 -7592 -7584 -7577 + -7569 -7561 -7553 -7546 -7538 -7530 -7523 -7515 + -7508 -7500 -7492 -7485 -7477 -7469 -7462 -7454 + -7447 -7439 -7432 -7424 -7417 -7409 -7401 -7394 + -7386 -7379 -7372 -7364 -7356 -7349 -7341 -7334 + -7327 -7319 -7311 -7304 -7297 -7289 -7281 -7274 + -7267 -7259 -7252 -7245 -7237 -7230 -7222 -7215 + -7208 -7200 -7193 -7186 -7178 -7171 -7163 -7156 + -7149 -7141 -7134 -7127 -7119 -7112 -7105 -7098 + -7090 -7083 -7075 -7068 -7061 -7054 -7046 -7039 + -7032 -7025 -7018 -7010 -7003 -6996 -6989 -6981 + -6974 -6967 -6960 -6953 -6946 -6938 -6931 -6924 + -6917 -6910 -6903 -6895 -6888 -6881 -6874 -6867 + -6860 -6853 -6845 -6838 -6831 -6824 -6817 -6810 + -6803 -6796 -6789 -6782 -6775 -6767 -6760 -6753 + -6747 -6740 -6732 -6725 -6718 -6711 -6704 -6697 + -6690 -6683 -6676 -6669 -6662 -6655 -6648 -6641 + -6634 -6627 -6620 -6613 -6607 -6600 -6593 -6586 + -6579 -6572 -6565 -6558 -6551 -6544 -6538 -6531 + -6524 -6517 -6510 -6503 -6496 -6489 -6482 -6476 + -6469 -6462 -6455 -6448 -6441 -6434 -6428 -6421 + -6414 -6407 -6400 -6394 -6387 -6380 -6373 -6366 + -6360 -6353 -6346 -6339 -6333 -6326 -6319 -6312 + -6306 -6299 -6292 -6286 -6279 -6272 -6265 -6259 + -6252 -6245 -6239 -6232 -6225 -6219 -6212 -6205 + -6198 -6192 -6185 -6178 -6172 -6165 -6158 -6152 + -6145 -6139 -6132 -6125 -6119 -6112 -6105 -6099 + -6092 -6085 -6079 -6072 -6066 -6059 -6053 -6046 + -6040 -6033 -6026 -6019 -6013 -6006 -6000 -5993 + -5987 -5980 -5974 -5967 -5961 -5954 -5948 -5941 + -5935 -5928 -5922 -5915 -5908 -5902 -5895 -5889 + -5883 -5876 -5870 -5863 -5857 -5850 -5844 -5837 + -5831 -5825 -5818 -5811 -5805 -5799 -5792 -5786 + -5779 -5773 -5766 -5760 -5754 -5747 -5741 -5734 + -5728 -5722 -5715 -5709 -5702 -5696 -5690 -5683 + -5677 -5671 -5664 -5658 -5651 -5645 -5639 -5632 + -5626 -5620 -5613 -5607 -5600 -5594 -5588 -5582 + -5575 -5569 -5563 -5556 -5550 -5544 -5537 -5531 + -5525 -5519 -5512 -5506 -5500 -5494 -5487 -5481 + -5475 -5468 -5462 -5456 -5450 -5443 -5437 -5431 + -5425 -5418 -5412 -5406 -5400 -5393 -5387 -5381 + -5375 -5369 -5362 -5356 -5350 -5344 -5337 -5331 + -5325 -5319 -5313 -5306 -5300 -5294 -5288 -5282 + -5276 -5270 -5263 -5257 -5251 -5245 -5239 -5233 + -5226 -5220 -5214 -5208 -5202 -5196 -5190 -5183 + -5177 -5171 -5165 -5159 -5153 -5147 -5140 -5135 + -5129 -5122 -5116 -5110 -5104 -5098 -5092 -5086 + -5080 -5074 -5068 -5061 -5055 -5050 -5043 -5037 + -5031 -5025 -5019 -5013 -5007 -5001 -4995 -4989 + -4983 -4977 -4971 -4965 -4959 -4953 -4947 -4941 + -4935 -4929 -4923 -4917 -4911 -4905 -4899 -4893 + -4887 -4881 -4875 -4869 -4863 -4857 -4851 -4845 + -4839 -4833 -4827 -4821 -4815 -4809 -4803 -4797 + -4791 -4785 -4779 -4773 -4767 -4762 -4755 -4750 + -4744 -4738 -4732 -4726 -4720 -4714 -4708 -4702 + -4696 -4690 -4685 -4678 -4673 -4667 -4661 -4655 + -4649 -4643 -4637 -4631 -4626 -4620 -4614 -4608 + -4602 -4596 -4590 -4585 -4579 -4573 -4567 -4561 + -4555 -4549 -4544 -4538 -4532 -4526 -4520 -4514 + -4508 -4503 -4497 -4491 -4485 -4479 -4474 -4468 + -4462 -4456 -4450 -4445 -4439 -4433 -4427 -4421 + -4415 -4410 -4404 -4398 -4392 -4386 -4381 -4375 + -4369 -4363 -4358 -4352 -4346 -4340 -4334 -4329 + -4323 -4317 -4311 -4306 -4300 -4294 -4289 -4283 + -4277 -4271 -4266 -4260 -4254 -4248 -4243 -4237 + -4231 -4225 -4220 -4214 -4208 -4202 -4197 -4191 + -4185 -4180 -4174 -4168 -4162 -4157 -4151 -4146 + -4140 -4134 -4128 -4123 -4117 -4111 -4105 -4100 + -4094 -4089 -4083 -4077 -4071 -4066 -4060 -4055 + -4049 -4043 -4037 -4032 -4026 -4021 -4015 -4009 + -4003 -3998 -3992 -3987 -3981 -3975 -3970 -3964 + -3958 -3953 -3947 -3942 -3936 -3930 -3925 -3919 + -3913 -3908 -3902 -3897 -3891 -3885 -3880 -3874 + -3869 -3863 -3857 -3852 -3846 -3840 -3835 -3829 + -3824 -3818 -3813 -3807 -3801 -3796 -3790 -3785 + -3779 -3774 -3768 -3762 -3757 -3751 -3746 -3740 + -3734 -3729 -3723 -3718 -3712 -3707 -3701 -3696 + -3690 -3684 -3679 -3673 -3668 -3662 -3657 -3651 + -3646 -3640 -3635 -3629 -3624 -3618 -3613 -3607 + -3602 -3596 -3591 -3585 -3579 -3574 -3568 -3563 + -3557 -3552 -3546 -3541 -3535 -3530 -3524 -3519 + -3514 -3508 -3502 -3497 -3491 -3486 -3480 -3475 + -3469 -3464 -3459 -3453 -3448 -3442 -3437 -3431 + -3425 -3420 -3415 -3409 -3404 -3398 -3393 -3387 + -3382 -3376 -3371 -3366 -3360 -3355 -3349 -3344 + -3338 -3333 -3328 -3322 -3317 -3311 -3305 -3300 + -3295 -3289 -3284 -3278 -3273 -3268 -3262 -3257 + -3251 -3246 -3240 -3235 -3230 -3224 -3219 -3213 + -3208 -3203 -3197 -3192 -3186 -3181 -3176 -3170 + -3165 -3159 -3154 -3149 -3143 -3138 -3132 -3127 + -3122 -3116 -3111 -3105 -3100 -3095 -3089 -3084 + -3079 -3073 -3068 -3062 -3057 -3052 -3046 -3041 + -3036 -3030 -3025 -3019 -3014 -3009 -3003 -2998 + -2993 -2987 -2982 -2977 -2971 -2966 -2961 -2955 + -2950 -2944 -2939 -2934 -2928 -2923 -2918 -2912 + -2907 -2902 -2896 -2891 -2886 -2880 -2875 -2870 + -2864 -2859 -2854 -2848 -2843 -2838 -2832 -2827 + -2822 -2816 -2811 -2806 -2800 -2795 -2790 -2784 + -2779 -2774 -2768 -2763 -2758 -2753 -2747 -2742 + -2737 -2732 -2726 -2721 -2716 -2710 -2705 -2700 + -2694 -2689 -2684 -2678 -2673 -2668 -2663 -2657 + -2652 -2647 -2642 -2636 -2631 -2626 -2620 -2615 + -2610 -2605 -2599 -2594 -2589 -2583 -2578 -2573 + -2568 -2562 -2557 -2552 -2546 -2542 -2536 -2531 + -2526 -2520 -2515 -2510 -2505 -2499 -2494 -2489 + -2483 -2478 -2473 -2468 -2463 -2457 -2452 -2447 + -2442 -2436 -2431 -2426 -2421 -2415 -2410 -2405 + -2400 -2395 -2389 -2384 -2379 -2374 -2368 -2363 + -2358 -2353 -2347 -2342 -2337 -2332 -2327 -2321 + -2316 -2311 -2306 -2300 -2295 -2290 -2285 -2279 + -2275 -2269 -2264 -2259 -2254 -2248 -2243 -2238 + -2233 -2227 -2222 -2217 -2212 -2207 -2202 -2196 + -2191 -2186 -2181 -2175 -2170 -2165 -2160 -2155 + -2150 -2144 -2139 -2134 -2129 -2124 -2118 -2113 + -2108 -2103 -2098 -2093 -2087 -2082 -2077 -2072 + -2067 -2062 -2056 -2051 -2046 -2041 -2036 -2030 + -2025 -2020 -2015 -2010 -2005 -2000 -1994 -1989 + -1984 -1979 -1974 -1969 -1963 -1958 -1953 -1948 + -1943 -1937 -1932 -1927 -1922 -1917 -1912 -1907 + -1901 -1896 -1891 -1886 -1881 -1876 -1871 -1865 + -1860 -1855 -1850 -1845 -1840 -1835 -1829 -1824 + -1819 -1814 -1809 -1804 -1799 -1794 -1788 -1783 + -1778 -1773 -1768 -1763 -1758 -1752 -1747 -1742 + -1737 -1732 -1727 -1722 -1717 -1711 -1706 -1701 + -1696 -1691 -1686 -1681 -1676 -1670 -1665 -1660 + -1655 -1650 -1645 -1640 -1635 -1629 -1624 -1619 + -1614 -1609 -1604 -1599 -1594 -1589 -1584 -1579 + -1573 -1568 -1563 -1558 -1553 -1548 -1543 -1538 + -1532 -1527 -1522 -1517 -1512 -1507 -1502 -1497 + -1492 -1486 -1482 -1477 -1471 -1466 -1461 -1456 + -1451 -1446 -1441 -1436 -1431 -1425 -1420 -1415 + -1410 -1405 -1400 -1395 -1390 -1385 -1380 -1375 + -1370 -1364 -1359 -1354 -1349 -1344 -1339 -1334 + -1329 -1324 -1319 -1314 -1309 -1303 -1298 -1294 + -1288 -1283 -1278 -1273 -1268 -1263 -1258 -1253 + -1248 -1243 -1237 -1232 -1228 -1222 -1217 -1212 + -1207 -1202 -1197 -1192 -1187 -1182 -1177 -1171 + -1167 -1162 -1156 -1151 -1146 -1141 -1136 -1131 + -1126 -1121 -1116 -1111 -1106 -1101 -1096 -1091 + -1085 -1081 -1076 -1070 -1065 -1060 -1055 -1050 + -1045 -1040 -1035 -1030 -1025 -1020 -1015 -1010 + -1005 -1000 -995 -990 -985 -979 -974 -970 + -964 -959 -954 -949 -944 -939 -934 -929 + -924 -919 -914 -909 -904 -899 -894 -889 + -884 -879 -874 -868 -863 -859 -853 -848 + -843 -838 -833 -828 -823 -818 -813 -808 + -803 -798 -793 -788 -783 -778 -773 -768 + -763 -758 -752 -748 -743 -738 -732 -727 + -723 -717 -712 -707 -702 -697 -692 -687 + -682 -677 -672 -667 -662 -657 -652 -647 + -642 -637 -632 -627 -622 -617 -612 -607 + -602 -597 -591 -587 -582 -577 -571 -566 + -562 -557 -551 -546 -541 -537 -531 -526 + -521 -516 -511 -506 -501 -496 -491 -486 + -481 -476 -471 -466 -461 -456 -451 -446 + -441 -436 -431 -426 -421 -416 -411 -406 + -401 -396 -391 -386 -381 -376 -371 -366 + -360 -356 -351 -346 -340 -335 -331 -326 + -320 -315 -310 -306 -300 -295 -290 -285 + -281 -275 -270 -265 -261 -255 -250 -245 + -240 -235 -230 -225 -220 -215 -210 -205 + -200 -195 -190 -185 -180 -175 -170 -165 + -160 -155 -150 -145 -140 -135 -130 -125 + -120 -115 -110 -105 -100 -95 -90 -85 + -80 -75 -70 -65 -60 -55 -50 -45 + -40 -35 -29 -25 -20 -15 -9 -5 + 0 5 11 16 20 25 30 36 + 41 45 50 56 61 66 70 76 + 81 86 91 96 101 106 111 116 + 121 126 131 136 141 146 151 156 + 161 166 171 176 181 186 191 196 + 201 206 211 216 221 226 231 236 + 241 246 251 256 261 266 271 276 + 281 286 291 296 301 306 311 316 + 322 326 331 336 342 347 351 356 + 362 367 372 376 382 387 392 396 + 402 407 412 417 422 427 432 437 + 442 447 452 457 462 467 472 477 + 482 487 492 497 502 507 512 517 + 522 527 532 537 542 547 552 557 + 562 567 572 578 582 587 593 598 + 603 607 613 618 623 628 633 638 + 643 648 653 658 663 668 673 678 + 683 688 693 698 703 708 713 718 + 723 728 733 739 743 748 754 759 + 763 768 774 779 784 789 794 799 + 804 809 814 819 824 829 834 839 + 844 849 854 859 864 869 874 879 + 884 890 895 899 905 910 915 920 + 925 930 935 940 945 950 955 960 + 965 970 975 980 985 990 995 1001 + 1006 1010 1016 1021 1026 1031 1036 1041 + 1046 1051 1056 1061 1066 1071 1076 1081 + 1086 1092 1096 1102 1107 1112 1117 1122 + 1127 1132 1137 1142 1147 1152 1157 1162 + 1167 1173 1178 1183 1188 1193 1198 1203 + 1208 1213 1218 1223 1228 1233 1238 1244 + 1248 1254 1259 1264 1269 1274 1279 1284 + 1289 1294 1299 1304 1309 1314 1320 1325 + 1330 1335 1340 1345 1350 1355 1360 1365 + 1371 1375 1381 1386 1391 1396 1401 1406 + 1411 1416 1421 1426 1432 1436 1442 1447 + 1452 1457 1462 1467 1472 1477 1482 1488 + 1493 1497 1503 1508 1513 1518 1523 1528 + 1534 1538 1543 1549 1554 1559 1564 1569 + 1574 1579 1584 1590 1595 1600 1605 1610 + 1615 1620 1625 1630 1636 1640 1646 1651 + 1656 1661 1666 1671 1676 1681 1687 1692 + 1697 1702 1707 1712 1717 1722 1728 1733 + 1738 1743 1748 1753 1758 1764 1769 1774 + 1779 1784 1789 1794 1799 1805 1810 1815 + 1820 1825 1831 1835 1841 1846 1851 1856 + 1861 1866 1871 1877 1882 1887 1892 1897 + 1902 1908 1913 1918 1923 1928 1933 1939 + 1944 1949 1954 1959 1964 1969 1975 1980 + 1985 1990 1995 2000 2005 2011 2016 2021 + 2026 2031 2037 2042 2047 2052 2057 2062 + 2068 2073 2078 2083 2088 2093 2099 2104 + 2109 2114 2119 2125 2130 2135 2140 2145 + 2150 2156 2161 2166 2171 2177 2182 2187 + 2192 2197 2202 2208 2213 2218 2223 2229 + 2234 2239 2244 2249 2254 2260 2265 2270 + 2275 2281 2286 2291 2296 2302 2306 2312 + 2317 2322 2327 2333 2338 2343 2348 2354 + 2359 2364 2369 2374 2380 2385 2390 2395 + 2401 2406 2411 2416 2422 2427 2432 2437 + 2442 2448 2453 2458 2463 2469 2474 2479 + 2485 2490 2495 2500 2506 2511 2516 2521 + 2526 2532 2537 2542 2548 2553 2558 2563 + 2569 2574 2579 2585 2589 2595 2600 2605 + 2611 2616 2621 2627 2632 2637 2642 2648 + 2653 2658 2664 2669 2674 2680 2685 2690 + 2695 2700 2706 2711 2716 2722 2727 2732 + 2738 2743 2748 2754 2759 2764 2769 2775 + 2780 2785 2791 2796 2801 2807 2812 2817 + 2823 2828 2833 2839 2844 2849 2855 2860 + 2865 2870 2876 2881 2886 2892 2897 2902 + 2908 2913 2918 2924 2929 2935 2940 2945 + 2951 2956 2961 2967 2972 2977 2983 2988 + 2993 2999 3004 3010 3015 3020 3026 3031 + 3036 3042 3047 3052 3058 3063 3069 3074 + 3079 3085 3090 3095 3101 3106 3112 3117 + 3122 3128 3133 3139 3144 3149 3155 3160 + 3166 3171 3176 3182 3187 3193 3198 3203 + 3209 3214 3220 3225 3231 3236 3242 3247 + 3252 3258 3263 3269 3274 3279 3285 3290 + 3296 3301 3307 3312 3317 3323 3328 3334 + 3339 3345 3350 3355 3361 3367 3372 3378 + 3383 3388 3394 3399 3405 3410 3416 3421 + 3427 3432 3437 3443 3448 3454 3459 3465 + 3471 3476 3481 3487 3492 3498 3503 3509 + 3514 3520 3525 3531 3536 3542 3548 3553 + 3558 3564 3569 3575 3580 3586 3591 3597 + 3602 3608 3613 3619 3625 3630 3636 3641 + 3647 3652 3658 3663 3669 3675 3680 3686 + 3691 3697 3702 3708 3713 3719 3724 3730 + 3736 3741 3747 3752 3758 3763 3769 3774 + 3780 3786 3791 3797 3802 3808 3813 3819 + 3825 3830 3836 3842 3847 3853 3858 3864 + 3869 3875 3881 3886 3892 3898 3903 3909 + 3915 3920 3926 3931 3937 3942 3948 3954 + 3960 3965 3971 3976 3982 3987 3993 3999 + 4005 4010 4016 4021 4027 4033 4039 4044 + 4050 4055 4061 4067 4073 4078 4084 4089 + 4095 4101 4107 4112 4118 4123 4129 4135 + 4141 4146 4152 4158 4164 4169 4175 4181 + 4187 4192 4198 4203 4209 4215 4221 4226 + 4232 4238 4243 4249 4255 4261 4266 4272 + 4278 4284 4289 4295 4301 4307 4313 4318 + 4324 4330 4336 4341 4347 4353 4359 4364 + 4370 4376 4382 4388 4393 4399 4405 4411 + 4417 4422 4428 4434 4440 4445 4452 4457 + 4463 4469 4474 4481 4486 4492 4498 4504 + 4510 4515 4521 4527 4533 4539 4545 4551 + 4556 4562 4568 4574 4580 4585 4592 4597 + 4603 4609 4615 4621 4627 4633 4638 4644 + 4650 4656 4662 4668 4674 4680 4686 4692 + 4697 4703 4709 4715 4721 4727 4733 4739 + 4745 4751 4757 4762 4769 4774 4780 4786 + 4792 4798 4804 4810 4816 4822 4828 4834 + 4840 4846 4852 4858 4864 4870 4876 4882 + 4888 4894 4900 4906 4912 4918 4924 4930 + 4936 4942 4948 4954 4960 4966 4972 4978 + 4984 4990 4996 5002 5008 5014 5020 5026 + 5032 5038 5045 5050 5057 5063 5069 5075 + 5081 5087 5093 5099 5105 5111 5118 5123 + 5129 5136 5142 5148 5154 5160 5166 5172 + 5179 5185 5191 5197 5203 5209 5215 5221 + 5227 5233 5240 5246 5252 5258 5265 5271 + 5277 5283 5289 5295 5301 5308 5314 5320 + 5326 5333 5339 5345 5351 5357 5363 5369 + 5376 5382 5388 5394 5401 5407 5413 5419 + 5426 5432 5438 5444 5451 5457 5463 5469 + 5476 5482 5488 5494 5501 5507 5513 5520 + 5526 5532 5539 5545 5551 5557 5564 5570 + 5576 5583 5589 5596 5602 5608 5614 5621 + 5627 5634 5640 5646 5652 5659 5665 5672 + 5678 5684 5691 5697 5704 5710 5716 5723 + 5729 5736 5742 5748 5755 5761 5768 5774 + 5780 5787 5793 5800 5806 5813 5819 5826 + 5832 5838 5845 5852 5858 5864 5871 5877 + 5884 5890 5897 5903 5910 5916 5923 5929 + 5936 5942 5949 5956 5962 5968 5975 5981 + 5988 5994 6001 6008 6014 6021 6027 6034 + 6041 6047 6054 6060 6067 6074 6080 6087 + 6093 6100 6107 6113 6120 6126 6133 6140 + 6146 6153 6160 6167 6173 6180 6186 6193 + 6200 6206 6213 6220 6226 6233 6240 6246 + 6253 6260 6266 6273 6280 6287 6294 6300 + 6307 6314 6321 6327 6334 6341 6348 6354 + 6361 6368 6375 6382 6388 6395 6402 6409 + 6416 6422 6429 6436 6443 6450 6457 6463 + 6470 6477 6484 6491 6497 6504 6511 6518 + 6525 6532 6539 6546 6553 6559 6566 6573 + 6580 6587 6594 6601 6608 6615 6622 6629 + 6636 6643 6650 6657 6664 6671 6678 6685 + 6692 6699 6706 6713 6719 6727 6734 6741 + 6748 6755 6762 6769 6776 6783 6790 6797 + 6804 6811 6818 6826 6833 6840 6847 6854 + 6861 6868 6875 6883 6889 6897 6904 6911 + 6918 6925 6932 6939 6947 6954 6961 6969 + 6975 6983 6990 6997 7005 7012 7019 7026 + 7033 7041 7048 7055 7062 7070 7077 7084 + 7091 7099 7106 7114 7121 7128 7135 7143 + 7150 7157 7165 7172 7179 7187 7194 7202 + 7209 7216 7224 7231 7238 7246 7253 7261 + 7268 7276 7283 7290 7298 7306 7313 7320 + 7328 7336 7343 7350 7358 7365 7373 7381 + 7388 7395 7403 7410 7418 7426 7433 7441 + 7448 7456 7463 7471 7479 7486 7494 7501 + 7509 7517 7524 7532 7540 7547 7555 7563 + 7571 7578 7586 7594 7601 7609 7617 7624 + 7632 7640 7648 7655 7663 7671 7679 7687 + 7694 7702 7710 7718 7725 7733 7741 7749 + 7757 7765 7773 7780 7788 7796 7804 7812 + 7820 7828 7836 7843 7852 7859 7868 7875 + 7883 7891 7899 7907 7915 7923 7931 7939 + 7947 7955 7963 7971 7979 7988 7995 8004 + 8012 8020 8028 8036 8044 8052 8061 8069 + 8076 8085 8093 8101 8109 8117 8126 8134 + 8142 8150 8158 8167 8175 8183 8192 8200 + 8208 8217 8225 8233 8241 8250 8258 8266 + 8275 8283 8292 8300 8308 8317 8325 8333 + 8342 8350 8359 8367 8376 8384 8392 8401 + 8409 8418 8426 8435 8443 8452 8461 8469 + 8477 8486 8495 8503 8512 8520 8529 8538 + 8546 8555 8564 8573 8581 8590 8598 8607 + 8616 8625 8633 8642 8651 8659 8668 8677 + 8686 8695 8704 8712 8721 8730 8739 8748 + 8756 8765 8774 8783 8792 8801 8810 8819 + 8828 8837 8846 8855 8864 8873 8882 8891 + 8900 8909 8918 8927 8936 8945 8954 8964 + 8973 8982 8991 9000 9009 9019 9028 9037 + 9046 9055 9064 9074 9083 9092 9102 9111 + 9120 9130 9139 9148 9157 9167 9176 9186 + 9195 9205 9214 9223 9233 9242 9252 9261 + 9271 9280 9290 9300 9309 9318 9328 9338 + 9347 9357 9367 9376 9386 9395 9405 9415 + 9424 9434 9444 9454 9464 9473 9483 9493 + 9503 9513 9522 9532 9542 9552 9562 9572 + 9582 9592 9602 9612 9622 9632 9642 9652 + 9662 9672 9682 9692 9702 9712 9722 9733 + 9743 9753 9763 9773 9783 9794 9804 9814 + 9825 9835 9845 9855 9866 9876 9887 9897 + 9907 9918 9928 9939 9949 9960 9970 9981 + 9991 10002 10012 10023 10034 10044 10055 10066 + 10076 10087 10097 10108 10119 10130 10140 10152 + 10162 10173 10184 10195 10206 10217 10227 10238 + 10249 10260 10271 10282 10293 10304 10315 10326 + 10337 10349 10360 10371 10382 10394 10405 10416 + 10427 10438 10450 10461 10472 10484 10495 10507 + 10518 10530 10541 10553 10564 10575 10587 10598 + 10610 10622 10633 10645 10657 10668 10680 10692 + 10704 10715 10727 10739 10751 10763 10775 10786 + 10798 10811 10822 10834 10847 10858 10870 10883 + 10895 10907 10919 10931 10944 10956 10968 10981 + 10993 11005 11017 11030 11042 11055 11067 11080 + 11092 11105 11117 11130 11142 11155 11168 11180 + 11193 11206 11219 11232 11245 11257 11270 11283 + 11296 11309 11322 11335 11348 11361 11375 11388 + 11401 11414 11427 11441 11454 11467 11481 11494 + 11508 11521 11534 11548 11561 11575 11589 11602 + 11616 11630 11644 11657 11671 11685 11699 11713 + 11727 11741 11755 11769 11783 11797 11811 11826 + 11839 11854 11868 11882 11897 11911 11926 11940 + 11955 11969 11984 11998 12013 12028 12043 12057 + 12072 12087 12102 12117 12132 12147 12162 12177 + 12193 12208 12223 12238 12254 12269 12284 12299 + 12315 12331 12346 12362 12378 12393 12409 12425 + 12441 12457 12473 12489 12505 12521 12537 12553 + 12569 12586 12602 12619 12635 12651 12668 12684 + 12701 12718 12734 12751 12768 12785 12802 12819 + 12836 12853 12870 12888 12905 12922 12940 12957 + 12975 12993 13010 13028 13046 13064 13081 13099 + 13117 13135 13154 13172 13190 13209 13227 13246 + 13264 13283 13301 13320 13339 13358 13377 13396 + 13415 13434 13454 13473 13492 13512 13532 13551 + 13571 13591 13611 13631 13651 13671 13691 13711 + 13732 13752 13773 13793 13814 13835 13856 13877 + 13898 13919 13940 13962 13983 14005 14026 14048 + 14070 14092 14114 14136 14159 14181 14203 14226 + 14249 14272 14294 14318 14341 14364 14387 14411 + 14434 14458 14482 14506 14530 14554 14578 14603 + 14628 14653 14677 14703 14728 14753 14778 14804 + 14830 14855 14882 14908 14934 14961 14987 15014 + 15041 15068 15095 15123 15151 15179 15206 15235 + 15263 15291 15320 15349 15378 15408 15437 15466 + 15496 15527 15557 15587 15618 15649 15680 15712 + 15743 15775 15808 15840 15872 15906 15939 15972 + 16006 16040 16074 16108 16143 16178 16214 16249 + 16285 16322 16358 16395 16433 16470 16508 16547 + 16586 16624 16664 16704 16744 16785 16826 16867 + 16910 16952 16995 17038 17082 17126 17171 17217 + 17263 17309 17356 17403 17452 17501 17550 17600 + 17651 17702 17754 17807 17861 17915 17970 18026 + 18083 18141 18200 18259 18320 18382 18444 18508 + 18573 18639 18706 18775 18845 18917 18989 19064 + 19140 19217 19297 19378 19461 19547 19634 19724 + 19816 19911 20009 20109 20213 20319 20430 20544 + 20663 20786 20914 21047 21186 21331 21484 21644 + 21813 21991 22181 22384 22601 22836 23091 23370 + 23679 24027 24424 24888 25450 26164 27159 28858 diff --git a/internal/gotc/testdata/tc-lib/pareto.dist b/internal/gotc/testdata/tc-lib/pareto.dist new file mode 100644 index 000000000..295e6fbc9 --- /dev/null +++ b/internal/gotc/testdata/tc-lib/pareto.dist @@ -0,0 +1,513 @@ +# This is the distribution table for the pareto distribution. + -5461 -5460 -5460 -5459 -5458 -5457 -5456 -5455 + -5454 -5453 -5452 -5452 -5451 -5450 -5449 -5448 + -5447 -5446 -5445 -5444 -5443 -5443 -5442 -5441 + -5440 -5439 -5438 -5437 -5436 -5435 -5435 -5434 + -5433 -5432 -5431 -5430 -5429 -5428 -5427 -5426 + -5426 -5425 -5424 -5423 -5422 -5421 -5420 -5419 + -5418 -5417 -5417 -5416 -5415 -5414 -5413 -5412 + -5411 -5410 -5409 -5408 -5407 -5407 -5406 -5405 + -5404 -5403 -5402 -5401 -5400 -5399 -5398 -5397 + -5397 -5396 -5395 -5394 -5393 -5392 -5391 -5390 + -5389 -5388 -5387 -5387 -5386 -5385 -5384 -5383 + -5382 -5381 -5380 -5379 -5378 -5377 -5376 -5376 + -5375 -5374 -5373 -5372 -5371 -5370 -5369 -5368 + -5367 -5366 -5365 -5365 -5364 -5363 -5362 -5361 + -5360 -5359 -5358 -5357 -5356 -5355 -5354 -5353 + -5353 -5352 -5351 -5350 -5349 -5348 -5347 -5346 + -5345 -5344 -5343 -5342 -5341 -5340 -5340 -5339 + -5338 -5337 -5336 -5335 -5334 -5333 -5332 -5331 + -5330 -5329 -5328 -5327 -5327 -5326 -5325 -5324 + -5323 -5322 -5321 -5320 -5319 -5318 -5317 -5316 + -5315 -5314 -5313 -5312 -5312 -5311 -5310 -5309 + -5308 -5307 -5306 -5305 -5304 -5303 -5302 -5301 + -5300 -5299 -5298 -5297 -5296 -5296 -5295 -5294 + -5293 -5292 -5291 -5290 -5289 -5288 -5287 -5286 + -5285 -5284 -5283 -5282 -5281 -5280 -5279 -5278 + -5278 -5277 -5276 -5275 -5274 -5273 -5272 -5271 + -5270 -5269 -5268 -5267 -5266 -5265 -5264 -5263 + -5262 -5261 -5260 -5259 -5258 -5258 -5257 -5256 + -5255 -5254 -5253 -5252 -5251 -5250 -5249 -5248 + -5247 -5246 -5245 -5244 -5243 -5242 -5241 -5240 + -5239 -5238 -5237 -5236 -5235 -5234 -5233 -5233 + -5232 -5231 -5230 -5229 -5228 -5227 -5226 -5225 + -5224 -5223 -5222 -5221 -5220 -5219 -5218 -5217 + -5216 -5215 -5214 -5213 -5212 -5211 -5210 -5209 + -5208 -5207 -5206 -5205 -5204 -5203 -5202 -5201 + -5200 -5199 -5199 -5198 -5197 -5196 -5195 -5194 + -5193 -5192 -5191 -5190 -5189 -5188 -5187 -5186 + -5185 -5184 -5183 -5182 -5181 -5180 -5179 -5178 + -5177 -5176 -5175 -5174 -5173 -5172 -5171 -5170 + -5169 -5168 -5167 -5166 -5165 -5164 -5163 -5162 + -5161 -5160 -5159 -5158 -5157 -5156 -5155 -5154 + -5153 -5152 -5151 -5150 -5149 -5148 -5147 -5146 + -5145 -5144 -5143 -5142 -5141 -5140 -5139 -5138 + -5137 -5136 -5135 -5134 -5133 -5132 -5131 -5130 + -5129 -5128 -5127 -5126 -5125 -5124 -5123 -5122 + -5121 -5120 -5119 -5118 -5117 -5116 -5115 -5114 + -5113 -5112 -5111 -5110 -5109 -5108 -5107 -5106 + -5105 -5104 -5103 -5102 -5101 -5100 -5099 -5098 + -5097 -5096 -5095 -5094 -5093 -5092 -5091 -5090 + -5089 -5088 -5087 -5086 -5085 -5084 -5083 -5082 + -5081 -5080 -5079 -5078 -5077 -5076 -5075 -5074 + -5073 -5072 -5071 -5069 -5068 -5067 -5066 -5065 + -5064 -5063 -5062 -5061 -5060 -5059 -5058 -5057 + -5056 -5055 -5054 -5053 -5052 -5051 -5050 -5049 + -5048 -5047 -5046 -5045 -5044 -5043 -5042 -5041 + -5040 -5039 -5038 -5037 -5036 -5034 -5033 -5032 + -5031 -5030 -5029 -5028 -5027 -5026 -5025 -5024 + -5023 -5022 -5021 -5020 -5019 -5018 -5017 -5016 + -5015 -5014 -5013 -5012 -5011 -5009 -5008 -5007 + -5006 -5005 -5004 -5003 -5002 -5001 -5000 -4999 + -4998 -4997 -4996 -4995 -4994 -4993 -4992 -4991 + -4990 -4989 -4987 -4986 -4985 -4984 -4983 -4982 + -4981 -4980 -4979 -4978 -4977 -4976 -4975 -4974 + -4973 -4972 -4971 -4969 -4968 -4967 -4966 -4965 + -4964 -4963 -4962 -4961 -4960 -4959 -4958 -4957 + -4956 -4955 -4954 -4952 -4951 -4950 -4949 -4948 + -4947 -4946 -4945 -4944 -4943 -4942 -4941 -4940 + -4939 -4938 -4936 -4935 -4934 -4933 -4932 -4931 + -4930 -4929 -4928 -4927 -4926 -4925 -4924 -4922 + -4921 -4920 -4919 -4918 -4917 -4916 -4915 -4914 + -4913 -4912 -4911 -4909 -4908 -4907 -4906 -4905 + -4904 -4903 -4902 -4901 -4900 -4899 -4898 -4896 + -4895 -4894 -4893 -4892 -4891 -4890 -4889 -4888 + -4887 -4886 -4884 -4883 -4882 -4881 -4880 -4879 + -4878 -4877 -4876 -4875 -4874 -4872 -4871 -4870 + -4869 -4868 -4867 -4866 -4865 -4864 -4863 -4861 + -4860 -4859 -4858 -4857 -4856 -4855 -4854 -4853 + -4852 -4850 -4849 -4848 -4847 -4846 -4845 -4844 + -4843 -4842 -4840 -4839 -4838 -4837 -4836 -4835 + -4834 -4833 -4832 -4830 -4829 -4828 -4827 -4826 + -4825 -4824 -4823 -4822 -4820 -4819 -4818 -4817 + -4816 -4815 -4814 -4813 -4811 -4810 -4809 -4808 + -4807 -4806 -4805 -4804 -4803 -4801 -4800 -4799 + -4798 -4797 -4796 -4795 -4794 -4792 -4791 -4790 + -4789 -4788 -4787 -4786 -4784 -4783 -4782 -4781 + -4780 -4779 -4778 -4777 -4775 -4774 -4773 -4772 + -4771 -4770 -4769 -4767 -4766 -4765 -4764 -4763 + -4762 -4761 -4760 -4758 -4757 -4756 -4755 -4754 + -4753 -4752 -4750 -4749 -4748 -4747 -4746 -4745 + -4743 -4742 -4741 -4740 -4739 -4738 -4737 -4735 + -4734 -4733 -4732 -4731 -4730 -4729 -4727 -4726 + -4725 -4724 -4723 -4722 -4720 -4719 -4718 -4717 + -4716 -4715 -4714 -4712 -4711 -4710 -4709 -4708 + -4707 -4705 -4704 -4703 -4702 -4701 -4700 -4698 + -4697 -4696 -4695 -4694 -4693 -4691 -4690 -4689 + -4688 -4687 -4686 -4684 -4683 -4682 -4681 -4680 + -4679 -4677 -4676 -4675 -4674 -4673 -4672 -4670 + -4669 -4668 -4667 -4666 -4664 -4663 -4662 -4661 + -4660 -4659 -4657 -4656 -4655 -4654 -4653 -4651 + -4650 -4649 -4648 -4647 -4646 -4644 -4643 -4642 + -4641 -4640 -4638 -4637 -4636 -4635 -4634 -4632 + -4631 -4630 -4629 -4628 -4627 -4625 -4624 -4623 + -4622 -4621 -4619 -4618 -4617 -4616 -4615 -4613 + -4612 -4611 -4610 -4609 -4607 -4606 -4605 -4604 + -4603 -4601 -4600 -4599 -4598 -4597 -4595 -4594 + -4593 -4592 -4590 -4589 -4588 -4587 -4586 -4584 + -4583 -4582 -4581 -4580 -4578 -4577 -4576 -4575 + -4574 -4572 -4571 -4570 -4569 -4567 -4566 -4565 + -4564 -4563 -4561 -4560 -4559 -4558 -4556 -4555 + -4554 -4553 -4552 -4550 -4549 -4548 -4547 -4545 + -4544 -4543 -4542 -4541 -4539 -4538 -4537 -4536 + -4534 -4533 -4532 -4531 -4529 -4528 -4527 -4526 + -4525 -4523 -4522 -4521 -4520 -4518 -4517 -4516 + -4515 -4513 -4512 -4511 -4510 -4508 -4507 -4506 + -4505 -4503 -4502 -4501 -4500 -4498 -4497 -4496 + -4495 -4493 -4492 -4491 -4490 -4488 -4487 -4486 + -4485 -4483 -4482 -4481 -4480 -4478 -4477 -4476 + -4475 -4473 -4472 -4471 -4470 -4468 -4467 -4466 + -4465 -4463 -4462 -4461 -4460 -4458 -4457 -4456 + -4455 -4453 -4452 -4451 -4449 -4448 -4447 -4446 + -4444 -4443 -4442 -4441 -4439 -4438 -4437 -4435 + -4434 -4433 -4432 -4430 -4429 -4428 -4427 -4425 + -4424 -4423 -4421 -4420 -4419 -4418 -4416 -4415 + -4414 -4412 -4411 -4410 -4409 -4407 -4406 -4405 + -4404 -4402 -4401 -4400 -4398 -4397 -4396 -4394 + -4393 -4392 -4391 -4389 -4388 -4387 -4385 -4384 + -4383 -4382 -4380 -4379 -4378 -4376 -4375 -4374 + -4372 -4371 -4370 -4369 -4367 -4366 -4365 -4363 + -4362 -4361 -4359 -4358 -4357 -4356 -4354 -4353 + -4352 -4350 -4349 -4348 -4346 -4345 -4344 -4342 + -4341 -4340 -4338 -4337 -4336 -4335 -4333 -4332 + -4331 -4329 -4328 -4327 -4325 -4324 -4323 -4321 + -4320 -4319 -4317 -4316 -4315 -4313 -4312 -4311 + -4309 -4308 -4307 -4305 -4304 -4303 -4301 -4300 + -4299 -4297 -4296 -4295 -4293 -4292 -4291 -4289 + -4288 -4287 -4285 -4284 -4283 -4281 -4280 -4279 + -4277 -4276 -4275 -4273 -4272 -4271 -4269 -4268 + -4267 -4265 -4264 -4263 -4261 -4260 -4259 -4257 + -4256 -4254 -4253 -4252 -4250 -4249 -4248 -4246 + -4245 -4244 -4242 -4241 -4240 -4238 -4237 -4236 + -4234 -4233 -4231 -4230 -4229 -4227 -4226 -4225 + -4223 -4222 -4221 -4219 -4218 -4216 -4215 -4214 + -4212 -4211 -4210 -4208 -4207 -4205 -4204 -4203 + -4201 -4200 -4199 -4197 -4196 -4194 -4193 -4192 + -4190 -4189 -4188 -4186 -4185 -4183 -4182 -4181 + -4179 -4178 -4176 -4175 -4174 -4172 -4171 -4170 + -4168 -4167 -4165 -4164 -4163 -4161 -4160 -4158 + -4157 -4156 -4154 -4153 -4151 -4150 -4149 -4147 + -4146 -4144 -4143 -4142 -4140 -4139 -4137 -4136 + -4135 -4133 -4132 -4130 -4129 -4128 -4126 -4125 + -4123 -4122 -4120 -4119 -4118 -4116 -4115 -4113 + -4112 -4111 -4109 -4108 -4106 -4105 -4103 -4102 + -4101 -4099 -4098 -4096 -4095 -4094 -4092 -4091 + -4089 -4088 -4086 -4085 -4084 -4082 -4081 -4079 + -4078 -4076 -4075 -4073 -4072 -4071 -4069 -4068 + -4066 -4065 -4063 -4062 -4061 -4059 -4058 -4056 + -4055 -4053 -4052 -4050 -4049 -4048 -4046 -4045 + -4043 -4042 -4040 -4039 -4037 -4036 -4035 -4033 + -4032 -4030 -4029 -4027 -4026 -4024 -4023 -4021 + -4020 -4018 -4017 -4016 -4014 -4013 -4011 -4010 + -4008 -4007 -4005 -4004 -4002 -4001 -3999 -3998 + -3997 -3995 -3994 -3992 -3991 -3989 -3988 -3986 + -3985 -3983 -3982 -3980 -3979 -3977 -3976 -3974 + -3973 -3971 -3970 -3968 -3967 -3965 -3964 -3963 + -3961 -3960 -3958 -3957 -3955 -3954 -3952 -3951 + -3949 -3948 -3946 -3945 -3943 -3942 -3940 -3939 + -3937 -3936 -3934 -3933 -3931 -3930 -3928 -3927 + -3925 -3924 -3922 -3921 -3919 -3918 -3916 -3915 + -3913 -3912 -3910 -3909 -3907 -3905 -3904 -3902 + -3901 -3899 -3898 -3896 -3895 -3893 -3892 -3890 + -3889 -3887 -3886 -3884 -3883 -3881 -3880 -3878 + -3877 -3875 -3874 -3872 -3870 -3869 -3867 -3866 + -3864 -3863 -3861 -3860 -3858 -3857 -3855 -3854 + -3852 -3851 -3849 -3847 -3846 -3844 -3843 -3841 + -3840 -3838 -3837 -3835 -3834 -3832 -3830 -3829 + -3827 -3826 -3824 -3823 -3821 -3820 -3818 -3816 + -3815 -3813 -3812 -3810 -3809 -3807 -3805 -3804 + -3802 -3801 -3799 -3798 -3796 -3795 -3793 -3791 + -3790 -3788 -3787 -3785 -3784 -3782 -3780 -3779 + -3777 -3776 -3774 -3772 -3771 -3769 -3768 -3766 + -3765 -3763 -3761 -3760 -3758 -3757 -3755 -3753 + -3752 -3750 -3749 -3747 -3746 -3744 -3742 -3741 + -3739 -3738 -3736 -3734 -3733 -3731 -3730 -3728 + -3726 -3725 -3723 -3722 -3720 -3718 -3717 -3715 + -3713 -3712 -3710 -3709 -3707 -3705 -3704 -3702 + -3701 -3699 -3697 -3696 -3694 -3692 -3691 -3689 + -3688 -3686 -3684 -3683 -3681 -3680 -3678 -3676 + -3675 -3673 -3671 -3670 -3668 -3666 -3665 -3663 + -3662 -3660 -3658 -3657 -3655 -3653 -3652 -3650 + -3648 -3647 -3645 -3644 -3642 -3640 -3639 -3637 + -3635 -3634 -3632 -3630 -3629 -3627 -3625 -3624 + -3622 -3620 -3619 -3617 -3615 -3614 -3612 -3610 + -3609 -3607 -3605 -3604 -3602 -3600 -3599 -3597 + -3595 -3594 -3592 -3590 -3589 -3587 -3585 -3584 + -3582 -3580 -3579 -3577 -3575 -3574 -3572 -3570 + -3569 -3567 -3565 -3564 -3562 -3560 -3558 -3557 + -3555 -3553 -3552 -3550 -3548 -3547 -3545 -3543 + -3542 -3540 -3538 -3536 -3535 -3533 -3531 -3530 + -3528 -3526 -3524 -3523 -3521 -3519 -3518 -3516 + -3514 -3513 -3511 -3509 -3507 -3506 -3504 -3502 + -3501 -3499 -3497 -3495 -3494 -3492 -3490 -3488 + -3487 -3485 -3483 -3482 -3480 -3478 -3476 -3475 + -3473 -3471 -3469 -3468 -3466 -3464 -3462 -3461 + -3459 -3457 -3455 -3454 -3452 -3450 -3448 -3447 + -3445 -3443 -3441 -3440 -3438 -3436 -3434 -3433 + -3431 -3429 -3427 -3426 -3424 -3422 -3420 -3419 + -3417 -3415 -3413 -3412 -3410 -3408 -3406 -3404 + -3403 -3401 -3399 -3397 -3396 -3394 -3392 -3390 + -3388 -3387 -3385 -3383 -3381 -3380 -3378 -3376 + -3374 -3372 -3371 -3369 -3367 -3365 -3363 -3362 + -3360 -3358 -3356 -3354 -3353 -3351 -3349 -3347 + -3345 -3344 -3342 -3340 -3338 -3336 -3335 -3333 + -3331 -3329 -3327 -3326 -3324 -3322 -3320 -3318 + -3316 -3315 -3313 -3311 -3309 -3307 -3305 -3304 + -3302 -3300 -3298 -3296 -3295 -3293 -3291 -3289 + -3287 -3285 -3283 -3282 -3280 -3278 -3276 -3274 + -3272 -3271 -3269 -3267 -3265 -3263 -3261 -3259 + -3258 -3256 -3254 -3252 -3250 -3248 -3246 -3245 + -3243 -3241 -3239 -3237 -3235 -3233 -3232 -3230 + -3228 -3226 -3224 -3222 -3220 -3218 -3217 -3215 + -3213 -3211 -3209 -3207 -3205 -3203 -3202 -3200 + -3198 -3196 -3194 -3192 -3190 -3188 -3186 -3185 + -3183 -3181 -3179 -3177 -3175 -3173 -3171 -3169 + -3167 -3166 -3164 -3162 -3160 -3158 -3156 -3154 + -3152 -3150 -3148 -3146 -3144 -3143 -3141 -3139 + -3137 -3135 -3133 -3131 -3129 -3127 -3125 -3123 + -3121 -3119 -3117 -3116 -3114 -3112 -3110 -3108 + -3106 -3104 -3102 -3100 -3098 -3096 -3094 -3092 + -3090 -3088 -3086 -3084 -3082 -3081 -3079 -3077 + -3075 -3073 -3071 -3069 -3067 -3065 -3063 -3061 + -3059 -3057 -3055 -3053 -3051 -3049 -3047 -3045 + -3043 -3041 -3039 -3037 -3035 -3033 -3031 -3029 + -3027 -3025 -3023 -3021 -3019 -3017 -3015 -3013 + -3011 -3009 -3007 -3005 -3003 -3001 -2999 -2997 + -2995 -2993 -2991 -2989 -2987 -2985 -2983 -2981 + -2979 -2977 -2975 -2973 -2971 -2969 -2967 -2965 + -2963 -2961 -2959 -2957 -2955 -2953 -2951 -2949 + -2947 -2945 -2943 -2941 -2939 -2937 -2935 -2933 + -2931 -2928 -2926 -2924 -2922 -2920 -2918 -2916 + -2914 -2912 -2910 -2908 -2906 -2904 -2902 -2900 + -2898 -2896 -2893 -2891 -2889 -2887 -2885 -2883 + -2881 -2879 -2877 -2875 -2873 -2871 -2869 -2866 + -2864 -2862 -2860 -2858 -2856 -2854 -2852 -2850 + -2848 -2846 -2843 -2841 -2839 -2837 -2835 -2833 + -2831 -2829 -2827 -2825 -2822 -2820 -2818 -2816 + -2814 -2812 -2810 -2808 -2805 -2803 -2801 -2799 + -2797 -2795 -2793 -2791 -2788 -2786 -2784 -2782 + -2780 -2778 -2776 -2773 -2771 -2769 -2767 -2765 + -2763 -2761 -2758 -2756 -2754 -2752 -2750 -2748 + -2745 -2743 -2741 -2739 -2737 -2735 -2733 -2730 + -2728 -2726 -2724 -2722 -2719 -2717 -2715 -2713 + -2711 -2709 -2706 -2704 -2702 -2700 -2698 -2695 + -2693 -2691 -2689 -2687 -2684 -2682 -2680 -2678 + -2676 -2673 -2671 -2669 -2667 -2665 -2662 -2660 + -2658 -2656 -2654 -2651 -2649 -2647 -2645 -2642 + -2640 -2638 -2636 -2633 -2631 -2629 -2627 -2625 + -2622 -2620 -2618 -2616 -2613 -2611 -2609 -2607 + -2604 -2602 -2600 -2598 -2595 -2593 -2591 -2589 + -2586 -2584 -2582 -2579 -2577 -2575 -2573 -2570 + -2568 -2566 -2564 -2561 -2559 -2557 -2554 -2552 + -2550 -2548 -2545 -2543 -2541 -2538 -2536 -2534 + -2532 -2529 -2527 -2525 -2522 -2520 -2518 -2515 + -2513 -2511 -2508 -2506 -2504 -2501 -2499 -2497 + -2495 -2492 -2490 -2488 -2485 -2483 -2481 -2478 + -2476 -2474 -2471 -2469 -2467 -2464 -2462 -2459 + -2457 -2455 -2452 -2450 -2448 -2445 -2443 -2441 + -2438 -2436 -2434 -2431 -2429 -2426 -2424 -2422 + -2419 -2417 -2415 -2412 -2410 -2407 -2405 -2403 + -2400 -2398 -2396 -2393 -2391 -2388 -2386 -2384 + -2381 -2379 -2376 -2374 -2372 -2369 -2367 -2364 + -2362 -2359 -2357 -2355 -2352 -2350 -2347 -2345 + -2343 -2340 -2338 -2335 -2333 -2330 -2328 -2325 + -2323 -2321 -2318 -2316 -2313 -2311 -2308 -2306 + -2303 -2301 -2299 -2296 -2294 -2291 -2289 -2286 + -2284 -2281 -2279 -2276 -2274 -2271 -2269 -2266 + -2264 -2261 -2259 -2257 -2254 -2252 -2249 -2247 + -2244 -2242 -2239 -2237 -2234 -2232 -2229 -2227 + -2224 -2222 -2219 -2216 -2214 -2211 -2209 -2206 + -2204 -2201 -2199 -2196 -2194 -2191 -2189 -2186 + -2184 -2181 -2179 -2176 -2173 -2171 -2168 -2166 + -2163 -2161 -2158 -2156 -2153 -2150 -2148 -2145 + -2143 -2140 -2138 -2135 -2132 -2130 -2127 -2125 + -2122 -2120 -2117 -2114 -2112 -2109 -2107 -2104 + -2101 -2099 -2096 -2094 -2091 -2088 -2086 -2083 + -2081 -2078 -2075 -2073 -2070 -2067 -2065 -2062 + -2060 -2057 -2054 -2052 -2049 -2046 -2044 -2041 + -2038 -2036 -2033 -2031 -2028 -2025 -2023 -2020 + -2017 -2015 -2012 -2009 -2007 -2004 -2001 -1999 + -1996 -1993 -1991 -1988 -1985 -1983 -1980 -1977 + -1974 -1972 -1969 -1966 -1964 -1961 -1958 -1956 + -1953 -1950 -1947 -1945 -1942 -1939 -1937 -1934 + -1931 -1928 -1926 -1923 -1920 -1917 -1915 -1912 + -1909 -1907 -1904 -1901 -1898 -1896 -1893 -1890 + -1887 -1884 -1882 -1879 -1876 -1873 -1871 -1868 + -1865 -1862 -1860 -1857 -1854 -1851 -1848 -1846 + -1843 -1840 -1837 -1834 -1832 -1829 -1826 -1823 + -1820 -1818 -1815 -1812 -1809 -1806 -1804 -1801 + -1798 -1795 -1792 -1789 -1787 -1784 -1781 -1778 + -1775 -1772 -1770 -1767 -1764 -1761 -1758 -1755 + -1752 -1750 -1747 -1744 -1741 -1738 -1735 -1732 + -1729 -1727 -1724 -1721 -1718 -1715 -1712 -1709 + -1706 -1703 -1701 -1698 -1695 -1692 -1689 -1686 + -1683 -1680 -1677 -1674 -1671 -1668 -1666 -1663 + -1660 -1657 -1654 -1651 -1648 -1645 -1642 -1639 + -1636 -1633 -1630 -1627 -1624 -1621 -1618 -1615 + -1612 -1609 -1606 -1603 -1600 -1597 -1594 -1591 + -1589 -1586 -1583 -1580 -1577 -1574 -1571 -1567 + -1564 -1561 -1558 -1555 -1552 -1549 -1546 -1543 + -1540 -1537 -1534 -1531 -1528 -1525 -1522 -1519 + -1516 -1513 -1510 -1507 -1504 -1501 -1498 -1495 + -1491 -1488 -1485 -1482 -1479 -1476 -1473 -1470 + -1467 -1464 -1461 -1458 -1454 -1451 -1448 -1445 + -1442 -1439 -1436 -1433 -1430 -1426 -1423 -1420 + -1417 -1414 -1411 -1408 -1404 -1401 -1398 -1395 + -1392 -1389 -1386 -1382 -1379 -1376 -1373 -1370 + -1367 -1363 -1360 -1357 -1354 -1351 -1347 -1344 + -1341 -1338 -1335 -1331 -1328 -1325 -1322 -1319 + -1315 -1312 -1309 -1306 -1302 -1299 -1296 -1293 + -1290 -1286 -1283 -1280 -1277 -1273 -1270 -1267 + -1263 -1260 -1257 -1254 -1250 -1247 -1244 -1241 + -1237 -1234 -1231 -1227 -1224 -1221 -1218 -1214 + -1211 -1208 -1204 -1201 -1198 -1194 -1191 -1188 + -1184 -1181 -1178 -1174 -1171 -1168 -1164 -1161 + -1158 -1154 -1151 -1147 -1144 -1141 -1137 -1134 + -1131 -1127 -1124 -1120 -1117 -1114 -1110 -1107 + -1103 -1100 -1097 -1093 -1090 -1086 -1083 -1080 + -1076 -1073 -1069 -1066 -1062 -1059 -1056 -1052 + -1049 -1045 -1042 -1038 -1035 -1031 -1028 -1024 + -1021 -1017 -1014 -1010 -1007 -1003 -1000 -996 + -993 -989 -986 -982 -979 -975 -972 -968 + -965 -961 -958 -954 -951 -947 -944 -940 + -936 -933 -929 -926 -922 -919 -915 -911 + -908 -904 -901 -897 -894 -890 -886 -883 + -879 -876 -872 -868 -865 -861 -857 -854 + -850 -847 -843 -839 -836 -832 -828 -825 + -821 -817 -814 -810 -806 -803 -799 -795 + -792 -788 -784 -780 -777 -773 -769 -766 + -762 -758 -754 -751 -747 -743 -740 -736 + -732 -728 -725 -721 -717 -713 -709 -706 + -702 -698 -694 -691 -687 -683 -679 -675 + -672 -668 -664 -660 -656 -653 -649 -645 + -641 -637 -633 -630 -626 -622 -618 -614 + -610 -606 -602 -599 -595 -591 -587 -583 + -579 -575 -571 -567 -564 -560 -556 -552 + -548 -544 -540 -536 -532 -528 -524 -520 + -516 -512 -508 -504 -500 -496 -493 -489 + -485 -481 -477 -473 -469 -465 -461 -456 + -452 -448 -444 -440 -436 -432 -428 -424 + -420 -416 -412 -408 -404 -400 -396 -392 + -388 -383 -379 -375 -371 -367 -363 -359 + -355 -351 -346 -342 -338 -334 -330 -326 + -322 -317 -313 -309 -305 -301 -297 -292 + -288 -284 -280 -276 -271 -267 -263 -259 + -255 -250 -246 -242 -238 -233 -229 -225 + -221 -216 -212 -208 -204 -199 -195 -191 + -186 -182 -178 -173 -169 -165 -160 -156 + -152 -147 -143 -139 -134 -130 -126 -121 + -117 -113 -108 -104 -99 -95 -91 -86 + -82 -77 -73 -69 -64 -60 -55 -51 + -46 -42 -37 -33 -29 -24 -20 -15 + -11 -6 -2 3 7 12 16 21 + 25 30 34 39 44 48 53 57 + 62 66 71 76 80 85 89 94 + 99 103 108 112 117 122 126 131 + 136 140 145 150 154 159 164 168 + 173 178 182 187 192 196 201 206 + 211 215 220 225 230 234 239 244 + 249 253 258 263 268 273 277 282 + 287 292 297 302 306 311 316 321 + 326 331 336 341 345 350 355 360 + 365 370 375 380 385 390 395 400 + 405 409 414 419 424 429 434 439 + 444 449 454 459 464 470 475 480 + 485 490 495 500 505 510 515 520 + 525 530 536 541 546 551 556 561 + 566 572 577 582 587 592 597 603 + 608 613 618 623 629 634 639 644 + 650 655 660 665 671 676 681 687 + 692 697 703 708 713 719 724 729 + 735 740 745 751 756 761 767 772 + 778 783 789 794 799 805 810 816 + 821 827 832 838 843 849 854 860 + 865 871 876 882 887 893 899 904 + 910 915 921 927 932 938 943 949 + 955 960 966 972 977 983 989 994 + 1000 1006 1011 1017 1023 1029 1034 1040 + 1046 1052 1057 1063 1069 1075 1081 1086 + 1092 1098 1104 1110 1116 1121 1127 1133 + 1139 1145 1151 1157 1163 1169 1175 1181 + 1186 1192 1198 1204 1210 1216 1222 1228 + 1234 1240 1246 1252 1258 1265 1271 1277 + 1283 1289 1295 1301 1307 1313 1319 1326 + 1332 1338 1344 1350 1356 1363 1369 1375 + 1381 1387 1394 1400 1406 1412 1419 1425 + 1431 1438 1444 1450 1456 1463 1469 1475 + 1482 1488 1495 1501 1507 1514 1520 1527 + 1533 1539 1546 1552 1559 1565 1572 1578 + 1585 1591 1598 1604 1611 1617 1624 1631 + 1637 1644 1650 1657 1664 1670 1677 1684 + 1690 1697 1704 1710 1717 1724 1730 1737 + 1744 1751 1757 1764 1771 1778 1784 1791 + 1798 1805 1812 1819 1825 1832 1839 1846 + 1853 1860 1867 1874 1881 1888 1895 1902 + 1909 1916 1923 1930 1937 1944 1951 1958 + 1965 1972 1979 1986 1993 2000 2008 2015 + 2022 2029 2036 2043 2051 2058 2065 2072 + 2080 2087 2094 2101 2109 2116 2123 2131 + 2138 2145 2153 2160 2168 2175 2182 2190 + 2197 2205 2212 2220 2227 2235 2242 2250 + 2257 2265 2272 2280 2287 2295 2303 2310 + 2318 2326 2333 2341 2349 2356 2364 2372 + 2379 2387 2395 2403 2410 2418 2426 2434 + 2442 2450 2457 2465 2473 2481 2489 2497 + 2505 2513 2521 2529 2537 2545 2553 2561 + 2569 2577 2585 2593 2601 2609 2618 2626 + 2634 2642 2650 2658 2667 2675 2683 2691 + 2700 2708 2716 2725 2733 2741 2750 2758 + 2766 2775 2783 2792 2800 2809 2817 2826 + 2834 2843 2851 2860 2868 2877 2885 2894 + 2903 2911 2920 2929 2937 2946 2955 2964 + 2972 2981 2990 2999 3008 3016 3025 3034 + 3043 3052 3061 3070 3079 3088 3097 3106 + 3115 3124 3133 3142 3151 3160 3169 3178 + 3187 3197 3206 3215 3224 3233 3243 3252 + 3261 3271 3280 3289 3299 3308 3317 3327 + 3336 3346 3355 3365 3374 3384 3393 3403 + 3412 3422 3432 3441 3451 3461 3470 3480 + 3490 3499 3509 3519 3529 3539 3549 3558 + 3568 3578 3588 3598 3608 3618 3628 3638 + 3648 3658 3668 3678 3688 3699 3709 3719 + 3729 3739 3750 3760 3770 3781 3791 3801 + 3812 3822 3832 3843 3853 3864 3874 3885 + 3895 3906 3917 3927 3938 3948 3959 3970 + 3981 3991 4002 4013 4024 4035 4045 4056 + 4067 4078 4089 4100 4111 4122 4133 4144 + 4155 4167 4178 4189 4200 4211 4223 4234 + 4245 4256 4268 4279 4291 4302 4313 4325 + 4336 4348 4359 4371 4383 4394 4406 4418 + 4429 4441 4453 4465 4476 4488 4500 4512 + 4524 4536 4548 4560 4572 4584 4596 4608 + 4620 4632 4645 4657 4669 4681 4694 4706 + 4718 4731 4743 4756 4768 4781 4793 4806 + 4818 4831 4844 4856 4869 4882 4895 4908 + 4920 4933 4946 4959 4972 4985 4998 5011 + 5024 5037 5051 5064 5077 5090 5104 5117 + 5130 5144 5157 5171 5184 5198 5211 5225 + 5238 5252 5266 5280 5293 5307 5321 5335 + 5349 5363 5377 5391 5405 5419 5433 5447 + 5461 5476 5490 5504 5519 5533 5547 5562 + 5576 5591 5605 5620 5635 5649 5664 5679 + 5694 5709 5724 5738 5753 5768 5783 5799 + 5814 5829 5844 5859 5875 5890 5905 5921 + 5936 5952 5967 5983 5999 6014 6030 6046 + 6062 6078 6094 6110 6126 6142 6158 6174 + 6190 6206 6223 6239 6255 6272 6288 6305 + 6321 6338 6355 6371 6388 6405 6422 6439 + 6456 6473 6490 6507 6524 6541 6559 6576 + 6593 6611 6628 6646 6663 6681 6699 6716 + 6734 6752 6770 6788 6806 6824 6842 6860 + 6879 6897 6915 6934 6952 6971 6989 7008 + 7027 7046 7065 7083 7102 7121 7141 7160 + 7179 7198 7218 7237 7256 7276 7296 7315 + 7335 7355 7375 7395 7415 7435 7455 7475 + 7495 7516 7536 7556 7577 7598 7618 7639 + 7660 7681 7702 7723 7744 7765 7786 7808 + 7829 7851 7872 7894 7916 7938 7959 7981 + 8003 8026 8048 8070 8092 8115 8137 8160 + 8183 8206 8228 8251 8274 8298 8321 8344 + 8367 8391 8415 8438 8462 8486 8510 8534 + 8558 8582 8606 8631 8655 8680 8705 8729 + 8754 8779 8804 8830 8855 8880 8906 8931 + 8957 8983 9009 9035 9061 9087 9113 9140 + 9166 9193 9220 9247 9274 9301 9328 9356 + 9383 9411 9438 9466 9494 9522 9550 9579 + 9607 9636 9664 9693 9722 9751 9780 9810 + 9839 9869 9898 9928 9958 9988 10019 10049 + 10080 10110 10141 10172 10203 10235 10266 10298 + 10329 10361 10393 10426 10458 10490 10523 10556 + 10589 10622 10655 10689 10722 10756 10790 10824 + 10859 10893 10928 10963 10998 11033 11068 11104 + 11139 11175 11211 11248 11284 11321 11358 11395 + 11432 11470 11507 11545 11583 11622 11660 11699 + 11738 11777 11816 11856 11896 11936 11976 12017 + 12058 12098 12140 12181 12223 12265 12307 12349 + 12392 12435 12478 12522 12566 12609 12654 12698 + 12743 12788 12834 12879 12925 12971 13018 13065 + 13112 13159 13207 13255 13303 13352 13401 13450 + 13500 13550 13600 13651 13702 13753 13805 13857 + 13909 13962 14015 14069 14123 14177 14232 14287 + 14342 14398 14454 14511 14568 14626 14684 14742 + 14801 14860 14920 14980 15041 15102 15164 15226 + 15288 15351 15415 15479 15544 15609 15675 15741 + 15808 15875 15943 16011 16080 16150 16220 16291 + 16363 16435 16508 16581 16655 16730 16805 16881 + 16958 17036 17114 17193 17273 17353 17435 17517 + 17600 17683 17768 17853 17939 18027 18115 18203 + 18293 18384 18476 18569 18662 18757 18853 18950 + 19047 19146 19246 19348 19450 19554 19658 19764 + 19872 19980 20090 20201 20314 20428 20543 20660 + 20778 20898 21020 21143 21267 21394 21522 21652 + 21783 21917 22052 22189 22329 22470 22613 22759 + 22907 23056 23209 23363 23521 23680 23842 24007 + 24175 24345 24519 24695 24874 25057 25243 25432 + 25625 25821 26021 26225 26433 26645 26861 27081 + 27307 27537 27771 28011 28257 28508 28764 29027 + 29295 29570 29852 30141 30438 30742 31054 31374 + 31704 32042 32391 32750 32767 32767 32767 32767 + 32767 32767 32767 32767 32767 32767 32767 32767 + 32767 32767 32767 32767 32767 32767 32767 32767 + 32767 32767 32767 32767 32767 32767 32767 32767 + 32767 32767 32767 32767 32767 32767 32767 32767 + 32767 32767 32767 32767 32767 32767 32767 32767 diff --git a/internal/gotc/testdata/tc-lib/paretonormal.dist b/internal/gotc/testdata/tc-lib/paretonormal.dist new file mode 100644 index 000000000..61be1b8c7 --- /dev/null +++ b/internal/gotc/testdata/tc-lib/paretonormal.dist @@ -0,0 +1,513 @@ +# This is the distribution table for the paretonormal distribution. + -12305 -11171 -10812 -10586 -10418 -10284 -10172 -10075 + -9990 -9914 -9845 -9783 -9724 -9670 -9620 -9572 + -9527 -9485 -9445 -9406 -9370 -9335 -9302 -9269 + -9238 -9208 -9179 -9151 -9123 -9097 -9072 -9047 + -9023 -8999 -8976 -8954 -8932 -8910 -8889 -8869 + -8849 -8830 -8810 -8792 -8773 -8755 -8737 -8720 + -8702 -8685 -8670 -8653 -8637 -8621 -8606 -8590 + -8575 -8560 -8546 -8531 -8517 -8503 -8489 -8476 + -8462 -8449 -8436 -8423 -8410 -8397 -8384 -8372 + -8360 -8348 -8336 -8324 -8312 -8301 -8289 -8278 + -8266 -8255 -8244 -8234 -8223 -8212 -8201 -8191 + -8180 -8170 -8159 -8149 -8139 -8129 -8119 -8110 + -8100 -8090 -8081 -8071 -8062 -8052 -8043 -8033 + -8024 -8015 -8006 -7998 -7989 -7980 -7971 -7962 + -7954 -7945 -7936 -7928 -7919 -7911 -7903 -7894 + -7887 -7879 -7870 -7862 -7854 -7846 -7838 -7830 + -7822 -7815 -7807 -7799 -7791 -7784 -7777 -7769 + -7762 -7754 -7747 -7739 -7732 -7725 -7717 -7710 + -7703 -7696 -7689 -7682 -7675 -7668 -7661 -7654 + -7647 -7640 -7634 -7627 -7620 -7613 -7606 -7600 + -7593 -7586 -7580 -7573 -7567 -7561 -7554 -7548 + -7541 -7535 -7529 -7522 -7516 -7510 -7503 -7497 + -7491 -7485 -7478 -7472 -7466 -7461 -7455 -7449 + -7443 -7437 -7431 -7425 -7419 -7413 -7407 -7401 + -7395 -7389 -7383 -7378 -7372 -7366 -7360 -7355 + -7350 -7344 -7338 -7333 -7327 -7321 -7316 -7310 + -7305 -7299 -7294 -7288 -7283 -7277 -7272 -7266 + -7261 -7256 -7250 -7245 -7240 -7235 -7230 -7224 + -7219 -7214 -7209 -7204 -7198 -7193 -7188 -7183 + -7178 -7173 -7167 -7162 -7157 -7152 -7147 -7142 + -7137 -7132 -7127 -7122 -7117 -7112 -7107 -7103 + -7098 -7093 -7088 -7083 -7078 -7074 -7069 -7064 + -7059 -7054 -7049 -7045 -7040 -7035 -7030 -7026 + -7021 -7016 -7012 -7007 -7002 -6997 -6993 -6988 + -6984 -6979 -6974 -6970 -6965 -6961 -6956 -6951 + -6947 -6942 -6939 -6934 -6930 -6925 -6921 -6916 + -6912 -6907 -6903 -6898 -6894 -6889 -6885 -6881 + -6876 -6872 -6868 -6863 -6859 -6854 -6850 -6846 + -6842 -6837 -6833 -6829 -6824 -6820 -6816 -6811 + -6807 -6803 -6799 -6795 -6790 -6786 -6782 -6778 + -6774 -6769 -6765 -6761 -6757 -6753 -6749 -6745 + -6740 -6736 -6732 -6728 -6724 -6720 -6716 -6712 + -6708 -6704 -6700 -6696 -6692 -6688 -6684 -6680 + -6676 -6672 -6668 -6664 -6660 -6656 -6652 -6648 + -6644 -6640 -6636 -6632 -6628 -6624 -6620 -6617 + -6613 -6609 -6605 -6601 -6597 -6593 -6590 -6586 + -6582 -6578 -6574 -6570 -6567 -6563 -6559 -6555 + -6551 -6548 -6544 -6540 -6536 -6533 -6529 -6525 + -6521 -6518 -6514 -6510 -6506 -6503 -6499 -6495 + -6492 -6488 -6484 -6481 -6477 -6473 -6470 -6466 + -6462 -6459 -6455 -6451 -6448 -6444 -6441 -6437 + -6433 -6430 -6426 -6422 -6418 -6415 -6411 -6407 + -6404 -6400 -6397 -6393 -6390 -6386 -6383 -6379 + -6375 -6372 -6368 -6365 -6361 -6358 -6354 -6351 + -6347 -6344 -6340 -6337 -6333 -6330 -6326 -6323 + -6320 -6316 -6313 -6309 -6306 -6302 -6298 -6295 + -6291 -6288 -6284 -6281 -6278 -6274 -6271 -6268 + -6264 -6261 -6257 -6254 -6251 -6247 -6244 -6241 + -6237 -6234 -6230 -6227 -6224 -6220 -6216 -6213 + -6210 -6206 -6203 -6200 -6196 -6193 -6190 -6187 + -6183 -6180 -6177 -6173 -6170 -6167 -6164 -6160 + -6157 -6154 -6150 -6147 -6143 -6140 -6137 -6134 + -6130 -6127 -6124 -6121 -6117 -6114 -6111 -6108 + -6105 -6101 -6098 -6094 -6091 -6088 -6085 -6081 + -6078 -6075 -6072 -6069 -6066 -6062 -6059 -6056 + -6053 -6050 -6047 -6043 -6040 -6037 -6033 -6030 + -6027 -6024 -6021 -6018 -6015 -6011 -6008 -6005 + -6002 -5999 -5995 -5992 -5989 -5986 -5983 -5980 + -5977 -5974 -5971 -5967 -5964 -5961 -5958 -5954 + -5951 -5948 -5945 -5942 -5939 -5936 -5933 -5930 + -5927 -5924 -5921 -5917 -5914 -5911 -5908 -5905 + -5902 -5899 -5896 -5893 -5890 -5887 -5884 -5880 + -5877 -5874 -5871 -5868 -5865 -5862 -5859 -5857 + -5854 -5851 -5847 -5844 -5841 -5838 -5835 -5832 + -5829 -5826 -5823 -5820 -5817 -5814 -5811 -5808 + -5805 -5802 -5799 -5796 -5793 -5790 -5787 -5784 + -5781 -5778 -5775 -5772 -5769 -5766 -5763 -5760 + -5758 -5754 -5751 -5748 -5745 -5742 -5740 -5737 + -5734 -5731 -5727 -5724 -5722 -5719 -5716 -5713 + -5710 -5707 -5704 -5701 -5698 -5695 -5692 -5689 + -5687 -5684 -5681 -5678 -5675 -5672 -5669 -5666 + -5663 -5660 -5658 -5655 -5651 -5648 -5646 -5643 + -5640 -5637 -5634 -5632 -5629 -5625 -5622 -5620 + -5617 -5614 -5611 -5609 -5606 -5602 -5600 -5597 + -5594 -5591 -5588 -5586 -5582 -5579 -5577 -5574 + -5571 -5568 -5566 -5563 -5559 -5557 -5554 -5551 + -5548 -5546 -5543 -5539 -5537 -5534 -5531 -5528 + -5526 -5523 -5520 -5517 -5514 -5511 -5509 -5506 + -5503 -5501 -5497 -5494 -5492 -5489 -5486 -5483 + -5480 -5477 -5475 -5472 -5469 -5467 -5464 -5460 + -5458 -5455 -5452 -5450 -5447 -5444 -5441 -5438 + -5436 -5433 -5430 -5428 -5424 -5421 -5419 -5416 + -5414 -5411 -5408 -5405 -5402 -5399 -5397 -5394 + -5392 -5388 -5386 -5383 -5380 -5378 -5375 -5372 + -5369 -5366 -5364 -5361 -5358 -5355 -5352 -5350 + -5347 -5345 -5342 -5339 -5336 -5333 -5331 -5328 + -5326 -5322 -5320 -5317 -5314 -5312 -5309 -5306 + -5303 -5301 -5298 -5296 -5292 -5290 -5287 -5284 + -5282 -5279 -5276 -5273 -5271 -5268 -5266 -5262 + -5260 -5257 -5254 -5252 -5249 -5246 -5243 -5241 + -5238 -5236 -5233 -5230 -5227 -5225 -5222 -5219 + -5216 -5214 -5211 -5209 -5206 -5203 -5200 -5198 + -5195 -5193 -5190 -5187 -5184 -5182 -5179 -5176 + -5174 -5171 -5168 -5166 -5163 -5160 -5158 -5155 + -5153 -5149 -5147 -5144 -5142 -5139 -5136 -5133 + -5131 -5129 -5125 -5123 -5120 -5118 -5115 -5112 + -5109 -5107 -5104 -5102 -5099 -5096 -5094 -5091 + -5089 -5085 -5083 -5080 -5078 -5075 -5072 -5070 + -5067 -5065 -5062 -5059 -5057 -5054 -5051 -5049 + -5046 -5044 -5041 -5038 -5035 -5033 -5030 -5027 + -5025 -5022 -5020 -5017 -5014 -5012 -5009 -5007 + -5004 -5001 -4999 -4996 -4993 -4991 -4988 -4986 + -4983 -4980 -4978 -4975 -4973 -4970 -4967 -4965 + -4962 -4959 -4957 -4954 -4952 -4949 -4946 -4944 + -4941 -4938 -4936 -4933 -4931 -4928 -4925 -4923 + -4920 -4917 -4915 -4912 -4910 -4907 -4904 -4902 + -4900 -4897 -4894 -4892 -4889 -4886 -4884 -4881 + -4879 -4876 -4873 -4871 -4869 -4865 -4863 -4861 + -4858 -4855 -4853 -4850 -4848 -4845 -4842 -4840 + -4838 -4834 -4832 -4830 -4827 -4824 -4822 -4819 + -4816 -4814 -4812 -4809 -4806 -4804 -4801 -4798 + -4796 -4793 -4791 -4788 -4786 -4783 -4781 -4778 + -4775 -4773 -4770 -4767 -4765 -4763 -4760 -4757 + -4755 -4752 -4749 -4747 -4745 -4742 -4739 -4737 + -4735 -4732 -4729 -4727 -4724 -4721 -4719 -4716 + -4714 -4711 -4709 -4706 -4703 -4701 -4698 -4696 + -4693 -4691 -4688 -4686 -4683 -4680 -4678 -4676 + -4672 -4670 -4668 -4665 -4662 -4660 -4658 -4655 + -4652 -4650 -4647 -4645 -4642 -4640 -4637 -4635 + -4632 -4629 -4627 -4625 -4622 -4619 -4617 -4614 + -4612 -4609 -4606 -4604 -4602 -4599 -4596 -4594 + -4592 -4589 -4586 -4584 -4581 -4579 -4576 -4573 + -4571 -4569 -4566 -4563 -4561 -4558 -4556 -4553 + -4550 -4548 -4546 -4543 -4540 -4538 -4535 -4533 + -4530 -4527 -4525 -4523 -4520 -4518 -4515 -4512 + -4510 -4508 -4505 -4502 -4500 -4497 -4495 -4493 + -4490 -4487 -4485 -4482 -4480 -4477 -4474 -4472 + -4470 -4467 -4465 -4462 -4459 -4457 -4455 -4452 + -4449 -4446 -4444 -4442 -4439 -4437 -4434 -4431 + -4429 -4427 -4424 -4422 -4419 -4416 -4414 -4412 + -4409 -4407 -4404 -4401 -4399 -4396 -4394 -4392 + -4389 -4386 -4384 -4381 -4379 -4376 -4374 -4371 + -4368 -4366 -4364 -4361 -4359 -4356 -4353 -4351 + -4348 -4346 -4344 -4341 -4338 -4336 -4333 -4331 + -4328 -4326 -4324 -4321 -4318 -4315 -4313 -4311 + -4308 -4306 -4303 -4300 -4298 -4295 -4293 -4291 + -4288 -4286 -4283 -4280 -4278 -4275 -4273 -4270 + -4268 -4266 -4263 -4261 -4258 -4255 -4253 -4250 + -4248 -4245 -4243 -4241 -4238 -4235 -4232 -4230 + -4228 -4225 -4223 -4220 -4218 -4215 -4213 -4210 + -4207 -4205 -4202 -4200 -4198 -4195 -4193 -4190 + -4187 -4185 -4182 -4180 -4177 -4175 -4172 -4170 + -4168 -4165 -4163 -4160 -4157 -4155 -4152 -4150 + -4147 -4145 -4142 -4140 -4138 -4135 -4133 -4130 + -4127 -4124 -4122 -4119 -4117 -4115 -4112 -4110 + -4107 -4105 -4102 -4100 -4097 -4094 -4092 -4089 + -4087 -4084 -4082 -4079 -4077 -4075 -4072 -4070 + -4067 -4065 -4062 -4060 -4057 -4054 -4052 -4049 + -4047 -4044 -4042 -4039 -4037 -4034 -4032 -4029 + -4027 -4024 -4022 -4020 -4017 -4015 -4012 -4009 + -4006 -4004 -4001 -3999 -3996 -3994 -3991 -3989 + -3987 -3984 -3982 -3979 -3977 -3974 -3972 -3969 + -3967 -3964 -3962 -3959 -3957 -3954 -3952 -3949 + -3947 -3944 -3941 -3939 -3936 -3933 -3931 -3929 + -3926 -3924 -3921 -3919 -3916 -3914 -3911 -3909 + -3906 -3904 -3901 -3899 -3896 -3894 -3891 -3889 + -3886 -3884 -3881 -3879 -3876 -3874 -3871 -3869 + -3866 -3864 -3861 -3859 -3856 -3854 -3851 -3849 + -3846 -3844 -3841 -3839 -3836 -3833 -3831 -3828 + -3826 -3823 -3821 -3818 -3816 -3813 -3811 -3808 + -3806 -3803 -3801 -3798 -3796 -3793 -3791 -3788 + -3786 -3783 -3781 -3778 -3775 -3773 -3770 -3768 + -3765 -3763 -3760 -3758 -3755 -3753 -3750 -3748 + -3745 -3743 -3740 -3737 -3735 -3732 -3730 -3727 + -3725 -3722 -3720 -3717 -3715 -3712 -3709 -3707 + -3704 -3702 -3700 -3697 -3695 -3692 -3689 -3687 + -3685 -3682 -3680 -3677 -3675 -3672 -3669 -3667 + -3664 -3662 -3659 -3657 -3654 -3652 -3649 -3646 + -3644 -3641 -3639 -3636 -3634 -3631 -3629 -3626 + -3624 -3621 -3619 -3616 -3614 -3611 -3609 -3606 + -3604 -3601 -3598 -3596 -3593 -3591 -3588 -3585 + -3583 -3580 -3578 -3575 -3573 -3571 -3568 -3566 + -3563 -3561 -3558 -3555 -3553 -3550 -3548 -3545 + -3542 -3540 -3537 -3535 -3532 -3530 -3528 -3525 + -3522 -3520 -3517 -3515 -3512 -3509 -3507 -3504 + -3502 -3499 -3496 -3494 -3492 -3489 -3487 -3484 + -3482 -3479 -3476 -3474 -3471 -3469 -3466 -3463 + -3461 -3458 -3456 -3454 -3451 -3448 -3446 -3443 + -3441 -3438 -3435 -3433 -3430 -3428 -3425 -3423 + -3420 -3418 -3415 -3413 -3410 -3407 -3405 -3402 + -3399 -3397 -3395 -3392 -3390 -3387 -3384 -3382 + -3379 -3376 -3374 -3371 -3369 -3367 -3364 -3361 + -3359 -3356 -3353 -3351 -3348 -3345 -3343 -3341 + -3338 -3336 -3333 -3330 -3328 -3325 -3322 -3320 + -3318 -3315 -3313 -3310 -3307 -3305 -3302 -3299 + -3297 -3294 -3292 -3290 -3287 -3284 -3281 -3279 + -3276 -3273 -3271 -3269 -3266 -3264 -3261 -3258 + -3256 -3253 -3250 -3248 -3246 -3243 -3240 -3238 + -3235 -3232 -3229 -3227 -3225 -3222 -3220 -3217 + -3214 -3212 -3209 -3206 -3204 -3202 -3199 -3196 + -3194 -3191 -3188 -3186 -3184 -3181 -3178 -3175 + -3173 -3170 -3167 -3165 -3163 -3160 -3157 -3155 + -3152 -3149 -3147 -3144 -3142 -3139 -3136 -3134 + -3131 -3128 -3126 -3124 -3121 -3118 -3115 -3113 + -3110 -3108 -3105 -3103 -3100 -3097 -3094 -3092 + -3090 -3087 -3084 -3082 -3079 -3076 -3074 -3071 + -3069 -3066 -3063 -3061 -3058 -3056 -3053 -3050 + -3048 -3045 -3042 -3040 -3037 -3035 -3032 -3029 + -3026 -3024 -3021 -3019 -3016 -3014 -3011 -3008 + -3005 -3003 -3001 -2998 -2995 -2992 -2990 -2987 + -2985 -2982 -2979 -2976 -2974 -2972 -2969 -2966 + -2963 -2961 -2958 -2956 -2953 -2950 -2948 -2945 + -2942 -2940 -2937 -2935 -2932 -2929 -2926 -2924 + -2921 -2919 -2916 -2913 -2911 -2908 -2905 -2903 + -2900 -2897 -2895 -2892 -2890 -2887 -2884 -2881 + -2879 -2876 -2873 -2871 -2868 -2865 -2863 -2860 + -2857 -2855 -2852 -2850 -2847 -2844 -2841 -2839 + -2836 -2834 -2831 -2828 -2825 -2823 -2820 -2818 + -2815 -2812 -2809 -2807 -2804 -2801 -2799 -2796 + -2794 -2791 -2788 -2785 -2782 -2780 -2778 -2775 + -2772 -2769 -2767 -2764 -2761 -2758 -2756 -2753 + -2751 -2748 -2745 -2742 -2740 -2737 -2734 -2732 + -2729 -2726 -2724 -2721 -2718 -2715 -2713 -2710 + -2707 -2705 -2702 -2700 -2697 -2694 -2691 -2689 + -2686 -2683 -2680 -2677 -2675 -2673 -2670 -2667 + -2664 -2662 -2659 -2656 -2653 -2650 -2648 -2645 + -2642 -2639 -2637 -2635 -2632 -2629 -2626 -2623 + -2621 -2618 -2615 -2612 -2610 -2607 -2604 -2601 + -2599 -2596 -2593 -2590 -2588 -2586 -2583 -2580 + -2577 -2575 -2572 -2569 -2566 -2563 -2561 -2558 + -2555 -2552 -2550 -2547 -2544 -2541 -2539 -2536 + -2533 -2530 -2528 -2525 -2522 -2519 -2516 -2514 + -2511 -2508 -2505 -2503 -2500 -2497 -2494 -2492 + -2489 -2486 -2483 -2481 -2478 -2475 -2472 -2470 + -2467 -2464 -2461 -2458 -2456 -2453 -2450 -2447 + -2445 -2442 -2439 -2436 -2434 -2431 -2428 -2425 + -2423 -2420 -2417 -2414 -2412 -2409 -2406 -2403 + -2401 -2398 -2395 -2392 -2390 -2387 -2384 -2381 + -2379 -2375 -2372 -2369 -2367 -2364 -2361 -2358 + -2356 -2353 -2350 -2347 -2345 -2342 -2339 -2336 + -2334 -2331 -2327 -2325 -2322 -2319 -2316 -2314 + -2311 -2308 -2305 -2303 -2300 -2297 -2294 -2291 + -2288 -2285 -2282 -2280 -2277 -2274 -2271 -2269 + -2266 -2263 -2260 -2257 -2254 -2251 -2249 -2246 + -2243 -2240 -2238 -2235 -2231 -2229 -2226 -2223 + -2220 -2218 -2215 -2212 -2209 -2206 -2203 -2200 + -2198 -2195 -2192 -2189 -2186 -2183 -2180 -2178 + -2175 -2172 -2169 -2166 -2163 -2160 -2158 -2155 + -2152 -2149 -2146 -2143 -2140 -2137 -2135 -2132 + -2129 -2126 -2123 -2120 -2118 -2115 -2112 -2108 + -2106 -2103 -2100 -2097 -2094 -2091 -2088 -2086 + -2083 -2080 -2077 -2074 -2071 -2068 -2066 -2062 + -2059 -2057 -2054 -2051 -2048 -2045 -2042 -2039 + -2037 -2033 -2030 -2028 -2025 -2022 -2019 -2016 + -2013 -2010 -2008 -2004 -2001 -1999 -1996 -1992 + -1990 -1987 -1984 -1981 -1978 -1975 -1972 -1970 + -1966 -1963 -1960 -1958 -1954 -1952 -1949 -1946 + -1942 -1940 -1937 -1934 -1931 -1928 -1925 -1922 + -1919 -1916 -1913 -1910 -1907 -1904 -1902 -1898 + -1895 -1893 -1890 -1886 -1884 -1881 -1877 -1875 + -1872 -1869 -1866 -1863 -1860 -1857 -1854 -1851 + -1848 -1845 -1842 -1839 -1836 -1833 -1830 -1827 + -1824 -1821 -1818 -1815 -1812 -1809 -1806 -1803 + -1801 -1797 -1794 -1792 -1788 -1785 -1783 -1779 + -1776 -1774 -1770 -1767 -1764 -1761 -1758 -1755 + -1752 -1749 -1746 -1743 -1740 -1737 -1734 -1731 + -1728 -1725 -1722 -1719 -1716 -1712 -1710 -1707 + -1703 -1701 -1698 -1694 -1692 -1688 -1685 -1683 + -1679 -1676 -1674 -1670 -1667 -1664 -1661 -1658 + -1655 -1652 -1649 -1646 -1643 -1640 -1637 -1633 + -1631 -1627 -1624 -1621 -1618 -1615 -1612 -1609 + -1606 -1603 -1600 -1596 -1594 -1590 -1587 -1584 + -1581 -1578 -1575 -1572 -1569 -1566 -1562 -1560 + -1556 -1553 -1551 -1547 -1544 -1541 -1538 -1535 + -1532 -1528 -1526 -1522 -1519 -1516 -1513 -1509 + -1507 -1503 -1500 -1498 -1494 -1491 -1488 -1485 + -1482 -1479 -1475 -1473 -1469 -1466 -1463 -1460 + -1457 -1454 -1450 -1447 -1444 -1441 -1438 -1434 + -1432 -1428 -1425 -1422 -1419 -1415 -1413 -1409 + -1406 -1403 -1400 -1397 -1393 -1390 -1387 -1384 + -1381 -1378 -1374 -1372 -1368 -1365 -1362 -1358 + -1355 -1352 -1349 -1346 -1342 -1339 -1336 -1333 + -1330 -1327 -1323 -1320 -1317 -1314 -1311 -1307 + -1304 -1301 -1298 -1295 -1291 -1288 -1285 -1281 + -1279 -1275 -1272 -1269 -1265 -1262 -1259 -1256 + -1253 -1249 -1246 -1243 -1239 -1236 -1233 -1230 + -1226 -1223 -1220 -1217 -1214 -1210 -1207 -1204 + -1200 -1197 -1194 -1190 -1188 -1184 -1181 -1178 + -1174 -1171 -1168 -1165 -1161 -1158 -1155 -1151 + -1148 -1145 -1141 -1138 -1135 -1132 -1128 -1125 + -1122 -1118 -1115 -1112 -1108 -1105 -1102 -1099 + -1095 -1092 -1089 -1085 -1082 -1078 -1075 -1072 + -1068 -1066 -1062 -1059 -1055 -1052 -1049 -1045 + -1042 -1038 -1035 -1032 -1028 -1025 -1022 -1019 + -1015 -1012 -1009 -1005 -1002 -998 -995 -992 + -988 -985 -981 -978 -975 -971 -968 -964 + -961 -958 -955 -951 -947 -944 -941 -938 + -934 -931 -927 -924 -921 -917 -914 -910 + -907 -903 -900 -897 -893 -890 -886 -883 + -879 -876 -873 -869 -866 -862 -859 -855 + -852 -849 -845 -842 -838 -835 -831 -828 + -824 -821 -818 -814 -811 -807 -804 -800 + -797 -793 -790 -786 -782 -779 -776 -773 + -769 -765 -762 -758 -755 -751 -748 -744 + -741 -737 -734 -730 -727 -723 -719 -716 + -712 -709 -705 -702 -698 -695 -691 -688 + -685 -681 -678 -674 -671 -667 -664 -659 + -656 -652 -649 -645 -642 -638 -634 -631 + -627 -624 -620 -617 -613 -610 -606 -603 + -599 -595 -592 -588 -585 -581 -578 -574 + -570 -566 -563 -559 -556 -552 -549 -545 + -541 -538 -534 -531 -527 -523 -519 -516 + -512 -509 -505 -502 -498 -494 -490 -487 + -483 -480 -476 -472 -468 -465 -461 -457 + -454 -450 -447 -443 -439 -435 -432 -428 + -425 -420 -417 -413 -410 -406 -402 -398 + -395 -391 -388 -383 -380 -376 -373 -369 + -365 -361 -358 -354 -350 -346 -343 -339 + -336 -331 -328 -324 -320 -316 -313 -309 + -305 -301 -298 -294 -290 -286 -283 -279 + -275 -271 -268 -263 -260 -256 -253 -248 + -245 -241 -237 -233 -230 -225 -222 -218 + -214 -210 -207 -202 -199 -195 -191 -187 + -184 -179 -176 -171 -168 -164 -160 -156 + -153 -149 -145 -141 -137 -133 -129 -126 + -121 -118 -114 -110 -106 -102 -98 -95 + -90 -87 -82 -79 -75 -71 -67 -63 + -59 -55 -52 -47 -44 -39 -36 -31 + -28 -23 -20 -15 -12 -8 -4 0 + 3 8 11 16 19 23 27 31 + 35 39 43 47 51 55 59 63 + 67 71 75 79 83 87 91 96 + 99 104 107 112 115 119 124 127 + 132 135 140 144 148 152 156 160 + 164 168 172 177 180 185 189 193 + 197 201 205 209 214 217 222 226 + 230 234 238 243 246 251 255 259 + 263 267 272 275 280 284 288 292 + 296 301 304 309 313 317 322 325 + 330 334 338 342 346 351 355 360 + 363 368 372 376 381 384 389 393 + 397 402 406 410 414 419 423 427 + 432 436 440 444 448 453 457 462 + 466 470 475 479 483 487 492 496 + 500 505 509 513 518 522 527 531 + 535 540 544 549 553 557 561 565 + 570 574 579 583 587 592 596 601 + 606 610 614 619 623 628 632 636 + 641 645 650 654 658 663 667 672 + 676 681 686 690 694 699 703 708 + 712 716 722 726 730 735 739 744 + 748 753 758 762 766 771 775 780 + 785 789 794 798 803 808 812 816 + 821 826 830 835 839 844 849 853 + 858 863 867 872 876 881 886 890 + 895 900 904 909 914 918 923 928 + 932 937 942 946 951 956 960 965 + 970 974 979 984 989 994 998 1003 + 1008 1013 1017 1022 1027 1031 1037 1041 + 1046 1051 1056 1060 1065 1070 1074 1079 + 1084 1089 1094 1099 1103 1108 1113 1118 + 1123 1128 1132 1137 1143 1147 1152 1157 + 1162 1166 1171 1177 1181 1186 1191 1196 + 1201 1206 1211 1215 1221 1226 1230 1236 + 1241 1245 1250 1256 1260 1265 1271 1275 + 1280 1285 1290 1295 1300 1305 1310 1315 + 1320 1325 1330 1335 1341 1345 1350 1356 + 1361 1365 1370 1376 1381 1386 1391 1396 + 1401 1406 1412 1417 1421 1426 1432 1437 + 1442 1447 1453 1458 1462 1468 1473 1478 + 1483 1489 1494 1499 1504 1510 1515 1520 + 1525 1530 1535 1540 1546 1551 1556 1561 + 1567 1572 1577 1582 1588 1594 1599 1604 + 1609 1615 1620 1625 1630 1636 1641 1646 + 1651 1657 1663 1668 1673 1679 1684 1689 + 1694 1700 1706 1711 1716 1721 1727 1733 + 1738 1743 1749 1754 1760 1765 1770 1776 + 1782 1787 1792 1798 1804 1809 1814 1820 + 1825 1831 1837 1842 1847 1853 1859 1864 + 1870 1875 1881 1887 1892 1897 1903 1909 + 1915 1920 1926 1931 1937 1943 1948 1954 + 1959 1965 1971 1977 1982 1988 1993 1999 + 2005 2011 2016 2022 2028 2034 2040 2045 + 2051 2056 2062 2068 2074 2080 2085 2091 + 2097 2103 2109 2115 2120 2126 2132 2138 + 2144 2150 2155 2161 2167 2173 2179 2185 + 2191 2197 2202 2208 2214 2221 2227 2232 + 2238 2244 2250 2256 2263 2268 2274 2280 + 2286 2292 2298 2304 2311 2317 2323 2329 + 2334 2340 2346 2353 2359 2365 2371 2377 + 2383 2389 2395 2402 2408 2414 2421 2427 + 2433 2439 2445 2451 2457 2463 2470 2476 + 2483 2489 2495 2501 2507 2514 2520 2526 + 2532 2538 2545 2552 2558 2564 2571 2577 + 2583 2590 2596 2602 2608 2615 2621 2628 + 2634 2641 2648 2654 2660 2667 2673 2680 + 2686 2692 2699 2705 2712 2718 2725 2731 + 2738 2744 2751 2758 2764 2771 2778 2784 + 2791 2798 2804 2811 2818 2824 2831 2838 + 2844 2851 2858 2864 2871 2878 2884 2891 + 2898 2905 2911 2918 2925 2932 2938 2945 + 2952 2959 2966 2973 2979 2986 2993 3000 + 3007 3014 3021 3028 3035 3042 3049 3056 + 3063 3070 3077 3084 3091 3097 3104 3111 + 3118 3125 3132 3139 3146 3153 3161 3168 + 3175 3182 3189 3196 3204 3211 3218 3225 + 3233 3240 3247 3254 3261 3268 3275 3283 + 3290 3297 3305 3312 3320 3327 3334 3341 + 3348 3356 3363 3371 3378 3386 3393 3401 + 3408 3415 3422 3430 3437 3445 3453 3460 + 3468 3475 3482 3490 3498 3505 3513 3521 + 3528 3536 3543 3551 3558 3566 3574 3582 + 3589 3597 3604 3612 3620 3628 3636 3643 + 3651 3659 3667 3675 3683 3690 3698 3706 + 3714 3722 3730 3737 3745 3753 3762 3770 + 3777 3785 3793 3801 3809 3817 3825 3833 + 3842 3850 3857 3866 3874 3882 3890 3898 + 3906 3915 3923 3931 3939 3948 3956 3964 + 3972 3981 3989 3997 4005 4014 4022 4030 + 4039 4047 4055 4064 4072 4081 4089 4098 + 4106 4115 4123 4132 4141 4148 4157 4166 + 4175 4183 4192 4201 4209 4218 4227 4235 + 4244 4253 4261 4270 4279 4287 4296 4305 + 4313 4323 4332 4340 4349 4358 4367 4376 + 4385 4394 4403 4411 4421 4430 4438 4448 + 4457 4466 4475 4484 4493 4502 4511 4521 + 4529 4539 4548 4557 4567 4576 4585 4594 + 4604 4613 4622 4632 4641 4651 4660 4669 + 4679 4688 4698 4707 4717 4726 4736 4745 + 4755 4764 4774 4783 4793 4803 4813 4822 + 4832 4841 4852 4861 4871 4881 4891 4900 + 4911 4920 4930 4940 4950 4960 4970 4980 + 4990 5000 5010 5020 5030 5040 5050 5060 + 5071 5080 5091 5101 5112 5122 5131 5142 + 5152 5163 5173 5183 5194 5204 5215 5225 + 5235 5246 5257 5267 5278 5288 5299 5310 + 5320 5330 5342 5352 5363 5374 5384 5395 + 5406 5417 5427 5438 5450 5460 5471 5482 + 5493 5504 5515 5526 5537 5548 5559 5571 + 5582 5593 5604 5615 5627 5638 5649 5660 + 5672 5683 5695 5706 5717 5729 5741 5752 + 5763 5775 5786 5798 5810 5822 5833 5845 + 5856 5868 5880 5892 5904 5916 5928 5940 + 5951 5963 5975 5987 5999 6011 6024 6036 + 6048 6060 6073 6085 6097 6109 6122 6134 + 6146 6159 6171 6184 6196 6209 6221 6234 + 6246 6259 6272 6285 6297 6309 6322 6335 + 6348 6361 6374 6387 6400 6413 6426 6439 + 6451 6465 6478 6491 6505 6518 6531 6544 + 6557 6571 6584 6598 6611 6624 6638 6652 + 6666 6679 6693 6706 6720 6734 6747 6762 + 6776 6789 6803 6817 6831 6845 6859 6874 + 6887 6902 6916 6930 6945 6959 6973 6988 + 7002 7017 7031 7046 7061 7075 7090 7104 + 7119 7134 7149 7164 7178 7194 7208 7224 + 7238 7254 7269 7284 7299 7314 7330 7345 + 7361 7376 7391 7407 7422 7438 7454 7470 + 7485 7501 7517 7533 7548 7565 7581 7596 + 7612 7629 7645 7661 7677 7694 7710 7726 + 7743 7760 7776 7793 7809 7826 7843 7860 + 7877 7894 7911 7927 7944 7961 7979 7996 + 8013 8031 8048 8066 8083 8100 8118 8135 + 8153 8171 8189 8207 8225 8243 8261 8279 + 8297 8315 8333 8351 8370 8389 8407 8425 + 8444 8463 8482 8500 8519 8538 8557 8576 + 8595 8615 8633 8653 8673 8692 8711 8731 + 8750 8770 8790 8810 8829 8850 8869 8890 + 8910 8930 8950 8970 8991 9012 9032 9053 + 9073 9094 9116 9136 9157 9178 9200 9221 + 9242 9263 9285 9307 9328 9350 9372 9393 + 9415 9437 9459 9482 9504 9526 9549 9571 + 9594 9617 9640 9663 9686 9709 9732 9755 + 9778 9802 9826 9849 9873 9897 9920 9945 + 9969 9993 10017 10041 10066 10090 10115 10140 + 10165 10190 10215 10240 10265 10291 10316 10342 + 10368 10394 10419 10445 10471 10498 10525 10551 + 10578 10604 10631 10658 10685 10713 10740 10767 + 10795 10822 10850 10879 10907 10934 10963 10991 + 11020 11049 11077 11107 11136 11165 11194 11224 + 11254 11284 11314 11344 11374 11405 11435 11466 + 11496 11527 11558 11590 11621 11653 11685 11717 + 11749 11782 11813 11846 11879 11912 11945 11979 + 12012 12046 12079 12114 12148 12182 12217 12252 + 12287 12321 12357 12392 12428 12464 12500 12536 + 12573 12610 12647 12684 12722 12759 12797 12835 + 12873 12911 12950 12989 13028 13067 13107 13147 + 13187 13227 13268 13309 13350 13392 13433 13475 + 13517 13560 13602 13646 13689 13732 13776 13820 + 13864 13909 13954 14000 14045 14091 14138 14184 + 14231 14278 14325 14373 14421 14470 14519 14568 + 14618 14668 14718 14769 14820 14871 14923 14976 + 15028 15081 15134 15188 15243 15297 15353 15408 + 15464 15520 15577 15634 15692 15751 15809 15869 + 15929 15989 16050 16111 16173 16235 16298 16361 + 16426 16490 16556 16621 16688 16755 16823 16891 + 16960 17029 17099 17170 17242 17315 17387 17461 + 17535 17610 17687 17764 17841 17919 17999 18079 + 18159 18241 18323 18407 18492 18577 18663 18751 + 18839 18928 19019 19110 19203 19297 19392 19488 + 19585 19683 19783 19884 19986 20090 20195 20301 + 20408 20518 20628 20740 20855 20970 21086 21206 + 21326 21448 21572 21698 21826 21956 22088 22222 + 22358 22496 22638 22780 22926 23074 23225 23378 + 23534 23693 23854 24019 24187 24359 24533 24710 + 24893 25078 25266 25460 25658 25859 26065 26276 + 26492 26712 26939 27170 27408 27652 27901 28157 + 28421 28691 28969 29256 29286 29304 29322 29341 + 29360 29379 29399 29419 29440 29462 29483 29506 + 29529 29553 29577 29602 29628 29655 29682 29711 + 29741 29771 29803 29837 29871 29908 29946 29986 + 30028 30073 30120 30171 30225 30284 30348 30417 + 30495 30582 30681 30797 30937 31116 31365 31789 diff --git a/internal/gotc/unit_test.go b/internal/gotc/unit_test.go index c6be761dd..0fc86bc70 100644 --- a/internal/gotc/unit_test.go +++ b/internal/gotc/unit_test.go @@ -179,6 +179,10 @@ func TestGotcOptions(t *testing.T) { want{stderr: "Command \"-s\" is unknown, try \"tc qdisc help\".\n", rc: 255}}, } for _, tc := range tests { + if writesBuilt && strings.Contains(tc.expected.stderr, notImpl+"tc qdisc") || + writesBuilt && strings.Contains(tc.expected.stderr, notImpl+"tc class") { + continue // the gotc_write build sends these (qwrite_test.go) + } t.Run(tc.description, func(t *testing.T) { t.Parallel() src := &fakeSource{replies: tc.replies} diff --git a/internal/gotc/units.go b/internal/gotc/units.go new file mode 100644 index 000000000..08b3128b8 --- /dev/null +++ b/internal/gotc/units.go @@ -0,0 +1,555 @@ +//go:build gotc_write + +package gotc + +import ( + "math" + "strconv" + "strings" + + "github.com/randomizedcoder/xtcp2/pkg/cint" +) + +// The units parsers a write uses: lib/utils_math.c (get_rate, get_rate64, +// get_size64, get_size), lib/utils.c (get_time, get_time64, read_prop), +// tc/tc_util.c (parse_percent, the percent rates, get_size_and_cell, +// get_linklayer), tc/tc_core.c (time2tick, tc_calc_xmittime, the rate +// and size tables) and tc/tc_estimator.c, each as v7.2.0 has it. +// +// Every double goes to an integer as gcc's x86-64 code converts it +// (cDoubleToU32, cDoubleToU64), since tc checks few of them: get_time, +// get_rate64 and get_size's caller let inf and nan through (W12). + +// cStrtod is glibc's strtod: leading white space, a sign, then "inf" or +// "infinity", "nan" with an optional "(chars)", a hex float, or a decimal +// one; rest is what it did not consume, and n == 0 is no number (rest is +// then s). erange is ERANGE on overflow, where the result is ±HUGE_VAL; +// an underflow's ERANGE is not modeled, since tc tests errno only beside +// HUGE_VAL. +func cStrtod(s string) (v float64, rest string, erange bool) { + i := 0 + for i < len(s) && cIsSpace(s[i]) { + i++ + } + neg := false + if i < len(s) && (s[i] == '+' || s[i] == '-') { + neg = s[i] == '-' + i++ + } + body := s[i:] + lower := strings.ToLower(body) + sign := 1.0 + if neg { + sign = -1 + } + switch { + case strings.HasPrefix(lower, "infinity"): + return sign * math.Inf(1), body[len("infinity"):], false + case strings.HasPrefix(lower, "inf"): + return sign * math.Inf(1), body[len("inf"):], false + case strings.HasPrefix(lower, "nan"): + n := len("nan") + if j := strings.IndexByte(body[n:], ')'); n < len(body) && body[n] == '(' && j > 0 && + isNanChars(body[n+1:n+j]) { + n += j + 1 + } + return math.NaN(), body[n:], false + case strings.HasPrefix(lower, "0x"): + if f, n, ok, over := hexFloat(body[2:]); ok { + return sign * f, body[2+n:], over + } + // "0x" with no hex digit is the decimal 0, x left over. + return sign * 0, body[1:], false + } + n := decimalPrefix(body) + if n == 0 { + return 0, s, false + } + f, err := strconv.ParseFloat(body[:n], 64) + if err != nil && math.IsInf(f, 0) { + erange = true + } + return sign * f, body[n:], erange +} + +// isNanChars is the n-char-sequence nan's parentheses may hold. +func isNanChars(s string) bool { + for i := 0; i < len(s); i++ { + c := s[i] + if c != '_' && (c < '0' || c > '9') && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z') { + return false + } + } + return true +} + +// decimalPrefix is how much of s strtod reads as a decimal float: digits +// with an optional '.', at least one digit, and an exponent only if digits +// follow its 'e'. +func decimalPrefix(s string) int { + i, digits := 0, 0 + for i < len(s) && s[i] >= '0' && s[i] <= '9' { + i++ + digits++ + } + if i < len(s) && s[i] == '.' { + i++ + for i < len(s) && s[i] >= '0' && s[i] <= '9' { + i++ + digits++ + } + } + if digits == 0 { + return 0 + } + return i + exponent(s[i:], 'e') +} + +// exponent is the length of an exponent marked by mark (e or p) at the +// head of s, or 0 if no digit follows it. +func exponent(s string, mark byte) int { + if s == "" || s[0]|0x20 != mark { + return 0 + } + j := 1 + if j < len(s) && (s[j] == '+' || s[j] == '-') { + j++ + } + k := j + for k < len(s) && s[k] >= '0' && s[k] <= '9' { + k++ + } + if k == j { + return 0 + } + return k +} + +// hexFloat reads the hex digits, optional '.', and optional p exponent +// after "0x"; n is the bytes read, and over is an overflow to ±Inf +// (strtod's ERANGE, as the decimal path reports it). +func hexFloat(s string) (v float64, n int, ok, over bool) { + i, digits := 0, 0 + isHex := func(c byte) bool { return c >= '0' && c <= '9' || c|0x20 >= 'a' && c|0x20 <= 'f' } + for i < len(s) && isHex(s[i]) { + i++ + digits++ + } + if i < len(s) && s[i] == '.' { + i++ + for i < len(s) && isHex(s[i]) { + i++ + digits++ + } + } + if digits == 0 { + return 0, 0, false, false + } + mant := s[:i] + e := exponent(s[i:], 'p') + exp := "p0" + if e > 0 { + exp = s[i : i+e] + } + f, err := strconv.ParseFloat("0x"+mant+exp, 64) + if err != nil && !math.IsInf(f, 0) { + return 0, 0, false, false + } + return f, i + e, true, err != nil +} + +// rateSuffix is utils_math.c's suffixes, in its order (strcasecmp, so +// "Kibit" and "kibit" are one). +var rateSuffix = []struct { + name string + scale float64 +}{ + {"bit", 1}, {"Kibit", 1024}, {"kbit", 1000}, {"mibit", 1024 * 1024}, {"mbit", 1000000}, + {"gibit", 1024 * 1024 * 1024}, {"gbit", 1000000000}, {"tibit", 1024 * 1024 * 1024 * 1024}, + {"tbit", 1000000000000}, {"Bps", 8}, {"KiBps", 8 * 1024}, {"KBps", 8000}, + {"MiBps", 8 * 1024 * 1024}, {"MBps", 8000000}, {"GiBps", 8 * 1024 * 1024 * 1024}, {"GBps", 8000000000}, + {"TiBps", 8 * 1024 * 1024 * 1024 * 1024}, {"TBps", 8000000000000}, +} + +// rateBytes is get_rate's and get_rate64's shared head: the number, its +// suffix, and the division to bytes per second. +func rateBytes(s string) (float64, bool) { + bps, p, erange := cStrtod(s) + if p == s || bps < 0 || (math.IsInf(bps, 1) && erange) { + return 0, false + } + for _, sf := range rateSuffix { + if strings.EqualFold(sf.name, p) { + bps *= sf.scale + p = "" + break + } + } + if p != "" { + return 0, false + } + return bps / 8, true +} + +// getRate is get_rate: bytes per second in 32 bits, refused when the +// conversion does not equal floor(bps). +func getRate(s string) (uint32, bool) { + bps, ok := rateBytes(s) + if !ok { + return 0, false + } + r := cDoubleToU32(bps) + if float64(r) != math.Floor(bps) { + return 0, false + } + return r, true +} + +// getRate64 is get_rate64: no overflow check, so inf is 0 and nan is +// 0x8000000000000000 (W12). +func getRate64(s string) (uint64, bool) { + bps, ok := rateBytes(s) + if !ok { + return 0, false + } + return cDoubleToU64(bps), true +} + +// getSize64 is get_size64: the k, m, g and their bit forms are powers of +// 1024; the result must equal floor(sz). +func getSize64(s string) (uint64, bool) { + sz, p, erange := cStrtod(s) + if p == s || sz < 0 || (math.IsInf(sz, 1) && erange) { + return 0, false + } + if p != "" { + switch strings.ToLower(p) { + case "kb", "k": + sz *= 1024 + case "gb", "g": + sz *= 1024 * 1024 * 1024 + case "gbit": + sz *= 1024 * 1024 * 1024 / 8 + case "mb", "m": + sz *= 1024 * 1024 + case "mbit": + sz *= 1024 * 1024 / 8 + case "kbit": + sz *= 1024 / 8 + case "b": + default: + return 0, false + } + } + v := cDoubleToU64(sz) + if float64(v) != math.Floor(sz) { + return 0, false + } + return v, true +} + +// getSize is get_size: get_size64 within 32 bits. +func getSize(s string) (uint32, bool) { + v, ok := getSize64(s) + if !ok || v > math.MaxUint32 { + return 0, false + } + return cint.Low32(v), true +} + +// getTime is get_time: microseconds in 32 bits, with no overflow check, +// so 5000s wraps and inf or nan is 0 (W12). +func getTime(s string) (uint32, bool) { + t, p, erange := cStrtod(s) + if p == s || t < 0 || (math.IsInf(t, 1) && erange) { + return 0, false + } + if p != "" { + switch strings.ToLower(p) { + case "s", "sec", "secs": + t *= timeUnitsPerSec + case "ms", "msec", "msecs": + t *= timeUnitsPerSec / 1000 + case "us", "usec", "usecs": + t *= timeUnitsPerSec / 1000000 + default: + return 0, false + } + } + return cDoubleToU32(t), true +} + +// getTime64 is get_time64: nanoseconds, as an __s64. +func getTime64(s string) (int64, bool) { + ns, p, erange := cStrtod(s) + if p == s || ns < 0 || (math.IsInf(ns, 1) && erange) { + return 0, false + } + if p != "" { + switch strings.ToLower(p) { + case "s", "sec", "secs": + ns *= nsecPerSec + case "ms", "msec", "msecs": + ns *= nsecPerMsec + case "us", "usec", "usecs": + ns *= nsecPerUsec + case "ns", "nsec", "nsecs": + default: + return 0, false + } + } + return cDoubleToI64(ns), true +} + +// getSize64AndCell is get_size64_and_cell: SIZE[/CELL], CELL a power of +// two below 2^32 whose log is cellLog; cellLog is untouched without one. +func getSize64AndCell(s string, cellLog *int) (uint64, bool) { + sz, cell, slash := strings.Cut(s, "/") + v, ok := getSize64(sz) + if !ok { + return 0, false + } + if slash { + c, ok := getInteger(cell, 0) + if !ok { + return 0, false + } + for i := range 32 { + if cint.Int(uint32(1)< math.MaxUint32 { + return 0, false + } + return cint.Low32(v), true +} + +// Link layers: enum link_layer (tc_core.h). +const ( + linklayerUnspec = 0 + linklayerEthernet = 1 + linklayerATM = 2 +) + +// getLinklayer is get_linklayer, by matches(): adsl is atm. +func getLinklayer(arg string) (uint32, bool) { + switch { + case matches(arg, "ethernet"): + return linklayerEthernet, true + case matches(arg, "atm"), matches(arg, "adsl"): + return linklayerATM, true + } + return 0, false +} + +// parsePercent is parse_percent: 0 ok, -1 error, 1 out of range; the +// range is tested before the suffix. +func parsePercent(s string) (float64, int) { + v, p, _ := cStrtod(s) + v /= 100 + if v > 1.0 || v < 0.0 { + return v, 1 + } + if p != "" && p != "%" { + return v, -1 + } + return v, 0 +} + +// time2tick is tc_core_time2tick. +func (c tcCore) time2tick(t float64) float64 { return t * c.tickInUsec } + +// calcXmittime is tc_calc_xmittime: ceil of the ticks size bytes take at +// rate, capped at UINT_MAX. +func (c tcCore) calcXmittime(rate, size uint64) uint32 { + v := math.Ceil(c.time2tick(timeUnitsPerSec * (float64(size) / float64(rate)))) + if v > math.MaxUint32 { + return math.MaxUint32 + } + return cDoubleToU32(v) +} + +// ATM cells: linux/atm.h. +const ( + atmCellPayload = 48 + atmCellSize = 53 +) + +// adjustSize is tc_adjust_size: at least mpu, then whole ATM cells. +func adjustSize(sz, mpu uint32, linklayer uint32) uint32 { + if sz < mpu { + sz = mpu + } + if linklayer == linklayerATM { + cells := sz / atmCellPayload + if sz%atmCellPayload > 0 { + cells++ + } + return cint.Bits(cint.Int(cells) * atmCellSize) // int linksize; the product wraps + } + return sz +} + +// calcRtable is tc_calc_rtable_64 (tc_calc_rtable is it with the spec's +// own rate): fills rtab, and sets the spec's cell_align, cell_log and +// linklayer. A cellLog below 0 is the smallest that fits mtu (2047 when +// 0) in 256 cells. +func (c tcCore) calcRtable(r *rateSpec, rtab *[256]uint32, cellLog int, mtu uint32, linklayer uint32, rate uint64) int { + if mtu == 0 { + mtu = 2047 + } + if cellLog < 0 { + cellLog = 0 + for (mtu >> cellLog) > 255 { + cellLog++ + } + } + for i := range 256 { + sz := adjustSize(shl32(cint.Bits(int32(i+1)), cellLog), uint32(r.mpu), linklayer) + rtab[i] = c.calcXmittime(rate, uint64(sz)) + } + r.cellAlign = -1 + r.cellLog = uint8(cint.Bits(int32(cellLog)) & 0xff) + r.linklayer = uint8(linklayer & tcLinklayerMask) + return cellLog +} + +// shl32 is a 32-bit C shift on x86: the count is taken mod 32. +func shl32(v uint32, n int) uint32 { return v << (uint(n) & 31) } + +// shr32 is the same for a right shift. +func shr32(v uint32, n int) uint32 { return v >> (uint(n) & 31) } + +// rateSpec is struct tc_ratespec as tc fills it. +type rateSpec struct { + cellLog uint8 + linklayer uint8 + overhead uint16 + cellAlign int16 + mpu uint16 + rate uint32 +} + +// sizeSpec is struct tc_sizespec. +type sizeSpec struct { + cellLog uint8 + sizeLog uint8 + cellAlign int16 + overhead int32 + linklayer uint32 + mpu uint32 + mtu uint32 + tsize uint32 +} + +// stabHangLimit is where tc_calc_size_table's cell_log loop would wrap: +// with tsize 1 it never ends (W13), which gotc refuses rather than hang. +const stabHangLimit = 32 + +// calcSizeTable is tc_calc_size_table; ok false is the loop that never +// ends (tsize 1: mtu >> cell_log is never 0 once the count wraps). +func calcSizeTable(s *sizeSpec) (stab []uint16, ok bool) { + if s.linklayer <= linklayerEthernet && s.mpu == 0 { + s.mtu, s.tsize, s.cellLog, s.cellAlign = 0, 0, 0, 0 + return nil, true + } + if s.mtu == 0 { + s.mtu = 2047 + } + if s.tsize == 0 { + s.tsize = 512 + } + cl := 0 + for shr32(s.mtu, cl) > s.tsize-1 { + cl++ + if cl >= stabHangLimit { + return nil, false + } + } + s.cellLog = uint8(cint.Bits(int32(cl)) & 0xff) + stab = make([]uint16, s.tsize) +again: + for i := len(stab) - 1; i >= 0; i-- { + sz := adjustSize(shl32(cint.Bits(int32(i+1)), int(s.cellLog)), s.mpu, s.linklayer) + if shr32(sz, int(s.sizeLog)) > math.MaxUint16 { + s.sizeLog++ + goto again + } + stab[i] = uint16(shr32(sz, int(s.sizeLog)) & math.MaxUint16) + } + s.cellAlign = -1 + return stab, true +} + +// estimator is struct tc_estimator. +type estimator struct { + interval int8 + ewmaLog uint8 +} + +// setupEstimator is tc_setup_estimator: the interval as a power of two of +// a quarter second (-2 to 3), then the EWMA log for time_const. +func setupEstimator(a, timeConst uint32, est *estimator) bool { + var iv int + for iv = 0; iv <= 5; iv++ { + if uint64(a) <= uint64(1)< 5 { + return false + } + est.interval = int8(iv - 2) // -2..3 + var el int + for el = 1; el < 32; el++ { + w := 1.0 - 1.0/float64(cint.Int(uint32(1)< float64(timeConst) { + break + } + } + el-- + est.ewmaLog = uint8(el & 0xff) + return el != 0 && el < 31 +} + +// getInteger is lib/utils.c get_integer: strtol in base, nothing left +// over, no ERANGE, within an int. +func getInteger(s string, base uint64) (int32, bool) { + t := strings.TrimLeft(s, " \t\n\v\f\r") + neg := false + if t != "" && (t[0] == '+' || t[0] == '-') { + neg, t = t[0] == '-', t[1:] + } + if t == "" || t[0] == '+' || t[0] == '-' || cIsSpace(t[0]) { + return 0, false + } + mag, rest, ok, over := strtoulOver(t, base) + switch { + case !ok || rest != "" || over: + return 0, false + case neg && mag <= 1<<31: + return cint.Int(cint.Low32(-mag)), true + case !neg && mag <= math.MaxInt32: + return cint.Int(cint.Low32(mag)), true + } + return 0, false +} + +// cDoubleToI64 is C's (__s64) of a double on x86-64: cvttsd2si, whose +// out-of-range and NaN result is INT64_MIN. +func cDoubleToI64(v float64) int64 { + if math.IsNaN(v) || v >= 1<<63 || v < -(1<<63) { + return math.MinInt64 + } + return int64(v) +} diff --git a/internal/gotc/units_test.go b/internal/gotc/units_test.go new file mode 100644 index 000000000..7dcb7c921 --- /dev/null +++ b/internal/gotc/units_test.go @@ -0,0 +1,251 @@ +//go:build gotc_write + +package gotc + +import ( + "fmt" + "math" + "testing" +) + +// The expected values below are iproute2 v7.2.0's own lib/utils_math.c, +// get_time, tc/tc_core.c and tc/tc_estimator.c, built with gcc -O2 into a +// harness and run on each input. + +// TestTcUnits is the units parsers against tc's results (17P). +// +// go test -tags gotc_write ./internal/gotc/ -run TestTcUnits +func TestTcUnits(t *testing.T) { + type res struct { + v uint64 + ok bool + } + tests := []struct { + description string + fn string // rate rate64 size size64 time + in string + expected res + }{ + // Positive: each suffix. + {"positive: bit", "rate", "8bit", res{1, true}}, + {"positive: kbit", "rate", "1kbit", res{125, true}}, + {"positive: Kibit", "rate", "1Kibit", res{128, true}}, + {"positive: suffix case", "rate", "1KIBIT", res{128, true}}, + {"positive: mbit", "rate", "1mbit", res{125000, true}}, + {"positive: Mbps", "rate", "1Mbps", res{1000000, true}}, + {"positive: gbit", "rate", "1gbit", res{125000000, true}}, + {"positive: leading space", "rate", " 8bit", res{1, true}}, + {"positive: rate64 tbit", "rate64", "1tbit", res{125000000000, true}}, + {"positive: rate64 TBps", "rate64", "100TBps", res{100000000000000, true}}, + {"positive: size bare", "size", "1", res{1, true}}, + {"positive: size k", "size", "1k", res{1024, true}}, + {"positive: size kb", "size", "1kb", res{1024, true}}, + {"positive: size m", "size", "1m", res{1048576, true}}, + {"positive: size g", "size", "1gb", res{1073741824, true}}, + {"positive: size kbit", "size", "1kbit", res{128, true}}, + {"positive: size mbit", "size", "1mbit", res{131072, true}}, + {"positive: size gbit", "size", "1gbit", res{134217728, true}}, + {"positive: size b", "size", "1b", res{1, true}}, + {"positive: size64 4g", "size64", "4g", res{4294967296, true}}, + {"positive: time bare", "time", "1", res{1, true}}, + {"positive: time ms", "time", "1ms", res{1000, true}}, + {"positive: time s", "time", "1s", res{1000000, true}}, + {"positive: time secs", "time", "1secs", res{1000000, true}}, + {"positive: time msec", "time", "1msec", res{1000, true}}, + // Negative. + {"negative: empty rate", "rate", "", res{0, false}}, + {"negative: bad suffix", "rate", "1foo", res{0, false}}, + {"negative: negative rate", "rate", "-1", res{0, false}}, + {"negative: rate inf", "rate", "inf", res{0, false}}, + {"negative: rate nan", "rate", "nan", res{0, false}}, + {"negative: rate overflow", "rate", "1e400bit", res{0, false}}, + {"negative: hex float eats the b", "rate", "0x10bit", res{0, false}}, + {"negative: size x", "size", "1x", res{0, false}}, + {"negative: size -1", "size", "-1", res{0, false}}, + {"negative: size inf", "size", "inf", res{0, false}}, + {"negative: size nan", "size", "nan", res{0, false}}, + {"negative: time -1", "time", "-1", res{0, false}}, + {"negative: time min", "time", "1min", res{0, false}}, + // Boundary. + {"boundary: rate at 2^32-1", "rate", "34359738360bit", res{4294967295, true}}, + {"boundary: rate at 2^32", "rate", "34359738368bit", res{0, false}}, + {"boundary: rate tbit past 32 bits", "rate", "1tbit", res{0, false}}, + {"boundary: size at 2^32-1", "size", "4294967295", res{4294967295, true}}, + {"boundary: size 4g", "size", "4g", res{0, false}}, + {"boundary: size64 1e19", "size64", "1e19", res{10000000000000000000, true}}, + {"boundary: size64 2e19", "size64", "2e19", res{0, false}}, + {"boundary: time 2^32-1", "time", "4294.967295s", res{4294967295, true}}, + {"boundary: time 2^32 wraps", "time", "4294.967296s", res{0, true}}, + // Corner: rounding and the unchecked conversions (W12). + {"corner: 1.5kbit truncates", "rate", "1.5kbit", res{187, true}}, + {"corner: size 1.5k", "size", "1.5k", res{1536, true}}, + {"corner: size 0.5 truncates", "size", "0.5", res{0, true}}, + {"corner: time 0.1ms", "time", "0.1ms", res{100, true}}, + {"corner: time 1.5us", "time", "1.5us", res{1, true}}, + {"corner: time 5000s wraps", "time", "5000s", res{705032704, true}}, + {"corner: time inf is 0", "time", "inf", res{0, true}}, + {"corner: time nan is 0", "time", "nan", res{0, true}}, + {"corner: rate64 inf is 0", "rate64", "inf", res{0, true}}, + {"corner: rate64 nan", "rate64", "nan", res{0x8000000000000000, true}}, + {"corner: rate64 past 2^64 is 0", "rate64", "1e30bit", res{0, true}}, + {"corner: size64 inf", "size64", "inf", res{0, false}}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + var got res + switch tc.fn { + case "rate": + v, ok := getRate(tc.in) + got = res{uint64(v), ok} + case "rate64": + got.v, got.ok = getRate64(tc.in) + case "size": + v, ok := getSize(tc.in) + got = res{uint64(v), ok} + case "size64": + got.v, got.ok = getSize64(tc.in) + case "time": + v, ok := getTime(tc.in) + got = res{uint64(v), ok} + } + if !got.ok { + got.v = 0 + } + if got != tc.expected { + t.Errorf("%s(%q) = %+v, want %+v", tc.fn, tc.in, got, tc.expected) + } + }) + } +} + +// TestCStrtod is glibc's strtod prefixes. +func TestCStrtod(t *testing.T) { + tests := []struct { + description string + in string + expected string // value|rest|erange + }{ + {"positive: decimal", "1.5k", "1.5|k|false"}, + {"positive: exponent", "1e3x", "1000|x|false"}, + {"positive: hex", "0x10", "16|false"}, + {"positive: hex float", "0x1p4", "16||false"}, + {"positive: leading space and sign", " -2", "-2||false"}, + {"negative: no number", "abc", "0|abc|false"}, + {"negative: bare sign", "-", "0|-|false"}, + {"boundary: overflow", "1e400", "+Inf||true"}, + {"boundary: e with no digits", "1e", "1|e|false"}, + {"boundary: hex overflow is ERANGE", "0x1p1024", "+Inf||true"}, + {"boundary: negative hex overflow is ERANGE", "-0x1p1024", "-Inf||true"}, + {"boundary: largest hex power is no overflow", "0x1p1023", "8.98846567431158e+307||false"}, + {"corner: inf", "inf", "+Inf||false"}, + {"corner: infinity", "Infinity", "+Inf||false"}, + {"corner: nan with chars", "nan(x1)y", "NaN|y|false"}, + {"corner: 0x with no digit", "0xg", "0|xg|false"}, + {"corner: hex eats b", "0x10bit", "267|it|false"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + v, rest, er := cStrtod(tc.in) + got := fmt.Sprintf("%v|%s|%t", v, rest, er) + if tc.expected == "16|false" { + tc.expected = "16||false" + } + if got != tc.expected { + t.Errorf("cStrtod(%q) = %s, want %s", tc.in, got, tc.expected) + } + }) + } +} + +// TestTcEstimatorTables is tc_setup_estimator, tc_calc_rtable and +// tc_calc_size_table against tc's results. +func TestTcEstimatorTables(t *testing.T) { + est := []struct { + description string + a, tc uint32 + expected string // ok interval ewma + }{ + {"positive: est 1s 8s", 1000000, 8000000, "true 0 3"}, + {"positive: est 250ms 1s", 250000, 1000000, "true -2 2"}, + {"positive: est 125ms 1s", 125000, 1000000, "true -2 3"}, + {"boundary: est 8s 64s", 8000000, 64000000, "true 3 3"}, + {"negative: interval past 8s", 9000000, 1, "false"}, + {"negative: ewma log 0", 1, 1, "false"}, + } + for _, tc := range est { + t.Run(tc.description, func(t *testing.T) { + var e estimator + ok := setupEstimator(tc.a, tc.tc, &e) + got := fmt.Sprintf("%t %d %d", ok, e.interval, e.ewmaLog) + if !ok { + got = "false" + } + if got != tc.expected { + t.Errorf("got %s, want %s", got, tc.expected) + } + }) + } + + core := tcCore{clockFactor: 1, tickInUsec: 1} + rt := []struct { + description string + rate uint32 + mpu uint16 + cellLog int + mtu, ll uint32 + expected string // cl, rtab[0], rtab[37], rtab[255] + }{ + {"positive: 1mbit", 125000, 0, -1, 0, 0, "3 64 2432 16384"}, + {"positive: mpu, mtu, atm", 125000, 64, -1, 1600, linklayerATM, "3 848 2968 18232"}, + {"boundary: rate 1", 1, 0, 3, 0, linklayerEthernet, "3 8000000 304000000 2048000000"}, + {"boundary: rate 0 caps at UINT_MAX", 0, 0, -1, 0, 0, "3 4294967295 4294967295 4294967295"}, + {"corner: mtu 9000", math.MaxUint32, 0, -1, 9000, 0, "6 1 1 4"}, + } + for _, tc := range rt { + t.Run(tc.description, func(t *testing.T) { + r := rateSpec{rate: tc.rate, mpu: tc.mpu} + var tab [256]uint32 + cl := core.calcRtable(&r, &tab, tc.cellLog, tc.mtu, tc.ll, uint64(r.rate)) + got := fmt.Sprintf("%d %d %d %d", cl, tab[0], tab[37], tab[255]) + if got != tc.expected || r.cellAlign != -1 || int(r.cellLog) != cl { + t.Errorf("got %s (align %d log %d), want %s", got, r.cellAlign, r.cellLog, tc.expected) + } + }) + } + + st := []struct { + description string + mtu, tsize, mpu, ll uint32 + expected string // cl sl align mtu tsize d0 d1 dlast + }{ + {"positive: overhead only, no table", 0, 0, 0, 0, "0 0 0 0 0"}, + {"positive: atm defaults", 0, 0, 0, linklayerATM, "2 0 -1 2047 512 53 53 2279"}, + {"positive: atm mtu tsize mpu", 2048, 128, 64, linklayerATM, "5 0 -1 2048 128 106 106 4558"}, + {"positive: ethernet with mpu", 0, 0, 64, linklayerEthernet, "2 0 -1 2047 512 64 64 2048"}, + {"boundary: size_log grows", 100000, 2, 0, linklayerATM, "16 2 -1 100000 2 18099 36185 36185"}, + {"boundary: a large table", 70000, 70000, 0, linklayerATM, "1 2 -1 70000 70000 13 13 38650"}, + {"boundary: tsize 1", 0, 1, 0, linklayerATM, "11 0 -1 2047 1 2279 2279"}, + {"boundary: tsize 1 mtu 2^31-1", math.MaxInt32, 1, 0, linklayerATM, "31 16 -1 2147483647 1 36181 36181"}, + {"corner: tsize 1 mtu 2^31 never ends (W13)", 1 << 31, 1, 0, linklayerATM, "hang"}, + } + for _, tc := range st { + t.Run(tc.description, func(t *testing.T) { + s := sizeSpec{mtu: tc.mtu, tsize: tc.tsize, mpu: tc.mpu, linklayer: tc.ll} + d, ok := calcSizeTable(&s) + got := "hang" + if ok { + got = fmt.Sprintf("%d %d %d %d %d", s.cellLog, s.sizeLog, s.cellAlign, s.mtu, s.tsize) + if d != nil { + if len(d) > 1 { + got += fmt.Sprintf(" %d %d %d", d[0], d[1], d[len(d)-1]) + } else { + got += fmt.Sprintf(" %d %d", d[0], d[len(d)-1]) + } + } + } + if got != tc.expected { + t.Errorf("got %s, want %s", got, tc.expected) + } + }) + } +} diff --git a/internal/gotc/util.go b/internal/gotc/util.go index ff745431e..f0fa28988 100644 --- a/internal/gotc/util.go +++ b/internal/gotc/util.go @@ -145,20 +145,20 @@ func (r *runner) xmitsize(rate uint64, ticks uint32) uint64 { func (c tcCore) tick2time(tick float64) float64 { return tick / c.tickInUsec } // cDoubleToU64 is C's (__u64) of a double on x86-64: truncation toward -// zero; out of range (NaN, negative, too big) gives what cvttsd2si does, -// 0x8000000000000000 for the big ones above 2^63. +// zero, as gcc emits it. Below 2^63 it goes through cvttsd2si 64-bit +// signed (so -1 gives 0xffff...ffff, and NaN or <= -2^63 gives +// 0x8000000000000000). [2^63, 2^64) subtracts 2^63 first, and 2^64 or more +// (+Inf too) gives 0. Checked against a gcc -O2 probe. func cDoubleToU64(v float64) uint64 { switch { - case math.IsNaN(v) || v <= -1: + case math.IsNaN(v) || v <= -(1<<63): return 0x8000000000000000 - case v < 0: - return 0 case v < 1<<63: - return uint64(v) + return uint64(int64(v)) case v < 1<<64: - return uint64(v-(1<<63)) + 1<<63 + return uint64(v) } - return 0x8000000000000000 + return 0 } // cDoubleToU32 is C's (unsigned int) of a double on x86-64: through the diff --git a/internal/tnlsys/live_linux.go b/internal/tnlsys/live_linux.go index f440723b7..e14866b0d 100644 --- a/internal/tnlsys/live_linux.go +++ b/internal/tnlsys/live_linux.go @@ -12,9 +12,9 @@ import ( "golang.org/x/sys/unix" ) -// spillFill is what Live fills the bytes past an argument with, so a +// SpillFill is what Live fills the bytes past an argument with, so a // kernel write there shows. -const spillFill = 0xA5 +const SpillFill = 0xA5 // tunDev is TUNDEV, the path a tun descriptor's /proc link reads. const tunDev = "/dev/net/tun" @@ -30,7 +30,7 @@ type Live struct { // 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 + name [IfNameSize]byte data unsafe.Pointer padding [8 + unsafe.Sizeof(uintptr(0))]byte } @@ -40,7 +40,7 @@ type ifreqData struct { // 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 { + if !KnownReq(req) || len(arg) == 0 || len(arg) > MaxArg { return nil, ErrRequest } fd, err := unix.Socket(family, unix.SOCK_DGRAM|unix.SOCK_CLOEXEC, 0) @@ -55,7 +55,7 @@ func (l Live) Ioctl(family int, req uint32, name string, arg []byte) (spill []by buf := make([]byte, len(arg)+SpillWindow) copy(buf, arg) for i := len(arg); i < len(buf); i++ { - buf[i] = spillFill + buf[i] = SpillFill } var ifr ifreqData copy(ifr.name[:], IfName(name)) @@ -66,17 +66,17 @@ func (l Live) Ioctl(family int, req uint32, name string, arg []byte) (spill []by return nil, errno } copy(arg, buf) - return spillOf(buf[len(arg):]), nil + 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 +// 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 { +// 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 { + if w[i] != SpillFill { return append([]byte(nil), w[:i+1]...) } } diff --git a/internal/tnlsys/tnlsys.go b/internal/tnlsys/tnlsys.go index 19366c5fc..859812c37 100644 --- a/internal/tnlsys/tnlsys.go +++ b/internal/tnlsys/tnlsys.go @@ -56,12 +56,12 @@ const ( // 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 +// MaxArg bounds an ioctl argument: a SIOCGETPRL buffer is 16 bytes per // router, and `ip` asks for 16. -const maxArg = 64 << 10 +const MaxArg = 64 << 10 -// ifNameSize is IFNAMSIZ. -const ifNameSize = 16 +// 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 @@ -129,8 +129,8 @@ func reqByName(s string) (uint32, bool) { return 0, false } -// knownReq is whether req is one of the three gets. -func knownReq(req uint32) bool { +// KnownReq is whether req is one of the three gets. +func KnownReq(req uint32) bool { _, ok := reqByName(ReqName(req)) return ok } @@ -141,8 +141,8 @@ 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] + if len(name) > IfNameSize-1 { + name = name[:IfNameSize-1] } return name } diff --git a/internal/tnlsys/tnlsys_test.go b/internal/tnlsys/tnlsys_test.go index a78dfbe1b..73ef99f56 100644 --- a/internal/tnlsys/tnlsys_test.go +++ b/internal/tnlsys/tnlsys_test.go @@ -2,11 +2,9 @@ package tnlsys import ( "bytes" - "encoding/hex" "errors" "fmt" "os" - "os/exec" "path/filepath" "slices" "strings" @@ -15,31 +13,6 @@ import ( "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") @@ -318,7 +291,7 @@ func TestLiveIoctl(t *testing.T) { {"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}, + {"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 { @@ -340,24 +313,24 @@ func TestLiveIoctl(t *testing.T) { } func TestSpillOf(t *testing.T) { - fill := bytes.Repeat([]byte{spillFill}, 4) + 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: 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}}, + {"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) + if got := SpillOf(tc.window); !bytes.Equal(got, tc.want) { + t.Errorf("SpillOf = %x, want %x", got, tc.want) } }) } @@ -480,58 +453,6 @@ func TestLiveTunFDs(t *testing.T) { }) } -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() diff --git a/internal/tnlsys/trace/doc.go b/internal/tnlsys/trace/doc.go new file mode 100644 index 000000000..ab73ebb56 --- /dev/null +++ b/internal/tnlsys/trace/doc.go @@ -0,0 +1,5 @@ +// Package trace runs a command under ptrace and records the tunnel ioctls +// it makes, as tnlsys snapshots. It is apart from tnlsys so that importers +// of tnlsys (goip, and through it the daemons) do not link os/exec; only +// cmd/tnlsnap imports it. +package trace diff --git a/internal/tnlsys/trace_linux_amd64.go b/internal/tnlsys/trace/trace_linux_amd64.go similarity index 91% rename from internal/tnlsys/trace_linux_amd64.go rename to internal/tnlsys/trace/trace_linux_amd64.go index c9ccd846c..005e6484a 100644 --- a/internal/tnlsys/trace_linux_amd64.go +++ b/internal/tnlsys/trace/trace_linux_amd64.go @@ -1,4 +1,4 @@ -package tnlsys +package trace import ( "bytes" @@ -11,6 +11,7 @@ import ( "runtime" "syscall" + "github.com/randomizedcoder/xtcp2/internal/tnlsys" "github.com/randomizedcoder/xtcp2/pkg/cint" "golang.org/x/sys/unix" ) @@ -31,10 +32,10 @@ const syscallStop = syscall.SIGTRAP | 0x80 // 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) { +func Trace(cmd *exec.Cmd) (*tnlsys.Run, []tnlsys.IoctlRec, error) { type result struct { - run *Run - recs []IoctlRec + run *tnlsys.Run + recs []tnlsys.IoctlRec err error } ch := make(chan result, 1) @@ -51,7 +52,7 @@ func Trace(cmd *exec.Cmd) (*Run, []IoctlRec, error) { return res.run, res.recs, res.err } -func trace(cmd *exec.Cmd) (*Run, []IoctlRec, error) { +func trace(cmd *exec.Cmd) (*tnlsys.Run, []tnlsys.IoctlRec, error) { outR, outW, err := os.Pipe() if err != nil { return nil, nil, fmt.Errorf("tnlsys: trace: %w", err) @@ -72,7 +73,7 @@ func trace(cmd *exec.Cmd) (*Run, []IoctlRec, error) { 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)} + run := &tnlsys.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 } @@ -104,7 +105,7 @@ func joinClose(err error, fs ...*os.File) error { type tracer struct { pid int fam map[int]int // descriptor -> socket(2) domain, process-wide - recs []IoctlRec + recs []tnlsys.IoctlRec thr map[int]*thread } @@ -124,7 +125,7 @@ type pendingIoctl struct { name string arg uintptr size int - in []byte // size + SpillWindow bytes + in []byte // size + tnlsys.SpillWindow bytes } // run steps the tracee's threads from syscall stop to syscall stop until @@ -224,7 +225,7 @@ func (t *tracer) entry(th *thread, tid int, regs *unix.PtraceRegs) error { th.sockDom = int(cint.Low32(regs.Rdi)) case unix.SYS_IOCTL: req := cint.Low32(regs.Rsi) - if !knownReq(req) { + if !tnlsys.KnownReq(req) { return nil } return t.ioctlEntry(th, tid, int(cint.Low32(regs.Rdi)), req, uintptr(regs.Rdx)) @@ -239,28 +240,28 @@ func (t *tracer) ioctlEntry(th *thread, tid int, fd int, req uint32, ifrAddr uin } p := &pendingIoctl{ family: t.fam[fd], req: req, - name: IfName(string(ifr[:ifNameSize])), + name: tnlsys.IfName(string(ifr[:tnlsys.IfNameSize])), arg: uintptr(binary.LittleEndian.Uint64(ifr[ifrDataOff:])), } switch req { - case SIOCGETPRL: - hdr := make([]byte, TunnelPRLSize) + case tnlsys.SIOCGETPRL: + hdr := make([]byte, tnlsys.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) + p.size = min(tnlsys.TunnelPRLSize+datalen, tnlsys.MaxArg) default: - p.size = ArgSize(p.family, req) + p.size = tnlsys.ArgSize(p.family, req) } - p.in = make([]byte, p.size+SpillWindow) + p.in = make([]byte, p.size+tnlsys.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 { + if err := t.poke(tid, p.arg+uintptr(p.size), bytes.Repeat([]byte{tnlsys.SpillFill}, tnlsys.SpillWindow)); err != nil { return err } th.pend = p @@ -301,13 +302,13 @@ func (t *tracer) ioctlExit(tid int, p *pendingIoctl, errno unix.Errno) error { } // 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:]) + spill := tnlsys.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 + var s tnlsys.Snapshot if errno != 0 { s.AddIoctl(p.family, p.req, p.name, p.in[:p.size], nil, nil, errno) } else { diff --git a/internal/tnlsys/trace_linux_amd64_test.go b/internal/tnlsys/trace/trace_linux_amd64_test.go similarity index 93% rename from internal/tnlsys/trace_linux_amd64_test.go rename to internal/tnlsys/trace/trace_linux_amd64_test.go index feada609f..8775fe6d7 100644 --- a/internal/tnlsys/trace_linux_amd64_test.go +++ b/internal/tnlsys/trace/trace_linux_amd64_test.go @@ -1,4 +1,4 @@ -package tnlsys +package trace import ( "errors" @@ -12,7 +12,7 @@ import ( // stop: ESRCH, however wrapped, skips the thread; any other error stops // the trace. // -// go test ./internal/tnlsys/ -run TestThreadGone +// go test ./internal/tnlsys/trace/ -run TestThreadGone func TestThreadGone(t *testing.T) { tests := []struct { description string diff --git a/internal/tnlsys/trace_other.go b/internal/tnlsys/trace/trace_other.go similarity index 59% rename from internal/tnlsys/trace_other.go rename to internal/tnlsys/trace/trace_other.go index eb81a7ba8..3f6f5c577 100644 --- a/internal/tnlsys/trace_other.go +++ b/internal/tnlsys/trace/trace_other.go @@ -1,13 +1,15 @@ //go:build !(linux && amd64) -package tnlsys +package trace import ( "errors" "os/exec" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" ) // Trace reads syscall registers, which only the x86_64 tracer knows. -func Trace(cmd *exec.Cmd) (*Run, []IoctlRec, error) { +func Trace(cmd *exec.Cmd) (*tnlsys.Run, []tnlsys.IoctlRec, error) { return nil, nil, errors.New("tnlsys: trace: only linux/amd64") } diff --git a/internal/tnlsys/trace/trace_test.go b/internal/tnlsys/trace/trace_test.go new file mode 100644 index 000000000..c8846cef1 --- /dev/null +++ b/internal/tnlsys/trace/trace_test.go @@ -0,0 +1,92 @@ +package trace + +import ( + "encoding/hex" + "errors" + "fmt" + "os" + "os/exec" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/internal/tnlsys" + "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 tnlsys.Live + a := make([]byte, tnlsys.IPTunnelParmSize) + copy(a, "lo") + _, err1 := l.Ioctl(unix.AF_INET, tnlsys.SIOCGETTUNNEL, "lo", a) + b := make([]byte, tnlsys.Tunnel6RDSize) + _, err2 := l.Ioctl(unix.AF_INET, tnlsys.SIOCGET6RD, "nosuch0", b) + fmt.Printf("%v|%v\n", err1, err2) + fmt.Fprint(os.Stderr, "helper stderr") + return 3 +} + +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 := make([]byte, tnlsys.IPTunnelParmSize) + copy(in, "lo") + 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", tnlsys.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 []tnlsys.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 +} diff --git a/nix/checks/flavor-tags.nix b/nix/checks/flavor-tags.nix index 5373401dc..c84012895 100644 --- a/nix/checks/flavor-tags.nix +++ b/nix/checks/flavor-tags.nix @@ -62,6 +62,7 @@ pkgs.runCommand "xtcp2-flavor-tags" has_tag "$t" dest_file || { echo "FAIL: full flavor lacks dest_file (tags: $t)"; fail=1; } has_tag "$t" capture && { echo "FAIL: full flavor carries capture (tags: $t)"; fail=1; } has_tag "$t" goip_write && { echo "FAIL: full flavor carries goip_write (tags: $t)"; fail=1; } + has_tag "$t" gotc_write && { echo "FAIL: full flavor carries gotc_write (tags: $t)"; fail=1; } t=$(tags_of ${binaries.xtcp2-capture}) has_tag "$t" capture || { echo "FAIL: xtcp2-capture lacks capture (tags: $t)"; fail=1; } diff --git a/nix/checks/govulncheck.nix b/nix/checks/govulncheck.nix index f1fae6bf4..73465b27c 100644 --- a/nix/checks/govulncheck.nix +++ b/nix/checks/govulncheck.nix @@ -8,7 +8,7 @@ # does not call is reported but does not fail. # # Two passes: no build tags (the min flavor), and every destination, -# enrichment and goip_write tag, so code behind a tag is scanned too. +# enrichment, goip_write and gotc_write tag, so code behind a tag is scanned too. # # The snapshot ages; `nix run .#govulncheck-fresh` checks the working tree # against the live database, and moving the pin in nix/lib/govulndb.nix brings @@ -25,6 +25,7 @@ let map (d: "dest_${d}") versions.allLibraryDestinations ++ map (e: "enrich_${e}") versions.allEnrichmentFeatures ++ versions.goipWriteTags + ++ versions.gotcWriteTags ); # Reachable findings accepted for now, each with why and what removes it. diff --git a/nix/checks/no-write-encoders.nix b/nix/checks/no-write-encoders.nix index f5da36199..50c476433 100644 --- a/nix/checks/no-write-encoders.nix +++ b/nix/checks/no-write-encoders.nix @@ -2,7 +2,8 @@ # # The daemons, xtcp2 and go-link-monitor, must not be able to build a netlink # mutation: goip's write verbs and pkg/xtcpnl's write builders compile only -# with the goip_write tag, which cmd/goip and cmd/goip-parity alone carry. +# with the goip_write tag, which cmd/goip and cmd/goip-parity alone carry, and +# gotc's tc write builder only with gotc_write, which no daemon carries. # # One exemption: a build with the `treatment` tag embeds the route treatment # actuator (internal/goip/actuate), which encodes routes and rules. It may @@ -69,8 +70,8 @@ let ]; treatmentSyms = "pkg/xtcpnl[.](BuildWriteRequest|BuildRouteWriteRequest|BuildRuleWriteRequest)$"; - # The files goip_write gates, in the packages that hold them. - writePkgs = "^github.com/randomizedcoder/xtcp2/(internal/goip|pkg/xtcpnl|pkg/nlparity)$"; + # The files goip_write and gotc_write gate, in the packages that hold them. + writePkgs = "^github.com/randomizedcoder/xtcp2/(internal/goip|internal/gotc|pkg/xtcpnl|pkg/nlparity)$"; writeFiles = "(_write[a-z0-9_]*|_flush|_restore|link_property|stats_set)[.]go$"; # minio-go's process credential provider (the s3parquet destination) runs @@ -133,6 +134,9 @@ pkgs.runCommand "xtcp2-no-write-encoders" if [ "$(write_files ${d.pkg} "''${t:+$t,}goip_write" | wc -l)" -le "$(printf '%s' "$all" | grep -c . || true)" ]; then echo "FAIL: ${d.name} with goip_write names no further write file; the pattern is stale"; fail=1 fi + if [ "$(write_files ${d.pkg} "''${t:+$t,}gotc_write" | wc -l)" -le "$(printf '%s' "$all" | grep -c . || true)" ]; then + echo "FAIL: ${d.name} with gotc_write names no further write file; the pattern is stale"; fail=1 + fi ${lib.optionalString d.nm '' s=$(go tool nm ${d.bin} | grep -E '${writeSyms}' || true) diff --git a/nix/default.nix b/nix/default.nix index 12aa82537..a250a9ab0 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -406,6 +406,7 @@ let nix build --accept-flake-config \ "$FLAKE_REF#test-focused-asn-locality" \ "$FLAKE_REF#test-focused-goip" \ + "$FLAKE_REF#test-focused-gotc-write" \ "$FLAKE_REF#test-focused-gordma" \ "$FLAKE_REF#test-focused-xtcp-enrich" \ "$FLAKE_REF#test-focused-xtcp-treatment" @@ -1181,6 +1182,7 @@ in test-oci-link-monitor-env = tests.oci-link-monitor-env; test-focused-asn-locality = tests.focused.focused-asn-locality; test-focused-goip = tests.focused.focused-goip; + test-focused-gotc-write = tests.focused.focused-gotc-write; test-focused-gordma = tests.focused.focused-gordma; test-focused-xtcp-enrich = tests.focused.focused-xtcp-enrich; test-focused-xtcp-treatment = tests.focused.focused-xtcp-treatment; diff --git a/nix/microvms/workbench/tcqwrite.rows.jsonl b/nix/microvms/workbench/tcqwrite.rows.jsonl new file mode 100644 index 000000000..3939e9d85 --- /dev/null +++ b/nix/microvms/workbench/tcqwrite.rows.jsonl @@ -0,0 +1,128 @@ +# Generated by `nlcapgen matrix -family tcqwrite -seed 1 -random 0`. +# Do not edit; regenerate. tools/nlcapgen/matrix.go explains the strategies. +# 125 rows. +{"id":"tcqwrite/ec-001","desc":"positive: opt=plain cmd=pfifo0:qdisc_add_dev_d0_root_handle_1:_pfifo","cmd":"tc qdisc add dev d0 root handle 1: pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfifo0","json":"0","words":"qdisc add dev d0 root handle 1: pfifo"}} +{"id":"tcqwrite/ec-002","desc":"positive: opt=plain cmd=pfifo1:qdisc_add_dev_d0_root_handle_1:_pfifo_limit_100","cmd":"tc qdisc add dev d0 root handle 1: pfifo limit 100","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfifo1","json":"0","words":"qdisc add dev d0 root handle 1: pfifo limit 100"}} +{"id":"tcqwrite/ec-003","desc":"positive: opt=plain cmd=pfifo-change:qdisc_change_dev_d0_root_handle_1:_pfifo_limit_100","cmd":"tc qdisc change dev d0 root handle 1: pfifo limit 100","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfifo-change","json":"0","words":"qdisc change dev d0 root handle 1: pfifo limit 100"}} +{"id":"tcqwrite/ec-004","desc":"positive: opt=plain cmd=pfifo-replace:qdisc_replace_dev_d0_root_handle_1:_pfifo_limit_100","cmd":"tc qdisc replace dev d0 root handle 1: pfifo limit 100","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfifo-replace","json":"0","words":"qdisc replace dev d0 root handle 1: pfifo limit 100"}} +{"id":"tcqwrite/ec-005","desc":"corner: opt=plain cmd=pfifo-link:qdisc_link_dev_d0_root_handle_1:_pfifo_limit_100","cmd":"tc qdisc link dev d0 root handle 1: pfifo limit 100","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfifo-link","json":"0","words":"qdisc link dev d0 root handle 1: pfifo limit 100"}} +{"id":"tcqwrite/ec-006","desc":"positive: opt=plain cmd=pfifo-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfifo-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-007","desc":"positive: opt=plain cmd=bfifo0:qdisc_add_dev_d0_root_handle_1:_bfifo","cmd":"tc qdisc add dev d0 root handle 1: bfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bfifo0","json":"0","words":"qdisc add dev d0 root handle 1: bfifo"}} +{"id":"tcqwrite/ec-008","desc":"positive: opt=plain cmd=bfifo1:qdisc_add_dev_d0_root_handle_1:_bfifo_limit_10kb","cmd":"tc qdisc add dev d0 root handle 1: bfifo limit 10kb","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bfifo1","json":"0","words":"qdisc add dev d0 root handle 1: bfifo limit 10kb"}} +{"id":"tcqwrite/ec-009","desc":"positive: opt=plain cmd=bfifo-change:qdisc_change_dev_d0_root_handle_1:_bfifo_limit_10kb","cmd":"tc qdisc change dev d0 root handle 1: bfifo limit 10kb","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: bfifo"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bfifo-change","json":"0","words":"qdisc change dev d0 root handle 1: bfifo limit 10kb"}} +{"id":"tcqwrite/ec-010","desc":"positive: opt=plain cmd=bfifo-replace:qdisc_replace_dev_d0_root_handle_1:_bfifo_limit_10kb","cmd":"tc qdisc replace dev d0 root handle 1: bfifo limit 10kb","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: bfifo"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bfifo-replace","json":"0","words":"qdisc replace dev d0 root handle 1: bfifo limit 10kb"}} +{"id":"tcqwrite/ec-011","desc":"corner: opt=plain cmd=bfifo-link:qdisc_link_dev_d0_root_handle_1:_bfifo_limit_10kb","cmd":"tc qdisc link dev d0 root handle 1: bfifo limit 10kb","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: bfifo"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bfifo-link","json":"0","words":"qdisc link dev d0 root handle 1: bfifo limit 10kb"}} +{"id":"tcqwrite/ec-012","desc":"positive: opt=plain cmd=bfifo-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: bfifo"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"bfifo-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-013","desc":"positive: opt=plain cmd=phd0:qdisc_add_dev_d0_root_handle_1:_pfifo_head_drop_limit_50","cmd":"tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"phd0","json":"0","words":"qdisc add dev d0 root handle 1: pfifo_head_drop limit 50"}} +{"id":"tcqwrite/ec-014","desc":"positive: opt=plain cmd=phd-change:qdisc_change_dev_d0_root_handle_1:_pfifo_head_drop_limit_50","cmd":"tc qdisc change dev d0 root handle 1: pfifo_head_drop limit 50","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"phd-change","json":"0","words":"qdisc change dev d0 root handle 1: pfifo_head_drop limit 50"}} +{"id":"tcqwrite/ec-015","desc":"positive: opt=plain cmd=phd-replace:qdisc_replace_dev_d0_root_handle_1:_pfifo_head_drop_limit_50","cmd":"tc qdisc replace dev d0 root handle 1: pfifo_head_drop limit 50","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"phd-replace","json":"0","words":"qdisc replace dev d0 root handle 1: pfifo_head_drop limit 50"}} +{"id":"tcqwrite/ec-016","desc":"corner: opt=plain cmd=phd-link:qdisc_link_dev_d0_root_handle_1:_pfifo_head_drop_limit_50","cmd":"tc qdisc link dev d0 root handle 1: pfifo_head_drop limit 50","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"phd-link","json":"0","words":"qdisc link dev d0 root handle 1: pfifo_head_drop limit 50"}} +{"id":"tcqwrite/ec-017","desc":"positive: opt=plain cmd=phd-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"phd-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-018","desc":"positive: opt=plain cmd=prio0:qdisc_add_dev_d0_root_handle_1:_prio","cmd":"tc qdisc add dev d0 root handle 1: prio","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prio0","json":"0","words":"qdisc add dev d0 root handle 1: prio"}} +{"id":"tcqwrite/ec-019","desc":"positive: opt=plain cmd=prio1:qdisc_add_dev_d0_root_handle_1:_prio_bands_5","cmd":"tc qdisc add dev d0 root handle 1: prio bands 5","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prio1","json":"0","words":"qdisc add dev d0 root handle 1: prio bands 5"}} +{"id":"tcqwrite/ec-020","desc":"positive: opt=plain cmd=prio2:qdisc_add_dev_d0_root_handle_1:_prio_bands_3_priomap_0_1_2_2_1_2_0_0_1_1_1_1_1_1_1_1","cmd":"tc qdisc add dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prio2","json":"0","words":"qdisc add dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}} +{"id":"tcqwrite/ec-021","desc":"positive: opt=plain cmd=prio-change:qdisc_change_dev_d0_root_handle_1:_prio_bands_3_priomap_0_1_2_2_1_2_0_0_1_1_1_1_1_1_1_1","cmd":"tc qdisc change dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prio-change","json":"0","words":"qdisc change dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}} +{"id":"tcqwrite/ec-022","desc":"positive: opt=plain cmd=prio-replace:qdisc_replace_dev_d0_root_handle_1:_prio_bands_3_priomap_0_1_2_2_1_2_0_0_1_1_1_1_1_1_1_1","cmd":"tc qdisc replace dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prio-replace","json":"0","words":"qdisc replace dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}} +{"id":"tcqwrite/ec-023","desc":"corner: opt=plain cmd=prio-link:qdisc_link_dev_d0_root_handle_1:_prio_bands_3_priomap_0_1_2_2_1_2_0_0_1_1_1_1_1_1_1_1","cmd":"tc qdisc link dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prio-link","json":"0","words":"qdisc link dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}} +{"id":"tcqwrite/ec-024","desc":"positive: opt=plain cmd=prio-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"prio-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-025","desc":"positive: opt=plain cmd=pfast0:qdisc_add_dev_d0_root_handle_1:_pfifo_fast","cmd":"tc qdisc add dev d0 root handle 1: pfifo_fast","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfast0","json":"0","words":"qdisc add dev d0 root handle 1: pfifo_fast"}} +{"id":"tcqwrite/ec-026","desc":"positive: opt=plain cmd=pfast-change:qdisc_change_dev_d0_root_handle_1:_pfifo_fast","cmd":"tc qdisc change dev d0 root handle 1: pfifo_fast","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo_fast"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfast-change","json":"0","words":"qdisc change dev d0 root handle 1: pfifo_fast"}} +{"id":"tcqwrite/ec-027","desc":"positive: opt=plain cmd=pfast-replace:qdisc_replace_dev_d0_root_handle_1:_pfifo_fast","cmd":"tc qdisc replace dev d0 root handle 1: pfifo_fast","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo_fast"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfast-replace","json":"0","words":"qdisc replace dev d0 root handle 1: pfifo_fast"}} +{"id":"tcqwrite/ec-028","desc":"corner: opt=plain cmd=pfast-link:qdisc_link_dev_d0_root_handle_1:_pfifo_fast","cmd":"tc qdisc link dev d0 root handle 1: pfifo_fast","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo_fast"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfast-link","json":"0","words":"qdisc link dev d0 root handle 1: pfifo_fast"}} +{"id":"tcqwrite/ec-029","desc":"positive: opt=plain cmd=pfast-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo_fast"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"pfast-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-030","desc":"positive: opt=plain cmd=fqcodel0:qdisc_add_dev_d0_root_handle_1:_fq_codel","cmd":"tc qdisc add dev d0 root handle 1: fq_codel","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fqcodel0","json":"0","words":"qdisc add dev d0 root handle 1: fq_codel"}} +{"id":"tcqwrite/ec-031","desc":"positive: opt=plain cmd=fqcodel1:qdisc_add_dev_d0_root_handle_1:_fq_codel_limit_1000_flows_512_target_4ms_interval_50ms_quantum_1514_ecn","cmd":"tc qdisc add dev d0 root handle 1: fq_codel limit 1000 flows 512 target 4ms interval 50ms quantum 1514 ecn","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fqcodel1","json":"0","words":"qdisc add dev d0 root handle 1: fq_codel limit 1000 flows 512 target 4ms interval 50ms quantum 1514 ecn"}} +{"id":"tcqwrite/ec-032","desc":"positive: opt=plain cmd=fqcodel2:qdisc_add_dev_d0_root_handle_1:_fq_codel_noecn_ce_threshold_2ms_ce_threshold_selector_0x01/0x03_memory_limit_16Mb_drop_batch_32","cmd":"tc qdisc add dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fqcodel2","json":"0","words":"qdisc add dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32"}} +{"id":"tcqwrite/ec-033","desc":"positive: opt=plain cmd=fqcodel-change:qdisc_change_dev_d0_root_handle_1:_fq_codel_noecn_ce_threshold_2ms_ce_threshold_selector_0x01/0x03_memory_limit_16Mb_drop_batch_32","cmd":"tc qdisc change dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: fq_codel"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fqcodel-change","json":"0","words":"qdisc change dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32"}} +{"id":"tcqwrite/ec-034","desc":"positive: opt=plain cmd=fqcodel-replace:qdisc_replace_dev_d0_root_handle_1:_fq_codel_noecn_ce_threshold_2ms_ce_threshold_selector_0x01/0x03_memory_limit_16Mb_drop_batch_32","cmd":"tc qdisc replace dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: fq_codel"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fqcodel-replace","json":"0","words":"qdisc replace dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32"}} +{"id":"tcqwrite/ec-035","desc":"corner: opt=plain cmd=fqcodel-link:qdisc_link_dev_d0_root_handle_1:_fq_codel_noecn_ce_threshold_2ms_ce_threshold_selector_0x01/0x03_memory_limit_16Mb_drop_batch_32","cmd":"tc qdisc link dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: fq_codel"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fqcodel-link","json":"0","words":"qdisc link dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32"}} +{"id":"tcqwrite/ec-036","desc":"positive: opt=plain cmd=fqcodel-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: fq_codel"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fqcodel-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-037","desc":"positive: opt=plain cmd=fq0:qdisc_add_dev_d0_root_handle_1:_fq","cmd":"tc qdisc add dev d0 root handle 1: fq","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fq0","json":"0","words":"qdisc add dev d0 root handle 1: fq"}} +{"id":"tcqwrite/ec-038","desc":"positive: opt=plain cmd=fq1:qdisc_add_dev_d0_root_handle_1:_fq_limit_1000_flow_limit_50_quantum_3028_initial_quantum_15140_maxrate_1gbit_buckets_256_nopacing","cmd":"tc qdisc add dev d0 root handle 1: fq limit 1000 flow_limit 50 quantum 3028 initial_quantum 15140 maxrate 1gbit buckets 256 nopacing","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fq1","json":"0","words":"qdisc add dev d0 root handle 1: fq limit 1000 flow_limit 50 quantum 3028 initial_quantum 15140 maxrate 1gbit buckets 256 nopacing"}} +{"id":"tcqwrite/ec-039","desc":"positive: opt=plain cmd=fq2:qdisc_add_dev_d0_root_handle_1:_fq_pacing_refill_delay_50ms_low_rate_threshold_1Mbit_orphan_mask_511_timer_slack_20us_ce_threshold_4ms_horizon_2s_horizon_drop","cmd":"tc qdisc add dev d0 root handle 1: fq pacing refill_delay 50ms low_rate_threshold 1Mbit orphan_mask 511 timer_slack 20us ce_threshold 4ms horizon 2s horizon_drop","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fq2","json":"0","words":"qdisc add dev d0 root handle 1: fq pacing refill_delay 50ms low_rate_threshold 1Mbit orphan_mask 511 timer_slack 20us ce_threshold 4ms horizon 2s horizon_drop"}} +{"id":"tcqwrite/ec-040","desc":"positive: opt=plain cmd=fq3:qdisc_add_dev_d0_root_handle_1:_fq_horizon_cap_weights_589824_196608_65536_bands_3_priomap_1_2_2_2_1_2_0_0_1_1_1_1_1_1_1_1","cmd":"tc qdisc add dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fq3","json":"0","words":"qdisc add dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}} +{"id":"tcqwrite/ec-041","desc":"positive: opt=plain cmd=fq-change:qdisc_change_dev_d0_root_handle_1:_fq_horizon_cap_weights_589824_196608_65536_bands_3_priomap_1_2_2_2_1_2_0_0_1_1_1_1_1_1_1_1","cmd":"tc qdisc change dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: fq"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fq-change","json":"0","words":"qdisc change dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}} +{"id":"tcqwrite/ec-042","desc":"positive: opt=plain cmd=fq-replace:qdisc_replace_dev_d0_root_handle_1:_fq_horizon_cap_weights_589824_196608_65536_bands_3_priomap_1_2_2_2_1_2_0_0_1_1_1_1_1_1_1_1","cmd":"tc qdisc replace dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: fq"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fq-replace","json":"0","words":"qdisc replace dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}} +{"id":"tcqwrite/ec-043","desc":"corner: opt=plain cmd=fq-link:qdisc_link_dev_d0_root_handle_1:_fq_horizon_cap_weights_589824_196608_65536_bands_3_priomap_1_2_2_2_1_2_0_0_1_1_1_1_1_1_1_1","cmd":"tc qdisc link dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: fq"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fq-link","json":"0","words":"qdisc link dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}} +{"id":"tcqwrite/ec-044","desc":"positive: opt=plain cmd=fq-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: fq"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"fq-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-045","desc":"positive: opt=plain cmd=htb0:qdisc_add_dev_d0_root_handle_1:_htb","cmd":"tc qdisc add dev d0 root handle 1: htb","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"htb0","json":"0","words":"qdisc add dev d0 root handle 1: htb"}} +{"id":"tcqwrite/ec-046","desc":"positive: opt=plain cmd=htb1:qdisc_add_dev_d0_root_handle_1:_htb_default_10_r2q_20","cmd":"tc qdisc add dev d0 root handle 1: htb default 10 r2q 20","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"htb1","json":"0","words":"qdisc add dev d0 root handle 1: htb default 10 r2q 20"}} +{"id":"tcqwrite/ec-047","desc":"positive: opt=plain cmd=htb2:qdisc_add_dev_d0_root_handle_1:_htb_direct_qlen_50","cmd":"tc qdisc add dev d0 root handle 1: htb direct_qlen 50","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"htb2","json":"0","words":"qdisc add dev d0 root handle 1: htb direct_qlen 50"}} +{"id":"tcqwrite/ec-048","desc":"positive: opt=plain cmd=htb-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"htb-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-049","desc":"positive: opt=plain cmd=tbf0:qdisc_add_dev_d0_root_handle_1:_tbf_rate_1mbit_burst_10kb_latency_50ms","cmd":"tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tbf0","json":"0","words":"qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms"}} +{"id":"tcqwrite/ec-050","desc":"positive: opt=plain cmd=tbf1:qdisc_add_dev_d0_root_handle_1:_tbf_rate_10mbit_burst_20kb/8_limit_30000_peakrate_12mbit_mtu_2000_mpu_64","cmd":"tc qdisc add dev d0 root handle 1: tbf rate 10mbit burst 20kb/8 limit 30000 peakrate 12mbit mtu 2000 mpu 64","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tbf1","json":"0","words":"qdisc add dev d0 root handle 1: tbf rate 10mbit burst 20kb/8 limit 30000 peakrate 12mbit mtu 2000 mpu 64"}} +{"id":"tcqwrite/ec-051","desc":"positive: opt=plain cmd=tbf2:qdisc_add_dev_d0_root_handle_1:_tbf_rate_5gbit_burst_1mb_latency_1s","cmd":"tc qdisc add dev d0 root handle 1: tbf rate 5gbit burst 1mb latency 1s","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tbf2","json":"0","words":"qdisc add dev d0 root handle 1: tbf rate 5gbit burst 1mb latency 1s"}} +{"id":"tcqwrite/ec-052","desc":"positive: opt=plain cmd=tbf3:qdisc_add_dev_d0_root_handle_1:_tbf_rate_1Mbps_burst_10k_latency_70ms_linklayer_atm_overhead_10","cmd":"tc qdisc add dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tbf3","json":"0","words":"qdisc add dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10"}} +{"id":"tcqwrite/ec-053","desc":"positive: opt=plain cmd=tbf-change:qdisc_change_dev_d0_root_handle_1:_tbf_rate_1Mbps_burst_10k_latency_70ms_linklayer_atm_overhead_10","cmd":"tc qdisc change dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tbf-change","json":"0","words":"qdisc change dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10"}} +{"id":"tcqwrite/ec-054","desc":"positive: opt=plain cmd=tbf-replace:qdisc_replace_dev_d0_root_handle_1:_tbf_rate_1Mbps_burst_10k_latency_70ms_linklayer_atm_overhead_10","cmd":"tc qdisc replace dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tbf-replace","json":"0","words":"qdisc replace dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10"}} +{"id":"tcqwrite/ec-055","desc":"corner: opt=plain cmd=tbf-link:qdisc_link_dev_d0_root_handle_1:_tbf_rate_1Mbps_burst_10k_latency_70ms_linklayer_atm_overhead_10","cmd":"tc qdisc link dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tbf-link","json":"0","words":"qdisc link dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10"}} +{"id":"tcqwrite/ec-056","desc":"positive: opt=plain cmd=tbf-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"tbf-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-057","desc":"positive: opt=plain cmd=sfq0:qdisc_add_dev_d0_root_handle_1:_sfq","cmd":"tc qdisc add dev d0 root handle 1: sfq","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"sfq0","json":"0","words":"qdisc add dev d0 root handle 1: sfq"}} +{"id":"tcqwrite/ec-058","desc":"positive: opt=plain cmd=sfq1:qdisc_add_dev_d0_root_handle_1:_sfq_perturb_10_quantum_1514_limit_100_divisor_512_depth_64_flows_128","cmd":"tc qdisc add dev d0 root handle 1: sfq perturb 10 quantum 1514 limit 100 divisor 512 depth 64 flows 128","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"sfq1","json":"0","words":"qdisc add dev d0 root handle 1: sfq perturb 10 quantum 1514 limit 100 divisor 512 depth 64 flows 128"}} +{"id":"tcqwrite/ec-059","desc":"positive: opt=plain cmd=sfq2:qdisc_add_dev_d0_root_handle_1:_sfq_headdrop_redflowlimit_100000_min_8000_max_60000_probability_0.2_ecn_harddrop","cmd":"tc qdisc add dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"sfq2","json":"0","words":"qdisc add dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop"}} +{"id":"tcqwrite/ec-060","desc":"positive: opt=plain cmd=sfq-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: sfq"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"sfq-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-061","desc":"positive: opt=plain cmd=netem0:qdisc_add_dev_d0_root_handle_1:_netem_delay_100ms","cmd":"tc qdisc add dev d0 root handle 1: netem delay 100ms","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem0","json":"0","words":"qdisc add dev d0 root handle 1: netem delay 100ms"}} +{"id":"tcqwrite/ec-062","desc":"positive: opt=plain cmd=netem1:qdisc_add_dev_d0_root_handle_1:_netem_delay_100ms_10ms_25%_loss_1%_30%_duplicate_1%_corrupt_0.1%_reorder_25%_50%_gap_5","cmd":"tc qdisc add dev d0 root handle 1: netem delay 100ms 10ms 25% loss 1% 30% duplicate 1% corrupt 0.1% reorder 25% 50% gap 5","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem1","json":"0","words":"qdisc add dev d0 root handle 1: netem delay 100ms 10ms 25% loss 1% 30% duplicate 1% corrupt 0.1% reorder 25% 50% gap 5"}} +{"id":"tcqwrite/ec-063","desc":"positive: opt=plain cmd=netem2:qdisc_add_dev_d0_root_handle_1:_netem_delay_10ms_2ms_distribution_normal","cmd":"tc qdisc add dev d0 root handle 1: netem delay 10ms 2ms distribution normal","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem2","json":"0","words":"qdisc add dev d0 root handle 1: netem delay 10ms 2ms distribution normal"}} +{"id":"tcqwrite/ec-064","desc":"positive: opt=plain cmd=netem3:qdisc_add_dev_d0_root_handle_1:_netem_loss_state_1%_10%_5%_1%_2%_limit_3000","cmd":"tc qdisc add dev d0 root handle 1: netem loss state 1% 10% 5% 1% 2% limit 3000","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem3","json":"0","words":"qdisc add dev d0 root handle 1: netem loss state 1% 10% 5% 1% 2% limit 3000"}} +{"id":"tcqwrite/ec-065","desc":"positive: opt=plain cmd=netem4:qdisc_add_dev_d0_root_handle_1:_netem_loss_gemodel_1%_10%_70%_0.1%_ecn","cmd":"tc qdisc add dev d0 root handle 1: netem loss gemodel 1% 10% 70% 0.1% ecn","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem4","json":"0","words":"qdisc add dev d0 root handle 1: netem loss gemodel 1% 10% 70% 0.1% ecn"}} +{"id":"tcqwrite/ec-066","desc":"positive: opt=plain cmd=netem5:qdisc_add_dev_d0_root_handle_1:_netem_rate_1mbit_20_100_5_slot_800us_1ms_packets_10_bytes_3000","cmd":"tc qdisc add dev d0 root handle 1: netem rate 1mbit 20 100 5 slot 800us 1ms packets 10 bytes 3000","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem5","json":"0","words":"qdisc add dev d0 root handle 1: netem rate 1mbit 20 100 5 slot 800us 1ms packets 10 bytes 3000"}} +{"id":"tcqwrite/ec-067","desc":"positive: opt=plain cmd=netem6:qdisc_add_dev_d0_root_handle_1:_netem_slot_distribution_pareto_1ms_100us","cmd":"tc qdisc add dev d0 root handle 1: netem slot distribution pareto 1ms 100us","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem6","json":"0","words":"qdisc add dev d0 root handle 1: netem slot distribution pareto 1ms 100us"}} +{"id":"tcqwrite/ec-068","desc":"positive: opt=plain cmd=netem7:qdisc_add_dev_d0_root_handle_1:_netem_delay_1s_seed_7","cmd":"tc qdisc add dev d0 root handle 1: netem delay 1s seed 7","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem7","json":"0","words":"qdisc add dev d0 root handle 1: netem delay 1s seed 7"}} +{"id":"tcqwrite/ec-069","desc":"positive: opt=plain cmd=netem-change:qdisc_change_dev_d0_root_handle_1:_netem_delay_1s_seed_7","cmd":"tc qdisc change dev d0 root handle 1: netem delay 1s seed 7","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: netem delay 100ms"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem-change","json":"0","words":"qdisc change dev d0 root handle 1: netem delay 1s seed 7"}} +{"id":"tcqwrite/ec-070","desc":"positive: opt=plain cmd=netem-replace:qdisc_replace_dev_d0_root_handle_1:_netem_delay_1s_seed_7","cmd":"tc qdisc replace dev d0 root handle 1: netem delay 1s seed 7","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: netem delay 100ms"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem-replace","json":"0","words":"qdisc replace dev d0 root handle 1: netem delay 1s seed 7"}} +{"id":"tcqwrite/ec-071","desc":"corner: opt=plain cmd=netem-link:qdisc_link_dev_d0_root_handle_1:_netem_delay_1s_seed_7","cmd":"tc qdisc link dev d0 root handle 1: netem delay 1s seed 7","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: netem delay 100ms"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem-link","json":"0","words":"qdisc link dev d0 root handle 1: netem delay 1s seed 7"}} +{"id":"tcqwrite/ec-072","desc":"positive: opt=plain cmd=netem-delete:qdisc_delete_dev_d0_root","cmd":"tc qdisc delete dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: netem delay 100ms"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"netem-delete","json":"0","words":"qdisc delete dev d0 root"}} +{"id":"tcqwrite/ec-073","desc":"positive: opt=plain cmd=ingress:qdisc_add_dev_d0_ingress","cmd":"tc qdisc add dev d0 ingress","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ingress","json":"0","words":"qdisc add dev d0 ingress"}} +{"id":"tcqwrite/ec-074","desc":"positive: opt=plain cmd=ingress-blk:qdisc_add_dev_d0_ingress_block_5_ingress","cmd":"tc qdisc add dev d0 ingress_block 5 ingress","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ingress-blk","json":"0","words":"qdisc add dev d0 ingress_block 5 ingress"}} +{"id":"tcqwrite/ec-075","desc":"positive: opt=plain cmd=ingress-del:qdisc_del_dev_d0_ingress","cmd":"tc qdisc del dev d0 ingress","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 ingress"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"ingress-del","json":"0","words":"qdisc del dev d0 ingress"}} +{"id":"tcqwrite/ec-076","desc":"positive: opt=plain cmd=clsact:qdisc_add_dev_d0_clsact","cmd":"tc qdisc add dev d0 clsact","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"clsact","json":"0","words":"qdisc add dev d0 clsact"}} +{"id":"tcqwrite/ec-077","desc":"positive: opt=plain cmd=clsact-blk:qdisc_add_dev_d0_ingress_block_5_egress_block_6_clsact","cmd":"tc qdisc add dev d0 ingress_block 5 egress_block 6 clsact","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"clsact-blk","json":"0","words":"qdisc add dev d0 ingress_block 5 egress_block 6 clsact"}} +{"id":"tcqwrite/ec-078","desc":"positive: opt=plain cmd=clsact-del:qdisc_delete_dev_d0_clsact","cmd":"tc qdisc delete dev d0 clsact","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 clsact"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"clsact-del","json":"0","words":"qdisc delete dev d0 clsact"}} +{"id":"tcqwrite/ec-079","desc":"corner: opt=plain cmd=w2-handle:qdisc_add_dev_d0_handle_5:_ingress","cmd":"tc qdisc add dev d0 handle 5: ingress","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"w2-handle","json":"0","words":"qdisc add dev d0 handle 5: ingress"}} +{"id":"tcqwrite/ec-080","desc":"positive: opt=plain cmd=parent:qdisc_add_dev_d0_parent_1:10_handle_10:_pfifo_limit_10","cmd":"tc qdisc add dev d0 parent 1:10 handle 10: pfifo limit 10","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10","tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"parent","json":"0","words":"qdisc add dev d0 parent 1:10 handle 10: pfifo limit 10"}} +{"id":"tcqwrite/ec-081","desc":"positive: opt=plain cmd=est:qdisc_add_dev_d0_root_handle_1:_estimator_1s_8s_pfifo","cmd":"tc qdisc add dev d0 root handle 1: estimator 1s 8s pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"est","json":"0","words":"qdisc add dev d0 root handle 1: estimator 1s 8s pfifo"}} +{"id":"tcqwrite/ec-082","desc":"corner: opt=plain cmd=est-prefix:qdisc_add_dev_d0_root_handle_1:_est_250ms_1s_pfifo","cmd":"tc qdisc add dev d0 root handle 1: est 250ms 1s pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"est-prefix","json":"0","words":"qdisc add dev d0 root handle 1: est 250ms 1s pfifo"}} +{"id":"tcqwrite/ec-083","desc":"positive: opt=plain cmd=stab:qdisc_add_dev_d0_root_handle_1:_stab_overhead_20_linklayer_atm_mtu_2048_tsize_128_mpu_64_pfifo","cmd":"tc qdisc add dev d0 root handle 1: stab overhead 20 linklayer atm mtu 2048 tsize 128 mpu 64 pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"stab","json":"0","words":"qdisc add dev d0 root handle 1: stab overhead 20 linklayer atm mtu 2048 tsize 128 mpu 64 pfifo"}} +{"id":"tcqwrite/ec-084","desc":"boundary: opt=plain cmd=stab0:qdisc_add_dev_d0_root_handle_1:_stab_overhead_4_pfifo","cmd":"tc qdisc add dev d0 root handle 1: stab overhead 4 pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"stab0","json":"0","words":"qdisc add dev d0 root handle 1: stab overhead 4 pfifo"}} +{"id":"tcqwrite/ec-085","desc":"positive: opt=plain cmd=stab-eth:qdisc_add_dev_d0_root_handle_1:_stab_linklayer_ethernet_overhead_14_tbf_rate_1mbit_burst_10kb_latency_50ms","cmd":"tc qdisc add dev d0 root handle 1: stab linklayer ethernet overhead 14 tbf rate 1mbit burst 10kb latency 50ms","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"stab-eth","json":"0","words":"qdisc add dev d0 root handle 1: stab linklayer ethernet overhead 14 tbf rate 1mbit burst 10kb latency 50ms"}} +{"id":"tcqwrite/ec-086","desc":"corner: opt=plain cmd=verb-prefix:qdisc_a_dev_d0_root_handle_1:_pfifo","cmd":"tc qdisc a dev d0 root handle 1: pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"verb-prefix","json":"0","words":"qdisc a dev d0 root handle 1: pfifo"}} +{"id":"tcqwrite/ec-087","desc":"corner: opt=plain cmd=nohandle:qdisc_add_dev_d0_root_pfifo","cmd":"tc qdisc add dev d0 root pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"nohandle","json":"0","words":"qdisc add dev d0 root pfifo"}} +{"id":"tcqwrite/ec-088","desc":"corner: opt=plain cmd=w1-help:qdisc_add_dev_d0_root_handle_1:_help_pfifo","cmd":"tc qdisc add dev d0 root handle 1: help pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"w1-help","json":"0","words":"qdisc add dev d0 root handle 1: help pfifo"}} +{"id":"tcqwrite/ec-089","desc":"corner: opt=plain cmd=w3-zero:qdisc_add_dev_d0_root_handle_0:_handle_1:_pfifo","cmd":"tc qdisc add dev d0 root handle 0: handle 1: pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"w3-zero","json":"0","words":"qdisc add dev d0 root handle 0: handle 1: pfifo"}} +{"id":"tcqwrite/ec-090","desc":"positive: opt=plain cmd=class-add:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_1mbit","cmd":"tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-add","json":"0","words":"class add dev d0 parent 1: classid 1:10 htb rate 1mbit"}} +{"id":"tcqwrite/ec-091","desc":"positive: opt=plain cmd=class-full:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_1mbit_ceil_2mbit_burst_15k_cburst_20k_prio_2_quantum_1500_mtu_1600_mpu_64_overhead_4","cmd":"tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit ceil 2mbit burst 15k cburst 20k prio 2 quantum 1500 mtu 1600 mpu 64 overhead 4","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-full","json":"0","words":"class add dev d0 parent 1: classid 1:10 htb rate 1mbit ceil 2mbit burst 15k cburst 20k prio 2 quantum 1500 mtu 1600 mpu 64 overhead 4"}} +{"id":"tcqwrite/ec-092","desc":"boundary: opt=plain cmd=class-64:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_40gbit_ceil_50gbit","cmd":"tc class add dev d0 parent 1: classid 1:10 htb rate 40gbit ceil 50gbit","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-64","json":"0","words":"class add dev d0 parent 1: classid 1:10 htb rate 40gbit ceil 50gbit"}} +{"id":"tcqwrite/ec-093","desc":"positive: opt=plain cmd=class-est:class_add_dev_d0_parent_1:_classid_1:10_estimator_1s_4s_htb_rate_1mbit","cmd":"tc class add dev d0 parent 1: classid 1:10 estimator 1s 4s htb rate 1mbit","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-est","json":"0","words":"class add dev d0 parent 1: classid 1:10 estimator 1s 4s htb rate 1mbit"}} +{"id":"tcqwrite/ec-094","desc":"positive: opt=plain cmd=class-atm:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_1mbit_linklayer_atm","cmd":"tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit linklayer atm","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-atm","json":"0","words":"class add dev d0 parent 1: classid 1:10 htb rate 1mbit linklayer atm"}} +{"id":"tcqwrite/ec-095","desc":"positive: opt=plain cmd=class-root:class_add_dev_d0_root_classid_1:1_htb_rate_5mbit","cmd":"tc class add dev d0 root classid 1:1 htb rate 5mbit","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-root","json":"0","words":"class add dev d0 root classid 1:1 htb rate 5mbit"}} +{"id":"tcqwrite/ec-096","desc":"positive: opt=plain cmd=class-change:class_change_dev_d0_parent_1:_classid_1:10_htb_rate_2mbit_ceil_3mbit","cmd":"tc class change dev d0 parent 1: classid 1:10 htb rate 2mbit ceil 3mbit","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10","tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-change","json":"0","words":"class change dev d0 parent 1: classid 1:10 htb rate 2mbit ceil 3mbit"}} +{"id":"tcqwrite/ec-097","desc":"positive: opt=plain cmd=class-replace:class_replace_dev_d0_parent_1:_classid_1:10_htb_rate_3mbit","cmd":"tc class replace dev d0 parent 1: classid 1:10 htb rate 3mbit","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10","tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-replace","json":"0","words":"class replace dev d0 parent 1: classid 1:10 htb rate 3mbit"}} +{"id":"tcqwrite/ec-098","desc":"positive: opt=plain cmd=class-del:class_del_dev_d0_classid_1:10","cmd":"tc class del dev d0 classid 1:10","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10","tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-del","json":"0","words":"class del dev d0 classid 1:10"}} +{"id":"tcqwrite/ec-099","desc":"corner: opt=plain cmd=class-help:class_add_dev_d0_parent_1:_classid_1:20_help_htb_rate_1mbit","cmd":"tc class add dev d0 parent 1: classid 1:20 help htb rate 1mbit","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"class-help","json":"0","words":"class add dev d0 parent 1: classid 1:20 help htb rate 1mbit"}} +{"id":"tcqwrite/ec-100","desc":"positive: opt=plain cmd=batch:batch:two","cmd":"tc -batch b.txt","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","printf '%s\\n' 'qdisc add dev d0 root handle 1: htb default 10' 'class add dev d0 parent 1: classid 1:10 htb rate 1mbit' > b.txt"],"readback":[{"name":"dump","cmd":"tc -d qdisc show dev d0"},{"name":"class","cmd":"tc -d class show dev d0"}],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"two","fix":"batch","json":"0","words":"-batch b.txt"}} +{"id":"tcqwrite/ng-001","desc":"negative: opt=plain cmd=ng:exists:qdisc_add_dev_d0_root_handle_1:_pfifo: add over an existing root: the kernel's EEXIST, rc 2","cmd":"tc qdisc add dev d0 root handle 1: pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"EEXIST","refused_by":"kernel"},"axes":{"fix":"exists","json":"0","words":"qdisc add dev d0 root handle 1: pfifo"}} +{"id":"tcqwrite/ng-002","desc":"negative: opt=plain cmd=ng:nochange:qdisc_change_dev_d0_root_handle_1:_pfifo_limit_5: change with no such qdisc (K44)","cmd":"tc qdisc change dev d0 root handle 1: pfifo limit 5","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"ENOENT","refused_by":"kernel"},"axes":{"fix":"nochange","json":"0","words":"qdisc change dev d0 root handle 1: pfifo limit 5"}} +{"id":"tcqwrite/ng-003","desc":"negative: opt=plain cmd=ng:deldefault:qdisc_del_dev_d0_root: delete of the default root (K44)","cmd":"tc qdisc del dev d0 root","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"ENOENT","refused_by":"kernel"},"axes":{"fix":"deldefault","json":"0","words":"qdisc del dev d0 root"}} +{"id":"tcqwrite/ng-004","desc":"negative: opt=plain cmd=ng:classless:class_add_dev_d0_parent_1:_classid_1:10_pfifo: Qdisc \"pfifo\" is classless, rc 1 (W4)","cmd":"tc class add dev d0 parent 1: classid 1:10 pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: pfifo"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"classless","json":"0","words":"class add dev d0 parent 1: classid 1:10 pfifo"}} +{"id":"tcqwrite/ng-005","desc":"negative: opt=plain cmd=ng:badopt:qdisc_add_dev_d0_root_handle_1:_pfifo_limit_zz: a parse_qopt failure returns 1 (W4)","cmd":"tc qdisc add dev d0 root handle 1: pfifo limit zz","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"badopt","json":"0","words":"qdisc add dev d0 root handle 1: pfifo limit zz"}} +{"id":"tcqwrite/ng-006","desc":"negative: opt=plain cmd=ng:badunit:qdisc_add_dev_d0_root_handle_1:_tbf_rate_1zbit_burst_10kb_latency_50ms: a bad rate unit","cmd":"tc qdisc add dev d0 root handle 1: tbf rate 1zbit burst 10kb latency 50ms","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"badunit","json":"0","words":"qdisc add dev d0 root handle 1: tbf rate 1zbit burst 10kb latency 50ms"}} +{"id":"tcqwrite/ng-007","desc":"negative: opt=plain cmd=ng:nokind:qdisc_add_dev_d0_root_handle_1:_nosuchkind: an unknown kind: tc sends it and the kernel refuses","cmd":"tc qdisc add dev d0 root handle 1: nosuchkind","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"ENOENT","refused_by":"kernel"},"axes":{"fix":"nokind","json":"0","words":"qdisc add dev d0 root handle 1: nosuchkind"}} +{"id":"tcqwrite/ng-008","desc":"negative: opt=plain cmd=ng:w5-classless:class_add_dev_d0_parent_1:_classid_1:10_nosuchkind_rate_1: an unknown class kind is \"classless\", rc 1, not W5's Garbage","cmd":"tc class add dev d0 parent 1: classid 1:10 nosuchkind rate 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"w5-classless","json":"0","words":"class add dev d0 parent 1: classid 1:10 nosuchkind rate 1"}} +{"id":"tcqwrite/ng-009","desc":"negative: opt=plain cmd=ng:qunknown:qdisc_add_dev_d0_root_handle_1:_nosuchkind_rate_1: Unknown qdisc, hence option unparsable, rc 1","cmd":"tc qdisc add dev d0 root handle 1: nosuchkind rate 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"qunknown","json":"0","words":"qdisc add dev d0 root handle 1: nosuchkind rate 1"}} +{"id":"tcqwrite/ng-010","desc":"negative: opt=plain cmd=ng:w8-clsact:qdisc_add_dev_d0_clsact_foo: clsact's own parse_qopt refuses foo, rc 1 (not W8)","cmd":"tc qdisc add dev d0 clsact foo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"w8-clsact","json":"0","words":"qdisc add dev d0 clsact foo"}} +{"id":"tcqwrite/ng-011","desc":"negative: opt=plain cmd=ng:w2-after:qdisc_add_ingress_dev_d0: the words after ingress go to its parse_qopt: What is \"dev\"?, rc 1 (W2)","cmd":"tc qdisc add ingress dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"w2-after","json":"0","words":"qdisc add ingress dev d0"}} +{"id":"tcqwrite/ng-012","desc":"negative: opt=plain cmd=ng:noroot:qdisc_add_dev_d0_handle_1:_pfifo: no parent: Specified qdisc not found (K44)","cmd":"tc qdisc add dev d0 handle 1: pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"ENOENT","refused_by":"kernel"},"axes":{"fix":"noroot","json":"0","words":"qdisc add dev d0 handle 1: pfifo"}} +{"id":"tcqwrite/ng-013","desc":"negative: opt=plain cmd=ng:w9-pct:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_10%: a percent rate on a dummy with no speed, rc 1 (W9)","cmd":"tc class add dev d0 parent 1: classid 1:10 htb rate 10%","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"iproute2"},"axes":{"fix":"w9-pct","json":"0","words":"class add dev d0 parent 1: classid 1:10 htb rate 10%"}} +{"id":"tcqwrite/ng-014","desc":"negative: opt=plain cmd=ng:htboffload:qdisc_add_dev_d0_root_handle_1:_htb_offload: offload needs hw-tc-offload: ENOTSUP, rc 2","cmd":"tc qdisc add dev d0 root handle 1: htb offload","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"ENOTSUP","refused_by":"kernel"},"axes":{"fix":"htboffload","json":"0","words":"qdisc add dev d0 root handle 1: htb offload"}} +{"id":"tcqwrite/ng-015","desc":"negative: opt=plain cmd=ng:dupdev:qdisc_add_dev_d0_dev_d0_root_pfifo: dev twice: duparg","cmd":"tc qdisc add dev d0 dev d0 root pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"dupdev","json":"0","words":"qdisc add dev d0 dev d0 root pfifo"}} +{"id":"tcqwrite/ng-016","desc":"negative: opt=plain cmd=ng:dupparent:qdisc_add_dev_d0_root_root_pfifo: root twice","cmd":"tc qdisc add dev d0 root root pfifo","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"dupparent","json":"0","words":"qdisc add dev d0 root root pfifo"}} +{"id":"tcqwrite/ng-017","desc":"negative: opt=plain cmd=ng:classhandle:class_add_dev_d0_parent_1:_handle_1:10_htb_rate_1mbit: class handle: try classid","cmd":"tc class add dev d0 parent 1: handle 1:10 htb rate 1mbit","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb default 10"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":255,"refused_by":"iproute2"},"axes":{"fix":"classhandle","json":"0","words":"class add dev d0 parent 1: handle 1:10 htb rate 1mbit"}} +{"id":"tcqwrite/ng-018","desc":"negative: opt=plain cmd=ng:nodev:qdisc_add_dev_nosuch_root_handle_1:_pfifo: a missing device: Cannot find device, rc 1","cmd":"tc qdisc add dev nosuch root handle 1: pfifo","modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"errno":"ENODEV","refused_by":"kernel"},"axes":{"fix":"nodev","json":"0","words":"qdisc add dev nosuch root handle 1: pfifo"}} +{"id":"tcqwrite/ng-019","desc":"negative: opt=plain cmd=ng:batch:batch:fail-force: with -force the failing write is passed and the next one sent; rc 1","cmd":"tc -force -batch b.txt","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","printf '%s\\n' 'qdisc add dev d0 root handle 1: pfifo limit zz' 'qdisc add dev d0 root handle 1: pfifo' > b.txt"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":1,"refused_by":"ack-then-fail"},"axes":{"batch":"fail-force","fix":"batch","json":"0","words":"-force -batch b.txt"}} +{"id":"tcqwrite/ng-020","desc":"negative: opt=plain cmd=ng:htb-change:qdisc_change_dev_d0_root_handle_1:_htb_direct_qlen_50: htb has no change op: EINVAL, rc 2 (K44)","cmd":"tc qdisc change dev d0 root handle 1: htb direct_qlen 50","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"EINVAL","refused_by":"kernel"},"axes":{"fix":"htb-change","json":"0","words":"qdisc change dev d0 root handle 1: htb direct_qlen 50"}} +{"id":"tcqwrite/ng-021","desc":"negative: opt=plain cmd=ng:htb-replace:qdisc_replace_dev_d0_root_handle_1:_htb_direct_qlen_50: htb has no change op: EINVAL, rc 2 (K44)","cmd":"tc qdisc replace dev d0 root handle 1: htb direct_qlen 50","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"EINVAL","refused_by":"kernel"},"axes":{"fix":"htb-replace","json":"0","words":"qdisc replace dev d0 root handle 1: htb direct_qlen 50"}} +{"id":"tcqwrite/ng-022","desc":"negative: opt=plain cmd=ng:htb-link:qdisc_link_dev_d0_root_handle_1:_htb_direct_qlen_50: htb has no change op: EINVAL, rc 2 (K44)","cmd":"tc qdisc link dev d0 root handle 1: htb direct_qlen 50","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: htb"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"EINVAL","refused_by":"kernel"},"axes":{"fix":"htb-link","json":"0","words":"qdisc link dev d0 root handle 1: htb direct_qlen 50"}} +{"id":"tcqwrite/ng-023","desc":"negative: opt=plain cmd=ng:sfq-change:qdisc_change_dev_d0_root_handle_1:_sfq_headdrop_redflowlimit_100000_min_8000_max_60000_probability_0.2_ecn_harddrop: sfq has no change op: EINVAL, rc 2 (K44)","cmd":"tc qdisc change dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: sfq"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"EINVAL","refused_by":"kernel"},"axes":{"fix":"sfq-change","json":"0","words":"qdisc change dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop"}} +{"id":"tcqwrite/ng-024","desc":"negative: opt=plain cmd=ng:sfq-replace:qdisc_replace_dev_d0_root_handle_1:_sfq_headdrop_redflowlimit_100000_min_8000_max_60000_probability_0.2_ecn_harddrop: sfq has no change op: EINVAL, rc 2 (K44)","cmd":"tc qdisc replace dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: sfq"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"EINVAL","refused_by":"kernel"},"axes":{"fix":"sfq-replace","json":"0","words":"qdisc replace dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop"}} +{"id":"tcqwrite/ng-025","desc":"negative: opt=plain cmd=ng:sfq-link:qdisc_link_dev_d0_root_handle_1:_sfq_headdrop_redflowlimit_100000_min_8000_max_60000_probability_0.2_ecn_harddrop: sfq has no change op: EINVAL, rc 2 (K44)","cmd":"tc qdisc link dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: sfq"],"modules":["sch_prio","sch_fq_codel","sch_fq","sch_htb","sch_tbf","sch_sfq","sch_netem","sch_ingress"],"proto":"route","expect":{"rc":2,"errno":"EINVAL","refused_by":"kernel"},"axes":{"fix":"sfq-link","json":"0","words":"qdisc link dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop"}} diff --git a/nix/tests/focused-quality.nix b/nix/tests/focused-quality.nix index 1834d7b78..bdb2c4132 100644 --- a/nix/tests/focused-quality.nix +++ b/nix/tests/focused-quality.nix @@ -73,6 +73,17 @@ in ]; }; + # With gotc_write: gotc's qdisc and class writes and pkg/xtcpnl's tc write + # builder build only so. The untagged half runs in the default `go test`. + focused-gotc-write = mkFocusedTest "gotc-write" { + tags = lib.concatStringsSep " " versions.gotcWriteTags; + paths = [ + "./internal/gotc/..." + "./pkg/xtcpnl/..." + "./pkg/cint/..." + ]; + }; + # gordma's corpus replay reads pkg/xtcpnl/testdata/*/rdma, which the # vendored source carries. focused-gordma = mkFocusedTest "gordma" { diff --git a/nix/versions.nix b/nix/versions.nix index 525ddd2af..7412e0b43 100644 --- a/nix/versions.nix +++ b/nix/versions.nix @@ -147,10 +147,12 @@ # to disk; it is reachable only through the dedicated `xtcp2-capture` attr. # `goip_write` compiles in goip's write verbs (the netlink request # encoders); only goip and goip-parity carry it (goipWriteTags below). + # `gotc_write` compiles in gotc's qdisc and class writes (gotcWriteTags). # nix/checks/flavor-tags.nix fails if one of these reaches a flavor. optInOnlyTags = [ "capture" "goip_write" + "gotc_write" ]; # goip's write path: internal/goip's write verbs and pkg/xtcpnl's write @@ -158,6 +160,12 @@ # go-link-monitor, which serve goip's listings on /ip, never do. goipWriteTags = [ "goip_write" ]; + # gotc's write path: internal/gotc's qdisc and class writes and pkg/xtcpnl's + # tc write builder. Dry-run like goip's: a write goes to a replay or to + # GOTC_WRITE_OUT, never to a live socket. The default gotc is built + # without it and refuses writes. + gotcWriteTags = [ "gotc_write" ]; + # Enrichment flavors — the third build axis, alongside buildVariants and # destinationFlavors. Each maps to a list of `enrich_` build tags. # diff --git a/pkg/cint/cint.go b/pkg/cint/cint.go index 7c1e93bf6..fff4a3a7a 100644 --- a/pkg/cint/cint.go +++ b/pkg/cint/cint.go @@ -32,6 +32,26 @@ func Short(v uint16) int16 { return -int16(math.MaxUint16-v) - 1 } +// ShortBits is (__u16)n: a short's two's-complement bits, so -1 is 0xffff. +// It is Short's inverse. +func ShortBits(n int16) uint16 { + return uint16(int32(n) & math.MaxUint16) +} + +// SChar is (signed char)v: a byte read as a C signed char, so 0xff is -1. +func SChar(v uint8) int8 { + if v <= math.MaxInt8 { + return int8(v) + } + return -int8(math.MaxUint8-v) - 1 +} + +// SCharBits is (__u8)n: a signed char's bits, so -1 is 0xff. It is SChar's +// inverse. +func SCharBits(n int8) uint8 { + return uint8(int16(n) & math.MaxUint8) +} + // Low32 is (__u32)v: the low 32 bits of a wider unsigned value. func Low32(v uint64) uint32 { return uint32(v & math.MaxUint32) diff --git a/pkg/cint/cint_test.go b/pkg/cint/cint_test.go index ade27a5f8..15214fd16 100644 --- a/pkg/cint/cint_test.go +++ b/pkg/cint/cint_test.go @@ -261,3 +261,54 @@ func TestNarrowU64(t *testing.T) { }) } } + +// TestShortSChar is the short and signed char round trips: ShortBits and +// Short, SCharBits and SChar. +// +// go test ./pkg/cint/ -run TestShortSChar +func TestShortSChar(t *testing.T) { + shorts := []struct { + description string + n int16 + expected uint16 + }{ + {"positive: a cell_align of 7", 7, 7}, + {"negative: -1 is all ones", -1, math.MaxUint16}, + {"boundary: zero", 0, 0}, + {"boundary: MaxInt16", math.MaxInt16, math.MaxInt16}, + {"boundary: MinInt16 is the sign bit", math.MinInt16, 1 << 15}, + {"corner: -2", -2, math.MaxUint16 - 1}, + } + for _, tt := range shorts { + t.Run(tt.description, func(t *testing.T) { + if got := ShortBits(tt.n); got != tt.expected { + t.Fatalf("ShortBits(%d) = %#x, expected %#x", tt.n, got, tt.expected) + } + if got := Short(tt.expected); got != tt.n { + t.Fatalf("Short(%#x) = %d, expected %d", tt.expected, got, tt.n) + } + }) + } + chars := []struct { + description string + n int8 + expected uint8 + }{ + {"positive: an interval of 3", 3, 3}, + {"negative: an interval of -2", -2, 0xfe}, + {"boundary: zero", 0, 0}, + {"boundary: MaxInt8", math.MaxInt8, math.MaxInt8}, + {"boundary: MinInt8 is the sign bit", math.MinInt8, 0x80}, + {"corner: -1 is all ones", -1, math.MaxUint8}, + } + for _, tt := range chars { + t.Run(tt.description, func(t *testing.T) { + if got := SCharBits(tt.n); got != tt.expected { + t.Fatalf("SCharBits(%d) = %#x, expected %#x", tt.n, got, tt.expected) + } + if got := SChar(tt.expected); got != tt.n { + t.Fatalf("SChar(%#x) = %d, expected %d", tt.expected, got, tt.n) + } + }) + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/cmd.json new file mode 100644 index 000000000..9bdb88578 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "pfifo0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: pfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 1: pfifo", + "desc": "positive: opt=plain cmd=pfifo0:qdisc_add_dev_d0_root_handle_1:_pfifo", + "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": "tcqwrite/ec-001", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/dump.out new file mode 100644 index 000000000..2941d1f91 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 1000p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.pcap new file mode 100644 index 000000000..b098e649a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/netlink_route_dump.pcap new file mode 100644 index 000000000..e7102498b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-001/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/cmd.json new file mode 100644 index 000000000..6b4cbc8d1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "pfifo1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: pfifo limit 100" + }, + "cmd": "tc qdisc add dev d0 root handle 1: pfifo limit 100", + "desc": "positive: opt=plain cmd=pfifo1:qdisc_add_dev_d0_root_handle_1:_pfifo_limit_100", + "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": "tcqwrite/ec-002", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/dump.out new file mode 100644 index 000000000..c3adfed3a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 100p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.pcap new file mode 100644 index 000000000..48b058bff Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/netlink_route_dump.pcap new file mode 100644 index 000000000..e8a8e75f9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-002/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/cmd.json new file mode 100644 index 000000000..35eadb15f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "pfifo-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: pfifo limit 100" + }, + "cmd": "tc qdisc change dev d0 root handle 1: pfifo limit 100", + "desc": "positive: opt=plain cmd=pfifo-change:qdisc_change_dev_d0_root_handle_1:_pfifo_limit_100", + "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": "tcqwrite/ec-003", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/dump.out new file mode 100644 index 000000000..c3adfed3a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 100p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.pcap new file mode 100644 index 000000000..a3edea978 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/netlink_route_dump.pcap new file mode 100644 index 000000000..b3422c65f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-003/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/cmd.json new file mode 100644 index 000000000..e478e1108 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "pfifo-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: pfifo limit 100" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: pfifo limit 100", + "desc": "positive: opt=plain cmd=pfifo-replace:qdisc_replace_dev_d0_root_handle_1:_pfifo_limit_100", + "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": "tcqwrite/ec-004", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/dump.out new file mode 100644 index 000000000..c3adfed3a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 100p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.pcap new file mode 100644 index 000000000..f5184e9a8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/netlink_route_dump.pcap new file mode 100644 index 000000000..562ff0b9d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-004/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/cmd.json new file mode 100644 index 000000000..5dbd77cd8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "pfifo-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: pfifo limit 100" + }, + "cmd": "tc qdisc link dev d0 root handle 1: pfifo limit 100", + "desc": "corner: opt=plain cmd=pfifo-link:qdisc_link_dev_d0_root_handle_1:_pfifo_limit_100", + "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": "tcqwrite/ec-005", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/dump.out new file mode 100644 index 000000000..c3adfed3a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 100p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.pcap new file mode 100644 index 000000000..e1a9d6074 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/netlink_route_dump.pcap new file mode 100644 index 000000000..870a7baeb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-005/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/cmd.json new file mode 100644 index 000000000..8b61bbfa3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "pfifo-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=pfifo-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-006", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.pcap new file mode 100644 index 000000000..c7a560490 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/netlink_route_dump.pcap new file mode 100644 index 000000000..73c678e05 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-006/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/cmd.json new file mode 100644 index 000000000..0d056a617 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "bfifo0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: bfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 1: bfifo", + "desc": "positive: opt=plain cmd=bfifo0:qdisc_add_dev_d0_root_handle_1:_bfifo", + "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": "tcqwrite/ec-007", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/dump.out new file mode 100644 index 000000000..f4f083cce --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/dump.out @@ -0,0 +1 @@ +qdisc bfifo 1: root refcnt 2 limit 1514000b diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.pcap new file mode 100644 index 000000000..c0e6da19a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/netlink_route_dump.pcap new file mode 100644 index 000000000..ff7b19cfe Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-007/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/cmd.json new file mode 100644 index 000000000..4de433896 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "bfifo1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: bfifo limit 10kb" + }, + "cmd": "tc qdisc add dev d0 root handle 1: bfifo limit 10kb", + "desc": "positive: opt=plain cmd=bfifo1:qdisc_add_dev_d0_root_handle_1:_bfifo_limit_10kb", + "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": "tcqwrite/ec-008", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/dump.out new file mode 100644 index 000000000..884be0daa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/dump.out @@ -0,0 +1 @@ +qdisc bfifo 1: root refcnt 2 limit 10Kb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.pcap new file mode 100644 index 000000000..91111d3d7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/netlink_route_dump.pcap new file mode 100644 index 000000000..307e31f80 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-008/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/cmd.json new file mode 100644 index 000000000..5996f51dc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "bfifo-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: bfifo limit 10kb" + }, + "cmd": "tc qdisc change dev d0 root handle 1: bfifo limit 10kb", + "desc": "positive: opt=plain cmd=bfifo-change:qdisc_change_dev_d0_root_handle_1:_bfifo_limit_10kb", + "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": "tcqwrite/ec-009", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: bfifo" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: bfifo", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/dump.out new file mode 100644 index 000000000..884be0daa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/dump.out @@ -0,0 +1 @@ +qdisc bfifo 1: root refcnt 2 limit 10Kb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.pcap new file mode 100644 index 000000000..ce1ec223c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/netlink_route_dump.pcap new file mode 100644 index 000000000..3459eebd1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-009/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/cmd.json new file mode 100644 index 000000000..58f09a007 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "bfifo-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: bfifo limit 10kb" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: bfifo limit 10kb", + "desc": "positive: opt=plain cmd=bfifo-replace:qdisc_replace_dev_d0_root_handle_1:_bfifo_limit_10kb", + "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": "tcqwrite/ec-010", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: bfifo" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: bfifo", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/dump.out new file mode 100644 index 000000000..884be0daa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/dump.out @@ -0,0 +1 @@ +qdisc bfifo 1: root refcnt 2 limit 10Kb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.pcap new file mode 100644 index 000000000..7d339e857 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/netlink_route_dump.pcap new file mode 100644 index 000000000..945c7ffa7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-010/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/cmd.json new file mode 100644 index 000000000..63846e20c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "bfifo-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: bfifo limit 10kb" + }, + "cmd": "tc qdisc link dev d0 root handle 1: bfifo limit 10kb", + "desc": "corner: opt=plain cmd=bfifo-link:qdisc_link_dev_d0_root_handle_1:_bfifo_limit_10kb", + "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": "tcqwrite/ec-011", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: bfifo" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: bfifo", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/dump.out new file mode 100644 index 000000000..884be0daa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/dump.out @@ -0,0 +1 @@ +qdisc bfifo 1: root refcnt 2 limit 10Kb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.pcap new file mode 100644 index 000000000..44cf9b098 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/netlink_route_dump.pcap new file mode 100644 index 000000000..3f63a3f7b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-011/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/cmd.json new file mode 100644 index 000000000..4c3ff4af6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "bfifo-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=bfifo-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-012", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: bfifo" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: bfifo", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.pcap new file mode 100644 index 000000000..f8553400e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/netlink_route_dump.pcap new file mode 100644 index 000000000..5fdc2fdb9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-012/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/cmd.json new file mode 100644 index 000000000..efd98611e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "phd0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: pfifo_head_drop limit 50" + }, + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50", + "desc": "positive: opt=plain cmd=phd0:qdisc_add_dev_d0_root_handle_1:_pfifo_head_drop_limit_50", + "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": "tcqwrite/ec-013", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/dump.out new file mode 100644 index 000000000..708a6f4f1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/dump.out @@ -0,0 +1 @@ +qdisc pfifo_head_drop 1: root refcnt 2 limit 50p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.pcap new file mode 100644 index 000000000..2fc258ea9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/netlink_route_dump.pcap new file mode 100644 index 000000000..89e1019ea Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-013/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/cmd.json new file mode 100644 index 000000000..c86f7b9cb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "phd-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: pfifo_head_drop limit 50" + }, + "cmd": "tc qdisc change dev d0 root handle 1: pfifo_head_drop limit 50", + "desc": "positive: opt=plain cmd=phd-change:qdisc_change_dev_d0_root_handle_1:_pfifo_head_drop_limit_50", + "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": "tcqwrite/ec-014", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/dump.out new file mode 100644 index 000000000..708a6f4f1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/dump.out @@ -0,0 +1 @@ +qdisc pfifo_head_drop 1: root refcnt 2 limit 50p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.pcap new file mode 100644 index 000000000..d1de3c497 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/netlink_route_dump.pcap new file mode 100644 index 000000000..68a148f36 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-014/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/cmd.json new file mode 100644 index 000000000..e4486975b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "phd-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: pfifo_head_drop limit 50" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: pfifo_head_drop limit 50", + "desc": "positive: opt=plain cmd=phd-replace:qdisc_replace_dev_d0_root_handle_1:_pfifo_head_drop_limit_50", + "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": "tcqwrite/ec-015", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/dump.out new file mode 100644 index 000000000..708a6f4f1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/dump.out @@ -0,0 +1 @@ +qdisc pfifo_head_drop 1: root refcnt 2 limit 50p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.pcap new file mode 100644 index 000000000..3e1072922 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/netlink_route_dump.pcap new file mode 100644 index 000000000..aa37802b0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-015/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/cmd.json new file mode 100644 index 000000000..cb8150a56 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "phd-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: pfifo_head_drop limit 50" + }, + "cmd": "tc qdisc link dev d0 root handle 1: pfifo_head_drop limit 50", + "desc": "corner: opt=plain cmd=phd-link:qdisc_link_dev_d0_root_handle_1:_pfifo_head_drop_limit_50", + "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": "tcqwrite/ec-016", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/dump.out new file mode 100644 index 000000000..708a6f4f1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/dump.out @@ -0,0 +1 @@ +qdisc pfifo_head_drop 1: root refcnt 2 limit 50p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.pcap new file mode 100644 index 000000000..e92bac0cd Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/netlink_route_dump.pcap new file mode 100644 index 000000000..4d4651e91 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-016/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/cmd.json new file mode 100644 index 000000000..d58cce285 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "phd-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=phd-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-017", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_head_drop limit 50", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.pcap new file mode 100644 index 000000000..0c1d36721 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/netlink_route_dump.pcap new file mode 100644 index 000000000..d174940d7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-017/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/cmd.json new file mode 100644 index 000000000..29dc9a5a8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "prio0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: prio" + }, + "cmd": "tc qdisc add dev d0 root handle 1: prio", + "desc": "positive: opt=plain cmd=prio0:qdisc_add_dev_d0_root_handle_1:_prio", + "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": "tcqwrite/ec-018", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/dump.out new file mode 100644 index 000000000..71fdfe93b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/dump.out @@ -0,0 +1 @@ +qdisc prio 1: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.pcap new file mode 100644 index 000000000..ef3dab3e9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/netlink_route_dump.pcap new file mode 100644 index 000000000..8341e67da Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-018/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/cmd.json new file mode 100644 index 000000000..c76d59548 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "prio1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: prio bands 5" + }, + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 5", + "desc": "positive: opt=plain cmd=prio1:qdisc_add_dev_d0_root_handle_1:_prio_bands_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": "tcqwrite/ec-019", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/dump.out new file mode 100644 index 000000000..96dddda0f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/dump.out @@ -0,0 +1 @@ +qdisc prio 1: root refcnt 2 bands 5 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.pcap new file mode 100644 index 000000000..e016f3f43 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/netlink_route_dump.pcap new file mode 100644 index 000000000..ab44482f4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-019/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/cmd.json new file mode 100644 index 000000000..035c03520 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "prio2", + "json": "0", + "words": "qdisc add dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1" + }, + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + "desc": "positive: opt=plain cmd=prio2:qdisc_add_dev_d0_root_handle_1:_prio_bands_3_priomap_0_1_2_2_1_2_0_0_1_1_1_1_1_1_1_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": "tcqwrite/ec-020", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/dump.out new file mode 100644 index 000000000..5c0348378 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/dump.out @@ -0,0 +1 @@ +qdisc prio 1: root refcnt 2 bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.pcap new file mode 100644 index 000000000..f4d0e2596 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/netlink_route_dump.pcap new file mode 100644 index 000000000..cb7cca236 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-020/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/cmd.json new file mode 100644 index 000000000..144663ff1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "prio-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1" + }, + "cmd": "tc qdisc change dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + "desc": "positive: opt=plain cmd=prio-change:qdisc_change_dev_d0_root_handle_1:_prio_bands_3_priomap_0_1_2_2_1_2_0_0_1_1_1_1_1_1_1_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": "tcqwrite/ec-021", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/dump.out new file mode 100644 index 000000000..5c0348378 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/dump.out @@ -0,0 +1 @@ +qdisc prio 1: root refcnt 2 bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.pcap new file mode 100644 index 000000000..81513ebe0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/netlink_route_dump.pcap new file mode 100644 index 000000000..515681cf9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-021/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/cmd.json new file mode 100644 index 000000000..dbd7d5f84 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "prio-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + "desc": "positive: opt=plain cmd=prio-replace:qdisc_replace_dev_d0_root_handle_1:_prio_bands_3_priomap_0_1_2_2_1_2_0_0_1_1_1_1_1_1_1_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": "tcqwrite/ec-022", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/dump.out new file mode 100644 index 000000000..5c0348378 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/dump.out @@ -0,0 +1 @@ +qdisc prio 1: root refcnt 2 bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.pcap new file mode 100644 index 000000000..170f94f5d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/netlink_route_dump.pcap new file mode 100644 index 000000000..d17924b9a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-022/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/cmd.json new file mode 100644 index 000000000..e2294606f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "prio-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1" + }, + "cmd": "tc qdisc link dev d0 root handle 1: prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + "desc": "corner: opt=plain cmd=prio-link:qdisc_link_dev_d0_root_handle_1:_prio_bands_3_priomap_0_1_2_2_1_2_0_0_1_1_1_1_1_1_1_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": "tcqwrite/ec-023", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/dump.out new file mode 100644 index 000000000..5c0348378 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/dump.out @@ -0,0 +1 @@ +qdisc prio 1: root refcnt 2 bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.pcap new file mode 100644 index 000000000..196fae590 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/netlink_route_dump.pcap new file mode 100644 index 000000000..d2c9b2ffb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-023/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/cmd.json new file mode 100644 index 000000000..520465df2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "prio-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=prio-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-024", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.pcap new file mode 100644 index 000000000..a7aa3df5b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/netlink_route_dump.pcap new file mode 100644 index 000000000..4055019b1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-024/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/cmd.json new file mode 100644 index 000000000..682ecea7a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "pfast0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: pfifo_fast" + }, + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_fast", + "desc": "positive: opt=plain cmd=pfast0:qdisc_add_dev_d0_root_handle_1:_pfifo_fast", + "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": "tcqwrite/ec-025", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/dump.out new file mode 100644 index 000000000..21dfd0c34 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/dump.out @@ -0,0 +1 @@ +qdisc pfifo_fast 1: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.pcap new file mode 100644 index 000000000..90f36213a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/netlink_route_dump.pcap new file mode 100644 index 000000000..c1c1658c0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-025/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/cmd.json new file mode 100644 index 000000000..c6c3a1836 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "pfast-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: pfifo_fast" + }, + "cmd": "tc qdisc change dev d0 root handle 1: pfifo_fast", + "desc": "positive: opt=plain cmd=pfast-change:qdisc_change_dev_d0_root_handle_1:_pfifo_fast", + "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": "tcqwrite/ec-026", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo_fast" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_fast", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/dump.out new file mode 100644 index 000000000..21dfd0c34 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/dump.out @@ -0,0 +1 @@ +qdisc pfifo_fast 1: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.pcap new file mode 100644 index 000000000..5621e4588 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/netlink_route_dump.pcap new file mode 100644 index 000000000..d2674c85e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-026/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/cmd.json new file mode 100644 index 000000000..498e9248b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "pfast-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: pfifo_fast" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: pfifo_fast", + "desc": "positive: opt=plain cmd=pfast-replace:qdisc_replace_dev_d0_root_handle_1:_pfifo_fast", + "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": "tcqwrite/ec-027", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo_fast" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_fast", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/dump.out new file mode 100644 index 000000000..21dfd0c34 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/dump.out @@ -0,0 +1 @@ +qdisc pfifo_fast 1: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.pcap new file mode 100644 index 000000000..f2f4b2665 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/netlink_route_dump.pcap new file mode 100644 index 000000000..b6a1ee6b8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-027/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/cmd.json new file mode 100644 index 000000000..1816bd1d1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "pfast-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: pfifo_fast" + }, + "cmd": "tc qdisc link dev d0 root handle 1: pfifo_fast", + "desc": "corner: opt=plain cmd=pfast-link:qdisc_link_dev_d0_root_handle_1:_pfifo_fast", + "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": "tcqwrite/ec-028", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo_fast" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_fast", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/dump.out new file mode 100644 index 000000000..21dfd0c34 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/dump.out @@ -0,0 +1 @@ +qdisc pfifo_fast 1: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.pcap new file mode 100644 index 000000000..213b4895a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/netlink_route_dump.pcap new file mode 100644 index 000000000..ce622880a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-028/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/cmd.json new file mode 100644 index 000000000..0ed11c2cd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "pfast-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=pfast-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-029", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo_fast" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo_fast", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.pcap new file mode 100644 index 000000000..c8ac1647f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/netlink_route_dump.pcap new file mode 100644 index 000000000..9ee245b47 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-029/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/cmd.json new file mode 100644 index 000000000..6a9184245 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "fqcodel0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: fq_codel" + }, + "cmd": "tc qdisc add dev d0 root handle 1: fq_codel", + "desc": "positive: opt=plain cmd=fqcodel0:qdisc_add_dev_d0_root_handle_1:_fq_codel", + "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": "tcqwrite/ec-030", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/dump.out new file mode 100644 index 000000000..23dd9f8c2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/dump.out @@ -0,0 +1 @@ +qdisc fq_codel 1: root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.pcap new file mode 100644 index 000000000..542679c27 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/netlink_route_dump.pcap new file mode 100644 index 000000000..529641657 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-030/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/cmd.json new file mode 100644 index 000000000..0f3b39668 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "fqcodel1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: fq_codel limit 1000 flows 512 target 4ms interval 50ms quantum 1514 ecn" + }, + "cmd": "tc qdisc add dev d0 root handle 1: fq_codel limit 1000 flows 512 target 4ms interval 50ms quantum 1514 ecn", + "desc": "positive: opt=plain cmd=fqcodel1:qdisc_add_dev_d0_root_handle_1:_fq_codel_limit_1000_flows_512_target_4ms_interval_50ms_quantum_1514_ecn", + "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": "tcqwrite/ec-031", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/dump.out new file mode 100644 index 000000000..d6f694b8b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/dump.out @@ -0,0 +1 @@ +qdisc fq_codel 1: root refcnt 2 limit 1000p flows 512 quantum 1514 target 4ms interval 50ms memory_limit 32Mb ecn drop_batch 64 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.pcap new file mode 100644 index 000000000..dbc852af5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/netlink_route_dump.pcap new file mode 100644 index 000000000..af3f15a07 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-031/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/cmd.json new file mode 100644 index 000000000..4c9ec5076 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "fqcodel2", + "json": "0", + "words": "qdisc add dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32" + }, + "cmd": "tc qdisc add dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32", + "desc": "positive: opt=plain cmd=fqcodel2:qdisc_add_dev_d0_root_handle_1:_fq_codel_noecn_ce_threshold_2ms_ce_threshold_selector_0x01/0x03_memory_limit_16Mb_drop_batch_32", + "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": "tcqwrite/ec-032", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/dump.out new file mode 100644 index 000000000..3006dc016 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/dump.out @@ -0,0 +1 @@ +qdisc fq_codel 1: root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms ce_threshold 2ms ce_threshold_selector 0x1/0x3 interval 100ms memory_limit 16Mb drop_batch 32 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.pcap new file mode 100644 index 000000000..b1cabe474 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/netlink_route_dump.pcap new file mode 100644 index 000000000..2377fdf34 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-032/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/cmd.json new file mode 100644 index 000000000..8fdb0bb07 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "fqcodel-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32" + }, + "cmd": "tc qdisc change dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32", + "desc": "positive: opt=plain cmd=fqcodel-change:qdisc_change_dev_d0_root_handle_1:_fq_codel_noecn_ce_threshold_2ms_ce_threshold_selector_0x01/0x03_memory_limit_16Mb_drop_batch_32", + "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": "tcqwrite/ec-033", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: fq_codel" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: fq_codel", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/dump.out new file mode 100644 index 000000000..3006dc016 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/dump.out @@ -0,0 +1 @@ +qdisc fq_codel 1: root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms ce_threshold 2ms ce_threshold_selector 0x1/0x3 interval 100ms memory_limit 16Mb drop_batch 32 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.pcap new file mode 100644 index 000000000..91d1283ea Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/netlink_route_dump.pcap new file mode 100644 index 000000000..1b8bddeb1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-033/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/cmd.json new file mode 100644 index 000000000..cc6bbb19c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "fqcodel-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32", + "desc": "positive: opt=plain cmd=fqcodel-replace:qdisc_replace_dev_d0_root_handle_1:_fq_codel_noecn_ce_threshold_2ms_ce_threshold_selector_0x01/0x03_memory_limit_16Mb_drop_batch_32", + "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": "tcqwrite/ec-034", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: fq_codel" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: fq_codel", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/dump.out new file mode 100644 index 000000000..3006dc016 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/dump.out @@ -0,0 +1 @@ +qdisc fq_codel 1: root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms ce_threshold 2ms ce_threshold_selector 0x1/0x3 interval 100ms memory_limit 16Mb drop_batch 32 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.pcap new file mode 100644 index 000000000..0bf3aaabc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/netlink_route_dump.pcap new file mode 100644 index 000000000..56efd0761 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-034/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/cmd.json new file mode 100644 index 000000000..e12c2d429 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "fqcodel-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32" + }, + "cmd": "tc qdisc link dev d0 root handle 1: fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32", + "desc": "corner: opt=plain cmd=fqcodel-link:qdisc_link_dev_d0_root_handle_1:_fq_codel_noecn_ce_threshold_2ms_ce_threshold_selector_0x01/0x03_memory_limit_16Mb_drop_batch_32", + "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": "tcqwrite/ec-035", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: fq_codel" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: fq_codel", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/dump.out new file mode 100644 index 000000000..3006dc016 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/dump.out @@ -0,0 +1 @@ +qdisc fq_codel 1: root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms ce_threshold 2ms ce_threshold_selector 0x1/0x3 interval 100ms memory_limit 16Mb drop_batch 32 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.pcap new file mode 100644 index 000000000..7b0cfe9dd Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/netlink_route_dump.pcap new file mode 100644 index 000000000..793c96ae5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-035/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/cmd.json new file mode 100644 index 000000000..fcd74d368 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "fqcodel-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=fqcodel-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-036", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: fq_codel" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: fq_codel", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.pcap new file mode 100644 index 000000000..eccd054c1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/netlink_route_dump.pcap new file mode 100644 index 000000000..11576e60b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-036/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/cmd.json new file mode 100644 index 000000000..42afe2b8a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "fq0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: fq" + }, + "cmd": "tc qdisc add dev d0 root handle 1: fq", + "desc": "positive: opt=plain cmd=fq0:qdisc_add_dev_d0_root_handle_1:_fq", + "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": "tcqwrite/ec-037", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/dump.out new file mode 100644 index 000000000..c229159f4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/dump.out @@ -0,0 +1 @@ +qdisc fq 1: root refcnt 2 limit 10000p flow_limit 100p buckets 1024 orphan_mask 1023 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 quantum 3028b initial_quantum 15140b low_rate_threshold 550Kbit refill_delay 40ms timer_slack 10us horizon 10s horizon_drop offload_horizon 0us diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.pcap new file mode 100644 index 000000000..96f154e17 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/netlink_route_dump.pcap new file mode 100644 index 000000000..2d835ce8f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-037/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/cmd.json new file mode 100644 index 000000000..d8522c0c7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "fq1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: fq limit 1000 flow_limit 50 quantum 3028 initial_quantum 15140 maxrate 1gbit buckets 256 nopacing" + }, + "cmd": "tc qdisc add dev d0 root handle 1: fq limit 1000 flow_limit 50 quantum 3028 initial_quantum 15140 maxrate 1gbit buckets 256 nopacing", + "desc": "positive: opt=plain cmd=fq1:qdisc_add_dev_d0_root_handle_1:_fq_limit_1000_flow_limit_50_quantum_3028_initial_quantum_15140_maxrate_1gbit_buckets_256_nopacing", + "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": "tcqwrite/ec-038", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/dump.out new file mode 100644 index 000000000..9f5fd3d8a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/dump.out @@ -0,0 +1 @@ +qdisc fq 1: root refcnt 2 limit 1000p flow_limit 50p buckets 256 orphan_mask 1023 nopacing bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 quantum 3028b initial_quantum 15140b maxrate 1Gbit low_rate_threshold 550Kbit refill_delay 40ms timer_slack 10us horizon 10s horizon_drop offload_horizon 0us diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.pcap new file mode 100644 index 000000000..4fe9ea527 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/netlink_route_dump.pcap new file mode 100644 index 000000000..70b03e04b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-038/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/cmd.json new file mode 100644 index 000000000..361ab0e3c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "fq2", + "json": "0", + "words": "qdisc add dev d0 root handle 1: fq pacing refill_delay 50ms low_rate_threshold 1Mbit orphan_mask 511 timer_slack 20us ce_threshold 4ms horizon 2s horizon_drop" + }, + "cmd": "tc qdisc add dev d0 root handle 1: fq pacing refill_delay 50ms low_rate_threshold 1Mbit orphan_mask 511 timer_slack 20us ce_threshold 4ms horizon 2s horizon_drop", + "desc": "positive: opt=plain cmd=fq2:qdisc_add_dev_d0_root_handle_1:_fq_pacing_refill_delay_50ms_low_rate_threshold_1Mbit_orphan_mask_511_timer_slack_20us_ce_threshold_4ms_horizon_2s_horizon_drop", + "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": "tcqwrite/ec-039", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/dump.out new file mode 100644 index 000000000..33549c658 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/dump.out @@ -0,0 +1 @@ +qdisc fq 1: root refcnt 2 limit 10000p flow_limit 100p buckets 1024 orphan_mask 511 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 quantum 3028b initial_quantum 15140b low_rate_threshold 1Mbit refill_delay 50ms ce_threshold 4ms timer_slack 20us horizon 2s horizon_drop offload_horizon 0us diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.pcap new file mode 100644 index 000000000..a11318ac0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/netlink_route_dump.pcap new file mode 100644 index 000000000..3bf564e5d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-039/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/cmd.json new file mode 100644 index 000000000..f54aaffdb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "fq3", + "json": "0", + "words": "qdisc add dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1" + }, + "cmd": "tc qdisc add dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + "desc": "positive: opt=plain cmd=fq3:qdisc_add_dev_d0_root_handle_1:_fq_horizon_cap_weights_589824_196608_65536_bands_3_priomap_1_2_2_2_1_2_0_0_1_1_1_1_1_1_1_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": "tcqwrite/ec-040", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/dump.out new file mode 100644 index 000000000..e2fd9c035 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/dump.out @@ -0,0 +1 @@ +qdisc fq 1: root refcnt 2 limit 10000p flow_limit 100p buckets 1024 orphan_mask 1023 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 quantum 3028b initial_quantum 15140b low_rate_threshold 550Kbit refill_delay 40ms timer_slack 10us horizon 10s horizon_cap offload_horizon 0us diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.pcap new file mode 100644 index 000000000..e5600b13f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/netlink_route_dump.pcap new file mode 100644 index 000000000..15c95aad2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-040/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/cmd.json new file mode 100644 index 000000000..3102f5f2c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "fq-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1" + }, + "cmd": "tc qdisc change dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + "desc": "positive: opt=plain cmd=fq-change:qdisc_change_dev_d0_root_handle_1:_fq_horizon_cap_weights_589824_196608_65536_bands_3_priomap_1_2_2_2_1_2_0_0_1_1_1_1_1_1_1_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": "tcqwrite/ec-041", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: fq" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: fq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/dump.out new file mode 100644 index 000000000..e2fd9c035 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/dump.out @@ -0,0 +1 @@ +qdisc fq 1: root refcnt 2 limit 10000p flow_limit 100p buckets 1024 orphan_mask 1023 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 quantum 3028b initial_quantum 15140b low_rate_threshold 550Kbit refill_delay 40ms timer_slack 10us horizon 10s horizon_cap offload_horizon 0us diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.pcap new file mode 100644 index 000000000..b601d1212 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/netlink_route_dump.pcap new file mode 100644 index 000000000..d3ecd7ca9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-041/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/cmd.json new file mode 100644 index 000000000..5eea2e085 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "fq-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + "desc": "positive: opt=plain cmd=fq-replace:qdisc_replace_dev_d0_root_handle_1:_fq_horizon_cap_weights_589824_196608_65536_bands_3_priomap_1_2_2_2_1_2_0_0_1_1_1_1_1_1_1_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": "tcqwrite/ec-042", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: fq" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: fq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/dump.out new file mode 100644 index 000000000..e2fd9c035 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/dump.out @@ -0,0 +1 @@ +qdisc fq 1: root refcnt 2 limit 10000p flow_limit 100p buckets 1024 orphan_mask 1023 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 quantum 3028b initial_quantum 15140b low_rate_threshold 550Kbit refill_delay 40ms timer_slack 10us horizon 10s horizon_cap offload_horizon 0us diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.pcap new file mode 100644 index 000000000..91433d0af Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/netlink_route_dump.pcap new file mode 100644 index 000000000..8a9d2fad9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-042/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/cmd.json new file mode 100644 index 000000000..bca59e660 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "fq-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1" + }, + "cmd": "tc qdisc link dev d0 root handle 1: fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + "desc": "corner: opt=plain cmd=fq-link:qdisc_link_dev_d0_root_handle_1:_fq_horizon_cap_weights_589824_196608_65536_bands_3_priomap_1_2_2_2_1_2_0_0_1_1_1_1_1_1_1_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": "tcqwrite/ec-043", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: fq" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: fq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/dump.out new file mode 100644 index 000000000..e2fd9c035 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/dump.out @@ -0,0 +1 @@ +qdisc fq 1: root refcnt 2 limit 10000p flow_limit 100p buckets 1024 orphan_mask 1023 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 quantum 3028b initial_quantum 15140b low_rate_threshold 550Kbit refill_delay 40ms timer_slack 10us horizon 10s horizon_cap offload_horizon 0us diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.pcap new file mode 100644 index 000000000..1dd7acb07 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/netlink_route_dump.pcap new file mode 100644 index 000000000..d0b0705f6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-043/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/cmd.json new file mode 100644 index 000000000..793a58b04 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "fq-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=fq-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-044", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: fq" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: fq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.pcap new file mode 100644 index 000000000..dbd39c2b1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/netlink_route_dump.pcap new file mode 100644 index 000000000..8efcebca4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-044/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/cmd.json new file mode 100644 index 000000000..86e8c1f47 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "htb0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: htb" + }, + "cmd": "tc qdisc add dev d0 root handle 1: htb", + "desc": "positive: opt=plain cmd=htb0:qdisc_add_dev_d0_root_handle_1:_htb", + "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": "tcqwrite/ec-045", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/dump.out new file mode 100644 index 000000000..cc49b7323 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.pcap new file mode 100644 index 000000000..f7d27dc24 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/netlink_route_dump.pcap new file mode 100644 index 000000000..686e36c0e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-045/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/cmd.json new file mode 100644 index 000000000..6cf61bb56 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "htb1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: htb default 10 r2q 20" + }, + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10 r2q 20", + "desc": "positive: opt=plain cmd=htb1:qdisc_add_dev_d0_root_handle_1:_htb_default_10_r2q_20", + "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": "tcqwrite/ec-046", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/dump.out new file mode 100644 index 000000000..4814aa38b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 20 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.pcap new file mode 100644 index 000000000..236b78bec Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/netlink_route_dump.pcap new file mode 100644 index 000000000..200d1f252 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-046/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/cmd.json new file mode 100644 index 000000000..6ecfc057e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "htb2", + "json": "0", + "words": "qdisc add dev d0 root handle 1: htb direct_qlen 50" + }, + "cmd": "tc qdisc add dev d0 root handle 1: htb direct_qlen 50", + "desc": "positive: opt=plain cmd=htb2:qdisc_add_dev_d0_root_handle_1:_htb_direct_qlen_50", + "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": "tcqwrite/ec-047", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/dump.out new file mode 100644 index 000000000..f7c58752f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0 direct_packets_stat 0 ver 3.17 direct_qlen 50 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.pcap new file mode 100644 index 000000000..58e5e69bc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/netlink_route_dump.pcap new file mode 100644 index 000000000..21cc27dfa Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-047/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/cmd.json new file mode 100644 index 000000000..c189d359b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "htb-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=htb-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-048", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.pcap new file mode 100644 index 000000000..6aa2ca5d1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/netlink_route_dump.pcap new file mode 100644 index 000000000..9fb3ab613 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-048/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/cmd.json new file mode 100644 index 000000000..a36934a3d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "tbf0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms" + }, + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms", + "desc": "positive: opt=plain cmd=tbf0:qdisc_add_dev_d0_root_handle_1:_tbf_rate_1mbit_burst_10kb_latency_50ms", + "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": "tcqwrite/ec-049", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/dump.out new file mode 100644 index 000000000..b72ac50cd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/dump.out @@ -0,0 +1 @@ +qdisc tbf 1: root refcnt 2 rate 1Mbit burst 10Kb/1 mpu 0b lat 50ms linklayer ethernet diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.pcap new file mode 100644 index 000000000..116934be4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/netlink_route_dump.pcap new file mode 100644 index 000000000..8993a97dc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-049/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/cmd.json new file mode 100644 index 000000000..afb365744 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "tbf1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: tbf rate 10mbit burst 20kb/8 limit 30000 peakrate 12mbit mtu 2000 mpu 64" + }, + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 10mbit burst 20kb/8 limit 30000 peakrate 12mbit mtu 2000 mpu 64", + "desc": "positive: opt=plain cmd=tbf1:qdisc_add_dev_d0_root_handle_1:_tbf_rate_10mbit_burst_20kb/8_limit_30000_peakrate_12mbit_mtu_2000_mpu_64", + "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": "tcqwrite/ec-050", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/dump.out new file mode 100644 index 000000000..7e1b01577 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/dump.out @@ -0,0 +1 @@ +qdisc tbf 1: root refcnt 2 rate 10Mbit burst 20Kb/1 mpu 64b peakrate 12Mbit mtu 1999b/1 mpu 64b lat 18.7ms linklayer ethernet diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.pcap new file mode 100644 index 000000000..3d77c1490 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/netlink_route_dump.pcap new file mode 100644 index 000000000..670c5adc3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-050/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/cmd.json new file mode 100644 index 000000000..5f81da729 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "tbf2", + "json": "0", + "words": "qdisc add dev d0 root handle 1: tbf rate 5gbit burst 1mb latency 1s" + }, + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 5gbit burst 1mb latency 1s", + "desc": "positive: opt=plain cmd=tbf2:qdisc_add_dev_d0_root_handle_1:_tbf_rate_5gbit_burst_1mb_latency_1s", + "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": "tcqwrite/ec-051", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/dump.out new file mode 100644 index 000000000..d9e907c2a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/dump.out @@ -0,0 +1 @@ +qdisc tbf 1: root refcnt 2 rate 5Gbit burst 1048560b/1 mpu 0b lat 1s linklayer ethernet diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.pcap new file mode 100644 index 000000000..1003a2f81 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/netlink_route_dump.pcap new file mode 100644 index 000000000..a0922f3ab Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-051/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/cmd.json new file mode 100644 index 000000000..dce00aa51 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "tbf3", + "json": "0", + "words": "qdisc add dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10" + }, + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10", + "desc": "positive: opt=plain cmd=tbf3:qdisc_add_dev_d0_root_handle_1:_tbf_rate_1Mbps_burst_10k_latency_70ms_linklayer_atm_overhead_10", + "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": "tcqwrite/ec-052", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/dump.out new file mode 100644 index 000000000..42bda55fa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/dump.out @@ -0,0 +1 @@ +qdisc tbf 1: root refcnt 2 rate 8Mbit burst 11341b/1 mpu 0b lat 68.9ms overhead 10 linklayer atm diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.pcap new file mode 100644 index 000000000..16b91e7db Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/netlink_route_dump.pcap new file mode 100644 index 000000000..36a53ad03 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-052/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/cmd.json new file mode 100644 index 000000000..4ad39b519 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "tbf-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10" + }, + "cmd": "tc qdisc change dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10", + "desc": "positive: opt=plain cmd=tbf-change:qdisc_change_dev_d0_root_handle_1:_tbf_rate_1Mbps_burst_10k_latency_70ms_linklayer_atm_overhead_10", + "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": "tcqwrite/ec-053", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/dump.out new file mode 100644 index 000000000..42bda55fa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/dump.out @@ -0,0 +1 @@ +qdisc tbf 1: root refcnt 2 rate 8Mbit burst 11341b/1 mpu 0b lat 68.9ms overhead 10 linklayer atm diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.pcap new file mode 100644 index 000000000..5d6a26f7e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/netlink_route_dump.pcap new file mode 100644 index 000000000..eb37fc7f3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-053/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/cmd.json new file mode 100644 index 000000000..1aea61e81 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "tbf-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10", + "desc": "positive: opt=plain cmd=tbf-replace:qdisc_replace_dev_d0_root_handle_1:_tbf_rate_1Mbps_burst_10k_latency_70ms_linklayer_atm_overhead_10", + "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": "tcqwrite/ec-054", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/dump.out new file mode 100644 index 000000000..42bda55fa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/dump.out @@ -0,0 +1 @@ +qdisc tbf 1: root refcnt 2 rate 8Mbit burst 11341b/1 mpu 0b lat 68.9ms overhead 10 linklayer atm diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.pcap new file mode 100644 index 000000000..a765cec43 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/netlink_route_dump.pcap new file mode 100644 index 000000000..ea58a7efc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-054/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/cmd.json new file mode 100644 index 000000000..d0b109c48 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "tbf-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10" + }, + "cmd": "tc qdisc link dev d0 root handle 1: tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10", + "desc": "corner: opt=plain cmd=tbf-link:qdisc_link_dev_d0_root_handle_1:_tbf_rate_1Mbps_burst_10k_latency_70ms_linklayer_atm_overhead_10", + "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": "tcqwrite/ec-055", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/dump.out new file mode 100644 index 000000000..42bda55fa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/dump.out @@ -0,0 +1 @@ +qdisc tbf 1: root refcnt 2 rate 8Mbit burst 11341b/1 mpu 0b lat 68.9ms overhead 10 linklayer atm diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.pcap new file mode 100644 index 000000000..83768cd7c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/netlink_route_dump.pcap new file mode 100644 index 000000000..c2d6dd7eb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-055/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/cmd.json new file mode 100644 index 000000000..6ead06ae9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "tbf-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=tbf-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-056", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 1mbit burst 10kb latency 50ms", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.pcap new file mode 100644 index 000000000..6c93554ea Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/netlink_route_dump.pcap new file mode 100644 index 000000000..8d6e10fb5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-056/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/cmd.json new file mode 100644 index 000000000..137da7c44 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "sfq0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: sfq" + }, + "cmd": "tc qdisc add dev d0 root handle 1: sfq", + "desc": "positive: opt=plain cmd=sfq0:qdisc_add_dev_d0_root_handle_1:_sfq", + "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": "tcqwrite/ec-057", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/dump.out new file mode 100644 index 000000000..a5a6af152 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/dump.out @@ -0,0 +1 @@ +qdisc sfq 1: root refcnt 2 limit 127p quantum 1514b depth 127 flows 128 divisor 1024 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.pcap new file mode 100644 index 000000000..dbf10498f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/netlink_route_dump.pcap new file mode 100644 index 000000000..6e7c046cb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-057/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/cmd.json new file mode 100644 index 000000000..a12e76cf6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "sfq1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: sfq perturb 10 quantum 1514 limit 100 divisor 512 depth 64 flows 128" + }, + "cmd": "tc qdisc add dev d0 root handle 1: sfq perturb 10 quantum 1514 limit 100 divisor 512 depth 64 flows 128", + "desc": "positive: opt=plain cmd=sfq1:qdisc_add_dev_d0_root_handle_1:_sfq_perturb_10_quantum_1514_limit_100_divisor_512_depth_64_flows_128", + "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": "tcqwrite/ec-058", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/dump.out new file mode 100644 index 000000000..02fb92dba --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/dump.out @@ -0,0 +1 @@ +qdisc sfq 1: root refcnt 2 limit 100p quantum 1514b depth 64 flows 100 divisor 512 perturb 10sec diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.pcap new file mode 100644 index 000000000..775f86b84 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/netlink_route_dump.pcap new file mode 100644 index 000000000..0fbfa3efe Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-058/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/cmd.json new file mode 100644 index 000000000..d8ba22319 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "sfq2", + "json": "0", + "words": "qdisc add dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop" + }, + "cmd": "tc qdisc add dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop", + "desc": "positive: opt=plain cmd=sfq2:qdisc_add_dev_d0_root_handle_1:_sfq_headdrop_redflowlimit_100000_min_8000_max_60000_probability_0.2_ecn_harddrop", + "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": "tcqwrite/ec-059", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/dump.out new file mode 100644 index 000000000..65c47fe3d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/dump.out @@ -0,0 +1 @@ +qdisc sfq 1: root refcnt 2 limit 127p quantum 1514b depth 127 headdrop flows 128 divisor 1024 ewma 6 min 8000b max 60000b probability 0.2 ecn harddrop diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.pcap new file mode 100644 index 000000000..43b6f5bd6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/netlink_route_dump.pcap new file mode 100644 index 000000000..32a76f058 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-059/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/cmd.json new file mode 100644 index 000000000..f1a6ca5af --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "sfq-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=sfq-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-060", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: sfq" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: sfq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.pcap new file mode 100644 index 000000000..7073e0d8b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/netlink_route_dump.pcap new file mode 100644 index 000000000..7bcf64c0c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-060/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/cmd.json new file mode 100644 index 000000000..f3fac9258 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "netem0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: netem delay 100ms" + }, + "cmd": "tc qdisc add dev d0 root handle 1: netem delay 100ms", + "desc": "positive: opt=plain cmd=netem0:qdisc_add_dev_d0_root_handle_1:_netem_delay_100ms", + "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": "tcqwrite/ec-061", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/dump.out new file mode 100644 index 000000000..46f280cb0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 delay 100ms seed 15935940498068675919 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.pcap new file mode 100644 index 000000000..da4511048 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/netlink_route_dump.pcap new file mode 100644 index 000000000..3bb813a59 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-061/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/cmd.json new file mode 100644 index 000000000..b297d3a6a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "netem1", + "json": "0", + "words": "qdisc add dev d0 root handle 1: netem delay 100ms 10ms 25% loss 1% 30% duplicate 1% corrupt 0.1% reorder 25% 50% gap 5" + }, + "cmd": "tc qdisc add dev d0 root handle 1: netem delay 100ms 10ms 25% loss 1% 30% duplicate 1% corrupt 0.1% reorder 25% 50% gap 5", + "desc": "positive: opt=plain cmd=netem1:qdisc_add_dev_d0_root_handle_1:_netem_delay_100ms_10ms_25%_loss_1%_30%_duplicate_1%_corrupt_0.1%_reorder_25%_50%_gap_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": "tcqwrite/ec-062", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/dump.out new file mode 100644 index 000000000..edb9ed5b3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 delay 100ms 10ms 25% loss 1% 30% duplicate 1% reorder 25% 50% corrupt 0.1% seed 11255792698487226846 gap 5 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.pcap new file mode 100644 index 000000000..494f5a418 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/netlink_route_dump.pcap new file mode 100644 index 000000000..23cc072a4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-062/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/cmd.json new file mode 100644 index 000000000..c662506e2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "netem2", + "json": "0", + "words": "qdisc add dev d0 root handle 1: netem delay 10ms 2ms distribution normal" + }, + "cmd": "tc qdisc add dev d0 root handle 1: netem delay 10ms 2ms distribution normal", + "desc": "positive: opt=plain cmd=netem2:qdisc_add_dev_d0_root_handle_1:_netem_delay_10ms_2ms_distribution_normal", + "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": "tcqwrite/ec-063", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/dump.out new file mode 100644 index 000000000..d29d10d36 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 delay 10ms 2ms seed 17258008760526509008 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.pcap new file mode 100644 index 000000000..17d0b8682 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/netlink_route_dump.pcap new file mode 100644 index 000000000..4f1393c37 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-063/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/cmd.json new file mode 100644 index 000000000..d9bfddd0e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "netem3", + "json": "0", + "words": "qdisc add dev d0 root handle 1: netem loss state 1% 10% 5% 1% 2% limit 3000" + }, + "cmd": "tc qdisc add dev d0 root handle 1: netem loss state 1% 10% 5% 1% 2% limit 3000", + "desc": "positive: opt=plain cmd=netem3:qdisc_add_dev_d0_root_handle_1:_netem_loss_state_1%_10%_5%_1%_2%_limit_3000", + "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": "tcqwrite/ec-064", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/dump.out new file mode 100644 index 000000000..305b24aa5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 3000 loss state p13 1% p31 10% p32 5% p23 1% p14 2% seed 1798519198338223345 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.pcap new file mode 100644 index 000000000..9077d9583 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/netlink_route_dump.pcap new file mode 100644 index 000000000..0599abf3c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-064/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/cmd.json new file mode 100644 index 000000000..92ee99e3b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "netem4", + "json": "0", + "words": "qdisc add dev d0 root handle 1: netem loss gemodel 1% 10% 70% 0.1% ecn" + }, + "cmd": "tc qdisc add dev d0 root handle 1: netem loss gemodel 1% 10% 70% 0.1% ecn", + "desc": "positive: opt=plain cmd=netem4:qdisc_add_dev_d0_root_handle_1:_netem_loss_gemodel_1%_10%_70%_0.1%_ecn", + "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": "tcqwrite/ec-065", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/dump.out new file mode 100644 index 000000000..cfbc97db5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 loss gemodel p 1% r 10% 1-h 70% 1-k 0.1% seed 9666643528969649298 ecn diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.pcap new file mode 100644 index 000000000..4787374dd Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/netlink_route_dump.pcap new file mode 100644 index 000000000..b7106d705 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-065/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/cmd.json new file mode 100644 index 000000000..7217812f3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "netem5", + "json": "0", + "words": "qdisc add dev d0 root handle 1: netem rate 1mbit 20 100 5 slot 800us 1ms packets 10 bytes 3000" + }, + "cmd": "tc qdisc add dev d0 root handle 1: netem rate 1mbit 20 100 5 slot 800us 1ms packets 10 bytes 3000", + "desc": "positive: opt=plain cmd=netem5:qdisc_add_dev_d0_root_handle_1:_netem_rate_1mbit_20_100_5_slot_800us_1ms_packets_10_bytes_3000", + "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": "tcqwrite/ec-066", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/dump.out new file mode 100644 index 000000000..0110d5eae --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 rate 1Mbit packetoverhead 20 cellsize 100 celloverhead 5 slot 800us 1ms packets 10 bytes 3000 seed 1083021114996361990 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.pcap new file mode 100644 index 000000000..13974124f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/netlink_route_dump.pcap new file mode 100644 index 000000000..8e4a1b404 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-066/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/cmd.json new file mode 100644 index 000000000..1db109939 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "netem6", + "json": "0", + "words": "qdisc add dev d0 root handle 1: netem slot distribution pareto 1ms 100us" + }, + "cmd": "tc qdisc add dev d0 root handle 1: netem slot distribution pareto 1ms 100us", + "desc": "positive: opt=plain cmd=netem6:qdisc_add_dev_d0_root_handle_1:_netem_slot_distribution_pareto_1ms_100us", + "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": "tcqwrite/ec-067", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/dump.out new file mode 100644 index 000000000..d74e5cb59 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 slot distribution 1ms 100us seed 4951727680030207161 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.pcap new file mode 100644 index 000000000..7f1a9d7b4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/netlink_route_dump.pcap new file mode 100644 index 000000000..d26617319 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-067/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/cmd.json new file mode 100644 index 000000000..43755d9b7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "netem7", + "json": "0", + "words": "qdisc add dev d0 root handle 1: netem delay 1s seed 7" + }, + "cmd": "tc qdisc add dev d0 root handle 1: netem delay 1s seed 7", + "desc": "positive: opt=plain cmd=netem7:qdisc_add_dev_d0_root_handle_1:_netem_delay_1s_seed_7", + "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": "tcqwrite/ec-068", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/dump.out new file mode 100644 index 000000000..f1f8bac4a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 delay 1s seed 7 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.pcap new file mode 100644 index 000000000..42a3bee5d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/netlink_route_dump.pcap new file mode 100644 index 000000000..174aba0cf Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-068/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/cmd.json new file mode 100644 index 000000000..c96f31b5a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "netem-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: netem delay 1s seed 7" + }, + "cmd": "tc qdisc change dev d0 root handle 1: netem delay 1s seed 7", + "desc": "positive: opt=plain cmd=netem-change:qdisc_change_dev_d0_root_handle_1:_netem_delay_1s_seed_7", + "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": "tcqwrite/ec-069", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: netem delay 100ms" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: netem delay 100ms", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/dump.out new file mode 100644 index 000000000..f1f8bac4a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 delay 1s seed 7 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.pcap new file mode 100644 index 000000000..171a37ba2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/netlink_route_dump.pcap new file mode 100644 index 000000000..b27c9dbc2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-069/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/cmd.json new file mode 100644 index 000000000..2a1bbf9e5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "netem-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: netem delay 1s seed 7" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: netem delay 1s seed 7", + "desc": "positive: opt=plain cmd=netem-replace:qdisc_replace_dev_d0_root_handle_1:_netem_delay_1s_seed_7", + "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": "tcqwrite/ec-070", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: netem delay 100ms" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: netem delay 100ms", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/dump.out new file mode 100644 index 000000000..f1f8bac4a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 delay 1s seed 7 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.pcap new file mode 100644 index 000000000..592de61e8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/netlink_route_dump.pcap new file mode 100644 index 000000000..e2939cd8d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-070/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/cmd.json new file mode 100644 index 000000000..bfa5ee146 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "netem-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: netem delay 1s seed 7" + }, + "cmd": "tc qdisc link dev d0 root handle 1: netem delay 1s seed 7", + "desc": "corner: opt=plain cmd=netem-link:qdisc_link_dev_d0_root_handle_1:_netem_delay_1s_seed_7", + "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": "tcqwrite/ec-071", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: netem delay 100ms" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: netem delay 100ms", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/dump.out new file mode 100644 index 000000000..f1f8bac4a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/dump.out @@ -0,0 +1 @@ +qdisc netem 1: root refcnt 2 limit 1000 delay 1s seed 7 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.pcap new file mode 100644 index 000000000..39dd47f6a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/netlink_route_dump.pcap new file mode 100644 index 000000000..0ea4e71cf Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-071/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/cmd.json new file mode 100644 index 000000000..57542b774 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "netem-delete", + "json": "0", + "words": "qdisc delete dev d0 root" + }, + "cmd": "tc qdisc delete dev d0 root", + "desc": "positive: opt=plain cmd=netem-delete:qdisc_delete_dev_d0_root", + "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": "tcqwrite/ec-072", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: netem delay 100ms" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: netem delay 100ms", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.pcap new file mode 100644 index 000000000..faaf5d747 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/netlink_route_dump.pcap new file mode 100644 index 000000000..d518d3998 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-072/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/cmd.json new file mode 100644 index 000000000..476705b57 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "ingress", + "json": "0", + "words": "qdisc add dev d0 ingress" + }, + "cmd": "tc qdisc add dev d0 ingress", + "desc": "positive: opt=plain cmd=ingress:qdisc_add_dev_d0_ingress", + "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": "tcqwrite/ec-073", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/dump.out new file mode 100644 index 000000000..f2dab22bf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/dump.out @@ -0,0 +1,2 @@ +qdisc noqueue 0: root refcnt 2 +qdisc ingress ffff: parent ffff:fff1 ---------------- diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.pcap new file mode 100644 index 000000000..ae2962396 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/netlink_route_dump.pcap new file mode 100644 index 000000000..d74650ad4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-073/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/cmd.json new file mode 100644 index 000000000..7737bd537 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "ingress-blk", + "json": "0", + "words": "qdisc add dev d0 ingress_block 5 ingress" + }, + "cmd": "tc qdisc add dev d0 ingress_block 5 ingress", + "desc": "positive: opt=plain cmd=ingress-blk:qdisc_add_dev_d0_ingress_block_5_ingress", + "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": "tcqwrite/ec-074", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/dump.out new file mode 100644 index 000000000..7d3969669 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/dump.out @@ -0,0 +1,2 @@ +qdisc noqueue 0: root refcnt 2 +qdisc ingress ffff: parent ffff:fff1 ingress_block 5 ---------------- diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.pcap new file mode 100644 index 000000000..e75bd1167 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/netlink_route_dump.pcap new file mode 100644 index 000000000..d1a9de71f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-074/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/cmd.json new file mode 100644 index 000000000..2409d6d89 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "ingress-del", + "json": "0", + "words": "qdisc del dev d0 ingress" + }, + "cmd": "tc qdisc del dev d0 ingress", + "desc": "positive: opt=plain cmd=ingress-del:qdisc_del_dev_d0_ingress", + "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": "tcqwrite/ec-075", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 ingress" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 ingress", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.pcap new file mode 100644 index 000000000..9dd69b1df Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/netlink_route_dump.pcap new file mode 100644 index 000000000..fa1b546f1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-075/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/cmd.json new file mode 100644 index 000000000..e1e97cb44 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "clsact", + "json": "0", + "words": "qdisc add dev d0 clsact" + }, + "cmd": "tc qdisc add dev d0 clsact", + "desc": "positive: opt=plain cmd=clsact:qdisc_add_dev_d0_clsact", + "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": "tcqwrite/ec-076", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/dump.out new file mode 100644 index 000000000..e04d65804 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/dump.out @@ -0,0 +1,2 @@ +qdisc noqueue 0: root refcnt 2 +qdisc clsact ffff: parent ffff:fff1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.pcap new file mode 100644 index 000000000..07e443f79 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/netlink_route_dump.pcap new file mode 100644 index 000000000..c0f14116c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-076/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/cmd.json new file mode 100644 index 000000000..27908d09c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "clsact-blk", + "json": "0", + "words": "qdisc add dev d0 ingress_block 5 egress_block 6 clsact" + }, + "cmd": "tc qdisc add dev d0 ingress_block 5 egress_block 6 clsact", + "desc": "positive: opt=plain cmd=clsact-blk:qdisc_add_dev_d0_ingress_block_5_egress_block_6_clsact", + "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": "tcqwrite/ec-077", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/dump.out new file mode 100644 index 000000000..65f1d3af9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/dump.out @@ -0,0 +1,2 @@ +qdisc noqueue 0: root refcnt 2 +qdisc clsact ffff: parent ffff:fff1 ingress_block 5 egress_block 6 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.pcap new file mode 100644 index 000000000..b333c5b07 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/netlink_route_dump.pcap new file mode 100644 index 000000000..51e2b68c7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-077/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/cmd.json new file mode 100644 index 000000000..c73d7e738 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/cmd.json @@ -0,0 +1,60 @@ +{ + "axes": { + "fix": "clsact-del", + "json": "0", + "words": "qdisc delete dev d0 clsact" + }, + "cmd": "tc qdisc delete dev d0 clsact", + "desc": "positive: opt=plain cmd=clsact-del:qdisc_delete_dev_d0_clsact", + "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": "tcqwrite/ec-078", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 clsact" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 clsact", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/dump.out new file mode 100644 index 000000000..f3b1a3c16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/dump.out @@ -0,0 +1 @@ +qdisc noqueue 0: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.pcap new file mode 100644 index 000000000..a4d281825 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/netlink_route_dump.pcap new file mode 100644 index 000000000..7a71d6c26 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-078/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/cmd.json new file mode 100644 index 000000000..8c9c37cfa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "w2-handle", + "json": "0", + "words": "qdisc add dev d0 handle 5: ingress" + }, + "cmd": "tc qdisc add dev d0 handle 5: ingress", + "desc": "corner: opt=plain cmd=w2-handle:qdisc_add_dev_d0_handle_5:_ingress", + "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": "tcqwrite/ec-079", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/dump.out new file mode 100644 index 000000000..f2dab22bf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/dump.out @@ -0,0 +1,2 @@ +qdisc noqueue 0: root refcnt 2 +qdisc ingress ffff: parent ffff:fff1 ---------------- diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.pcap new file mode 100644 index 000000000..f46795c33 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/netlink_route_dump.pcap new file mode 100644 index 000000000..13e664038 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-079/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/cmd.json new file mode 100644 index 000000000..1e37bf48b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/cmd.json @@ -0,0 +1,65 @@ +{ + "axes": { + "fix": "parent", + "json": "0", + "words": "qdisc add dev d0 parent 1:10 handle 10: pfifo limit 10" + }, + "cmd": "tc qdisc add dev d0 parent 1:10 handle 10: pfifo limit 10", + "desc": "positive: opt=plain cmd=parent:qdisc_add_dev_d0_parent_1:10_handle_10:_pfifo_limit_10", + "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": "tcqwrite/ec-080", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10", + "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/dump.out new file mode 100644 index 000000000..00b7562d9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/dump.out @@ -0,0 +1,2 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 +qdisc pfifo 10: parent 1:10 limit 10p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.pcap new file mode 100644 index 000000000..aa3d08daf Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/netlink_route_dump.pcap new file mode 100644 index 000000000..811c179d5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-080/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/cmd.json new file mode 100644 index 000000000..2ac42e168 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "est", + "json": "0", + "words": "qdisc add dev d0 root handle 1: estimator 1s 8s pfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 1: estimator 1s 8s pfifo", + "desc": "positive: opt=plain cmd=est:qdisc_add_dev_d0_root_handle_1:_estimator_1s_8s_pfifo", + "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": "tcqwrite/ec-081", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/dump.out new file mode 100644 index 000000000..2941d1f91 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 1000p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.pcap new file mode 100644 index 000000000..8734ad815 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/netlink_route_dump.pcap new file mode 100644 index 000000000..ca5bfe936 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-081/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/cmd.json new file mode 100644 index 000000000..b0ca725ca --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "est-prefix", + "json": "0", + "words": "qdisc add dev d0 root handle 1: est 250ms 1s pfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 1: est 250ms 1s pfifo", + "desc": "corner: opt=plain cmd=est-prefix:qdisc_add_dev_d0_root_handle_1:_est_250ms_1s_pfifo", + "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": "tcqwrite/ec-082", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/dump.out new file mode 100644 index 000000000..2941d1f91 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 1000p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.pcap new file mode 100644 index 000000000..e15e78861 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/netlink_route_dump.pcap new file mode 100644 index 000000000..2bd06ede0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-082/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/cmd.json new file mode 100644 index 000000000..4cd4b4307 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "stab", + "json": "0", + "words": "qdisc add dev d0 root handle 1: stab overhead 20 linklayer atm mtu 2048 tsize 128 mpu 64 pfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 1: stab overhead 20 linklayer atm mtu 2048 tsize 128 mpu 64 pfifo", + "desc": "positive: opt=plain cmd=stab:qdisc_add_dev_d0_root_handle_1:_stab_overhead_20_linklayer_atm_mtu_2048_tsize_128_mpu_64_pfifo", + "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": "tcqwrite/ec-083", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/dump.out new file mode 100644 index 000000000..0189afe16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/dump.out @@ -0,0 +1,2 @@ +qdisc pfifo 1: root refcnt 2 limit 1000p + linklayer atm overhead 20 mpu 64 mtu 2048 tsize 128 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.pcap new file mode 100644 index 000000000..0bb2ec30b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/netlink_route_dump.pcap new file mode 100644 index 000000000..ec5af0e05 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-083/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/cmd.json new file mode 100644 index 000000000..ebfb9a68b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "stab0", + "json": "0", + "words": "qdisc add dev d0 root handle 1: stab overhead 4 pfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 1: stab overhead 4 pfifo", + "desc": "boundary: opt=plain cmd=stab0:qdisc_add_dev_d0_root_handle_1:_stab_overhead_4_pfifo", + "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": "tcqwrite/ec-084", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/dump.out new file mode 100644 index 000000000..77d1c2997 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/dump.out @@ -0,0 +1,2 @@ +qdisc pfifo 1: root refcnt 2 limit 1000p + overhead 4 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.pcap new file mode 100644 index 000000000..b7f429f58 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/netlink_route_dump.pcap new file mode 100644 index 000000000..59adea062 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-084/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/cmd.json new file mode 100644 index 000000000..945239b29 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "stab-eth", + "json": "0", + "words": "qdisc add dev d0 root handle 1: stab linklayer ethernet overhead 14 tbf rate 1mbit burst 10kb latency 50ms" + }, + "cmd": "tc qdisc add dev d0 root handle 1: stab linklayer ethernet overhead 14 tbf rate 1mbit burst 10kb latency 50ms", + "desc": "positive: opt=plain cmd=stab-eth:qdisc_add_dev_d0_root_handle_1:_stab_linklayer_ethernet_overhead_14_tbf_rate_1mbit_burst_10kb_latency_50ms", + "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": "tcqwrite/ec-085", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/dump.out new file mode 100644 index 000000000..b2fe11d97 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/dump.out @@ -0,0 +1,2 @@ +qdisc tbf 1: root refcnt 2 rate 1Mbit burst 10Kb/1 mpu 0b lat 50ms linklayer ethernet + linklayer ethernet overhead 14 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.pcap new file mode 100644 index 000000000..3af47e679 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/netlink_route_dump.pcap new file mode 100644 index 000000000..f44e42b68 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-085/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/cmd.json new file mode 100644 index 000000000..e3d6531d6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "verb-prefix", + "json": "0", + "words": "qdisc a dev d0 root handle 1: pfifo" + }, + "cmd": "tc qdisc a dev d0 root handle 1: pfifo", + "desc": "corner: opt=plain cmd=verb-prefix:qdisc_a_dev_d0_root_handle_1:_pfifo", + "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": "tcqwrite/ec-086", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/dump.out new file mode 100644 index 000000000..2941d1f91 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 1000p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.pcap new file mode 100644 index 000000000..953bf212d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/netlink_route_dump.pcap new file mode 100644 index 000000000..d9fe6a94c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-086/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/cmd.json new file mode 100644 index 000000000..f0e4480b9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "nohandle", + "json": "0", + "words": "qdisc add dev d0 root pfifo" + }, + "cmd": "tc qdisc add dev d0 root pfifo", + "desc": "corner: opt=plain cmd=nohandle:qdisc_add_dev_d0_root_pfifo", + "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": "tcqwrite/ec-087", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/dump.out new file mode 100644 index 000000000..2a2b09be9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/dump.out @@ -0,0 +1 @@ +qdisc pfifo 8003: root refcnt 2 limit 1000p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.pcap new file mode 100644 index 000000000..e20cf3ddb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/netlink_route_dump.pcap new file mode 100644 index 000000000..3a32b0c08 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-087/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/cmd.json new file mode 100644 index 000000000..099b6d89a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "w1-help", + "json": "0", + "words": "qdisc add dev d0 root handle 1: help pfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 1: help pfifo", + "desc": "corner: opt=plain cmd=w1-help:qdisc_add_dev_d0_root_handle_1:_help_pfifo", + "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": "tcqwrite/ec-088", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/dump.out new file mode 100644 index 000000000..2941d1f91 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 1000p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.err new file mode 100644 index 000000000..e40a36151 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.err @@ -0,0 +1,13 @@ +Usage: tc qdisc [ add | del | replace | change | show ] dev STRING + [ handle QHANDLE ] [ root | ingress | clsact | parent CLASSID ] + [ estimator INTERVAL TIME_CONSTANT ] + [ stab [ help | STAB_OPTIONS] ] + [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ] + [ [ QDISC_KIND ] [ help | OPTIONS ] ] + + tc qdisc { show | list } [ dev STRING ] [ QDISC_ID ] [ invisible ] +Where: +QDISC_KIND := { [p|b]fifo | tbf | prio | red | etc. } +OPTIONS := ... try tc qdisc add help +STAB_OPTIONS := ... try tc qdisc add stab help +QDISC_ID := { root | ingress | handle QHANDLE | parent CLASSID } diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.pcap new file mode 100644 index 000000000..ddcaef2e1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/netlink_route_dump.pcap new file mode 100644 index 000000000..b74152ebe Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-088/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/cmd.json new file mode 100644 index 000000000..c39103603 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "w3-zero", + "json": "0", + "words": "qdisc add dev d0 root handle 0: handle 1: pfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 0: handle 1: pfifo", + "desc": "corner: opt=plain cmd=w3-zero:qdisc_add_dev_d0_root_handle_0:_handle_1:_pfifo", + "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": "tcqwrite/ec-089", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/dump.out new file mode 100644 index 000000000..2941d1f91 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/dump.out @@ -0,0 +1 @@ +qdisc pfifo 1: root refcnt 2 limit 1000p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.pcap new file mode 100644 index 000000000..6b01d17de Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/netlink_route_dump.pcap new file mode 100644 index 000000000..3ab240649 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-089/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/class.out new file mode 100644 index 000000000..d77225c9e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/class.out @@ -0,0 +1 @@ +class htb 1:10 root prio 0 quantum 12500 rate 1Mbit ceil 1Mbit linklayer ethernet burst 1600b/1mpu 0b cburst 1600b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/cmd.json new file mode 100644 index 000000000..a9a8359c3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "class-add", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:10 htb rate 1mbit" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit", + "desc": "positive: opt=plain cmd=class-add:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_1mbit", + "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": "tcqwrite/ec-090", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.pcap new file mode 100644 index 000000000..ea8f86446 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/netlink_route_class.pcap new file mode 100644 index 000000000..cb4cba1c4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/netlink_route_dump.pcap new file mode 100644 index 000000000..3144ce98d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-090/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/class.out new file mode 100644 index 000000000..425c34b31 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/class.out @@ -0,0 +1 @@ +class htb 1:10 root prio 2 quantum 1500 rate 1Mbit overhead 4 ceil 2Mbit linklayer ethernet burst 15Kb/1mpu 64b cburst 20Kb/1mpu 64b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/cmd.json new file mode 100644 index 000000000..83147ffd9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "class-full", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:10 htb rate 1mbit ceil 2mbit burst 15k cburst 20k prio 2 quantum 1500 mtu 1600 mpu 64 overhead 4" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit ceil 2mbit burst 15k cburst 20k prio 2 quantum 1500 mtu 1600 mpu 64 overhead 4", + "desc": "positive: opt=plain cmd=class-full:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_1mbit_ceil_2mbit_burst_15k_cburst_20k_prio_2_quantum_1500_mtu_1600_mpu_64_overhead_4", + "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": "tcqwrite/ec-091", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.pcap new file mode 100644 index 000000000..e0476261b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/netlink_route_class.pcap new file mode 100644 index 000000000..b67ad7f52 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/netlink_route_dump.pcap new file mode 100644 index 000000000..59acd908e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-091/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/class.out new file mode 100644 index 000000000..4ae894436 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/class.out @@ -0,0 +1 @@ +class htb 1:10 root prio 0 quantum 200000 rate 40Gbit ceil 50Gbit linklayer ethernet burst 1920b/1mpu 0b cburst 2000b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/cmd.json new file mode 100644 index 000000000..00ab4309b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "class-64", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:10 htb rate 40gbit ceil 50gbit" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 40gbit ceil 50gbit", + "desc": "boundary: opt=plain cmd=class-64:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_40gbit_ceil_50gbit", + "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": "tcqwrite/ec-092", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.err new file mode 100644 index 000000000..b0edaa291 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.err @@ -0,0 +1 @@ +Warning: sch_htb: quantum of class 10010 is big. Consider r2q change. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.pcap new file mode 100644 index 000000000..a469b8c64 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/netlink_route_class.pcap new file mode 100644 index 000000000..18e08be22 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/netlink_route_dump.pcap new file mode 100644 index 000000000..d22807584 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-092/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/class.out new file mode 100644 index 000000000..d77225c9e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/class.out @@ -0,0 +1 @@ +class htb 1:10 root prio 0 quantum 12500 rate 1Mbit ceil 1Mbit linklayer ethernet burst 1600b/1mpu 0b cburst 1600b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/cmd.json new file mode 100644 index 000000000..eb753a5a1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "class-est", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:10 estimator 1s 4s htb rate 1mbit" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:10 estimator 1s 4s htb rate 1mbit", + "desc": "positive: opt=plain cmd=class-est:class_add_dev_d0_parent_1:_classid_1:10_estimator_1s_4s_htb_rate_1mbit", + "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": "tcqwrite/ec-093", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.pcap new file mode 100644 index 000000000..7252e34ac Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/netlink_route_class.pcap new file mode 100644 index 000000000..1ad9fb5cc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/netlink_route_dump.pcap new file mode 100644 index 000000000..febf9b36b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-093/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/class.out new file mode 100644 index 000000000..abdda98a1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/class.out @@ -0,0 +1 @@ +class htb 1:10 root prio 0 quantum 12500 rate 1Mbit ceil 1Mbit linklayer atm burst 1600b/1mpu 0b cburst 1600b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/cmd.json new file mode 100644 index 000000000..e0d9dff49 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "class-atm", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:10 htb rate 1mbit linklayer atm" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit linklayer atm", + "desc": "positive: opt=plain cmd=class-atm:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_1mbit_linklayer_atm", + "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": "tcqwrite/ec-094", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.pcap new file mode 100644 index 000000000..c9ee2e1f3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/netlink_route_class.pcap new file mode 100644 index 000000000..56c305e7a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/netlink_route_dump.pcap new file mode 100644 index 000000000..92840dc9f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-094/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/class.out new file mode 100644 index 000000000..0238fde53 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/class.out @@ -0,0 +1 @@ +class htb 1:1 root prio 0 quantum 62500 rate 5Mbit ceil 5Mbit linklayer ethernet burst 1600b/1mpu 0b cburst 1600b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/cmd.json new file mode 100644 index 000000000..66306afdd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "class-root", + "json": "0", + "words": "class add dev d0 root classid 1:1 htb rate 5mbit" + }, + "cmd": "tc class add dev d0 root classid 1:1 htb rate 5mbit", + "desc": "positive: opt=plain cmd=class-root:class_add_dev_d0_root_classid_1:1_htb_rate_5mbit", + "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": "tcqwrite/ec-095", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.pcap new file mode 100644 index 000000000..e6b51ea4c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/netlink_route_class.pcap new file mode 100644 index 000000000..5d6fddf00 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/netlink_route_dump.pcap new file mode 100644 index 000000000..4ab6da6f3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-095/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/class.out new file mode 100644 index 000000000..38f7cd8b1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/class.out @@ -0,0 +1 @@ +class htb 1:10 root prio 0 quantum 25000 rate 2Mbit ceil 3Mbit linklayer ethernet burst 1600b/1mpu 0b cburst 1600b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/cmd.json new file mode 100644 index 000000000..dfbcc2b1f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "fix": "class-change", + "json": "0", + "words": "class change dev d0 parent 1: classid 1:10 htb rate 2mbit ceil 3mbit" + }, + "cmd": "tc class change dev d0 parent 1: classid 1:10 htb rate 2mbit ceil 3mbit", + "desc": "positive: opt=plain cmd=class-change:class_change_dev_d0_parent_1:_classid_1:10_htb_rate_2mbit_ceil_3mbit", + "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": "tcqwrite/ec-096", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10", + "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.pcap new file mode 100644 index 000000000..a3013d70b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/netlink_route_class.pcap new file mode 100644 index 000000000..c58eabf87 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/netlink_route_dump.pcap new file mode 100644 index 000000000..13d9378d5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-096/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/class.out new file mode 100644 index 000000000..ec8ea4fa0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/class.out @@ -0,0 +1 @@ +class htb 1:10 root prio 0 quantum 37500 rate 3Mbit ceil 3Mbit linklayer ethernet burst 1600b/1mpu 0b cburst 1600b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/cmd.json new file mode 100644 index 000000000..64558a0ec --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "fix": "class-replace", + "json": "0", + "words": "class replace dev d0 parent 1: classid 1:10 htb rate 3mbit" + }, + "cmd": "tc class replace dev d0 parent 1: classid 1:10 htb rate 3mbit", + "desc": "positive: opt=plain cmd=class-replace:class_replace_dev_d0_parent_1:_classid_1:10_htb_rate_3mbit", + "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": "tcqwrite/ec-097", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10", + "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.pcap new file mode 100644 index 000000000..acdcc5c71 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/netlink_route_class.pcap new file mode 100644 index 000000000..d63e6cef9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/netlink_route_dump.pcap new file mode 100644 index 000000000..01e2fc495 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-097/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/class.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/cmd.json new file mode 100644 index 000000000..ee19125bb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/cmd.json @@ -0,0 +1,69 @@ +{ + "axes": { + "fix": "class-del", + "json": "0", + "words": "class del dev d0 classid 1:10" + }, + "cmd": "tc class del dev d0 classid 1:10", + "desc": "positive: opt=plain cmd=class-del:class_del_dev_d0_classid_1:10", + "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": "tcqwrite/ec-098", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10", + "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.pcap new file mode 100644 index 000000000..ec7022e6a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/netlink_route_class.pcap new file mode 100644 index 000000000..2ad332ca1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/netlink_route_dump.pcap new file mode 100644 index 000000000..a2b58f87f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-098/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/class.out new file mode 100644 index 000000000..3b11aabdf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/class.out @@ -0,0 +1 @@ +class htb 1:20 root prio 0 quantum 12500 rate 1Mbit ceil 1Mbit linklayer ethernet burst 1600b/1mpu 0b cburst 1600b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/cmd.json new file mode 100644 index 000000000..5ed314d9e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/cmd.json @@ -0,0 +1,64 @@ +{ + "axes": { + "fix": "class-help", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:20 help htb rate 1mbit" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:20 help htb rate 1mbit", + "desc": "corner: opt=plain cmd=class-help:class_add_dev_d0_parent_1:_classid_1:20_help_htb_rate_1mbit", + "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": "tcqwrite/ec-099", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.err new file mode 100644 index 000000000..032f2b159 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.err @@ -0,0 +1,8 @@ +Usage: tc class [ add | del | change | replace | show ] dev STRING + [ classid CLASSID ] [ root | parent CLASSID ] + [ [ QDISC_KIND ] [ help | OPTIONS ] ] + + tc class show [ dev STRING ] [ root | parent CLASSID ] +Where: +QDISC_KIND := { prio | etc. } +OPTIONS := ... try tc class add help diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.pcap new file mode 100644 index 000000000..027e8957a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/netlink_route_class.pcap new file mode 100644 index 000000000..ddc47c611 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/netlink_route_dump.pcap new file mode 100644 index 000000000..35e48e5da Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-099/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/b.txt new file mode 100644 index 000000000..cec03a139 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/b.txt @@ -0,0 +1,2 @@ +qdisc add dev d0 root handle 1: htb default 10 +class add dev d0 parent 1: classid 1:10 htb rate 1mbit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/class.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/class.out new file mode 100644 index 000000000..d77225c9e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/class.out @@ -0,0 +1 @@ +class htb 1:10 root prio 0 quantum 12500 rate 1Mbit ceil 1Mbit linklayer ethernet burst 1600b/1mpu 0b cburst 1600b/1mpu 0b level 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/cmd.json new file mode 100644 index 000000000..ea660a7ab --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/cmd.json @@ -0,0 +1,65 @@ +{ + "axes": { + "batch": "two", + "fix": "batch", + "json": "0", + "words": "-batch b.txt" + }, + "cmd": "tc -batch b.txt", + "desc": "positive: opt=plain cmd=batch:batch:two", + "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": "tcqwrite/ec-100", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "printf '%s\\n' 'qdisc add dev d0 root handle 1: htb default 10' 'class add dev d0 parent 1: classid 1:10 htb rate 1mbit' > b.txt" + ], + "proto": "route", + "readback": [ + { + "cmd": "tc -d qdisc show dev d0", + "name": "dump" + }, + { + "cmd": "tc -d class show dev d0", + "name": "class" + } + ], + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'qdisc add dev d0 root handle 1: htb default 10' 'class add dev d0 parent 1: classid 1:10 htb rate 1mbit' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/dump.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/dump.out new file mode 100644 index 000000000..b220b1484 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/dump.out @@ -0,0 +1 @@ +qdisc htb 1: root refcnt 2 r2q 10 default 0x10 direct_packets_stat 0 ver 3.17 direct_qlen 1000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.pcap new file mode 100644 index 000000000..97aa0bdb5 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/netlink_route_class.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/netlink_route_class.pcap new file mode 100644 index 000000000..e599fb7be Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/netlink_route_class.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/netlink_route_dump.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/netlink_route_dump.pcap new file mode 100644 index 000000000..9eabf6f8c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ec-100/netlink_route_dump.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/cmd.json new file mode 100644 index 000000000..0d104bc39 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "exists", + "json": "0", + "words": "qdisc add dev d0 root handle 1: pfifo" + }, + "cmd": "tc qdisc add dev d0 root handle 1: pfifo", + "desc": "negative: opt=plain cmd=ng:exists:qdisc_add_dev_d0_root_handle_1:_pfifo: add over an existing root: the kernel's EEXIST, rc 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": { + "errno": "EEXIST", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-001", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.err new file mode 100644 index 000000000..191deb08b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.err @@ -0,0 +1 @@ +Error: Exclusivity flag on, cannot modify. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.pcap new file mode 100644 index 000000000..ccc53cb59 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-001/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/cmd.json new file mode 100644 index 000000000..9b6c5e9d9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/cmd.json @@ -0,0 +1,50 @@ +{ + "axes": { + "fix": "nochange", + "json": "0", + "words": "qdisc change dev d0 root handle 1: pfifo limit 5" + }, + "cmd": "tc qdisc change dev d0 root handle 1: pfifo limit 5", + "desc": "negative: opt=plain cmd=ng:nochange:qdisc_change_dev_d0_root_handle_1:_pfifo_limit_5: change with no such qdisc (K44)", + "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": "ENOENT", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-002", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.err new file mode 100644 index 000000000..8e9a187d4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.err @@ -0,0 +1 @@ +Error: Qdisc not found. To create specify NLM_F_CREATE flag. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.pcap new file mode 100644 index 000000000..870e363ee Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-002/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/cmd.json new file mode 100644 index 000000000..7c8d0b49f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/cmd.json @@ -0,0 +1,50 @@ +{ + "axes": { + "fix": "deldefault", + "json": "0", + "words": "qdisc del dev d0 root" + }, + "cmd": "tc qdisc del dev d0 root", + "desc": "negative: opt=plain cmd=ng:deldefault:qdisc_del_dev_d0_root: delete of the default root (K44)", + "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": "ENOENT", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-003", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.err new file mode 100644 index 000000000..7e6d27a75 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.err @@ -0,0 +1 @@ +Error: Cannot delete qdisc with handle of zero. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.pcap new file mode 100644 index 000000000..00a436fd0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-003/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/cmd.json new file mode 100644 index 000000000..60682f266 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/cmd.json @@ -0,0 +1,54 @@ +{ + "axes": { + "fix": "classless", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:10 pfifo" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:10 pfifo", + "desc": "negative: opt=plain cmd=ng:classless:class_add_dev_d0_parent_1:_classid_1:10_pfifo: Qdisc \"pfifo\" is classless, rc 1 (W4)", + "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": "tcqwrite/ng-004", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: pfifo" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: pfifo", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.err new file mode 100644 index 000000000..e5a397977 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.err @@ -0,0 +1 @@ +Error: Qdisc "pfifo" is classless. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-004/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/cmd.json new file mode 100644 index 000000000..2303f7cba --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/cmd.json @@ -0,0 +1,49 @@ +{ + "axes": { + "fix": "badopt", + "json": "0", + "words": "qdisc add dev d0 root handle 1: pfifo limit zz" + }, + "cmd": "tc qdisc add dev d0 root handle 1: pfifo limit zz", + "desc": "negative: opt=plain cmd=ng:badopt:qdisc_add_dev_d0_root_handle_1:_pfifo_limit_zz: a parse_qopt failure returns 1 (W4)", + "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": "tcqwrite/ng-005", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.err new file mode 100644 index 000000000..4c99aed87 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.err @@ -0,0 +1 @@ +pfifo: Illegal value for "limit": "zz" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-005/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/cmd.json new file mode 100644 index 000000000..d93006bdb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/cmd.json @@ -0,0 +1,49 @@ +{ + "axes": { + "fix": "badunit", + "json": "0", + "words": "qdisc add dev d0 root handle 1: tbf rate 1zbit burst 10kb latency 50ms" + }, + "cmd": "tc qdisc add dev d0 root handle 1: tbf rate 1zbit burst 10kb latency 50ms", + "desc": "negative: opt=plain cmd=ng:badunit:qdisc_add_dev_d0_root_handle_1:_tbf_rate_1zbit_burst_10kb_latency_50ms: a bad rate unit", + "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": "tcqwrite/ng-006", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.err new file mode 100644 index 000000000..ee0a55c90 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.err @@ -0,0 +1 @@ +tbf: illegal value for "rate": "1zbit" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-006/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/cmd.json new file mode 100644 index 000000000..5e14575cf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/cmd.json @@ -0,0 +1,50 @@ +{ + "axes": { + "fix": "nokind", + "json": "0", + "words": "qdisc add dev d0 root handle 1: nosuchkind" + }, + "cmd": "tc qdisc add dev d0 root handle 1: nosuchkind", + "desc": "negative: opt=plain cmd=ng:nokind:qdisc_add_dev_d0_root_handle_1:_nosuchkind: an unknown kind: tc sends it and the kernel refuses", + "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": "ENOENT", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-007", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.err new file mode 100644 index 000000000..14efd4de6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.err @@ -0,0 +1 @@ +Error: Specified qdisc kind is unknown. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.pcap new file mode 100644 index 000000000..71cbdde24 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-007/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/cmd.json new file mode 100644 index 000000000..3c36a63f3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/cmd.json @@ -0,0 +1,54 @@ +{ + "axes": { + "fix": "w5-classless", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:10 nosuchkind rate 1" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:10 nosuchkind rate 1", + "desc": "negative: opt=plain cmd=ng:w5-classless:class_add_dev_d0_parent_1:_classid_1:10_nosuchkind_rate_1: an unknown class kind is \"classless\", rc 1, not W5's Garbage", + "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": "tcqwrite/ng-008", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.err new file mode 100644 index 000000000..5bfae1854 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.err @@ -0,0 +1 @@ +Error: Qdisc "nosuchkind" is classless. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-008/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/cmd.json new file mode 100644 index 000000000..f78250dca --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/cmd.json @@ -0,0 +1,49 @@ +{ + "axes": { + "fix": "qunknown", + "json": "0", + "words": "qdisc add dev d0 root handle 1: nosuchkind rate 1" + }, + "cmd": "tc qdisc add dev d0 root handle 1: nosuchkind rate 1", + "desc": "negative: opt=plain cmd=ng:qunknown:qdisc_add_dev_d0_root_handle_1:_nosuchkind_rate_1: Unknown qdisc, hence option unparsable, 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": "tcqwrite/ng-009", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.err new file mode 100644 index 000000000..4b4b36bdc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.err @@ -0,0 +1 @@ +Unknown qdisc "nosuchkind", hence option "rate" is unparsable diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-009/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/cmd.json new file mode 100644 index 000000000..3aab9fd00 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/cmd.json @@ -0,0 +1,49 @@ +{ + "axes": { + "fix": "w8-clsact", + "json": "0", + "words": "qdisc add dev d0 clsact foo" + }, + "cmd": "tc qdisc add dev d0 clsact foo", + "desc": "negative: opt=plain cmd=ng:w8-clsact:qdisc_add_dev_d0_clsact_foo: clsact's own parse_qopt refuses foo, rc 1 (not W8)", + "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": "tcqwrite/ng-010", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.err new file mode 100644 index 000000000..f25dddf8f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.err @@ -0,0 +1,2 @@ +What is "foo"? +Usage: ... clsact diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-010/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/cmd.json new file mode 100644 index 000000000..a881cc8ff --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/cmd.json @@ -0,0 +1,49 @@ +{ + "axes": { + "fix": "w2-after", + "json": "0", + "words": "qdisc add ingress dev d0" + }, + "cmd": "tc qdisc add ingress dev d0", + "desc": "negative: opt=plain cmd=ng:w2-after:qdisc_add_ingress_dev_d0: the words after ingress go to its parse_qopt: What is \"dev\"?, rc 1 (W2)", + "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": "tcqwrite/ng-011", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.err new file mode 100644 index 000000000..fc0b74f52 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.err @@ -0,0 +1,2 @@ +What is "dev"? +Usage: ... ingress diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-011/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/cmd.json new file mode 100644 index 000000000..19949544b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/cmd.json @@ -0,0 +1,50 @@ +{ + "axes": { + "fix": "noroot", + "json": "0", + "words": "qdisc add dev d0 handle 1: pfifo" + }, + "cmd": "tc qdisc add dev d0 handle 1: pfifo", + "desc": "negative: opt=plain cmd=ng:noroot:qdisc_add_dev_d0_handle_1:_pfifo: no parent: Specified qdisc not found (K44)", + "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": "ENOENT", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-012", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.err new file mode 100644 index 000000000..ce09425bd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.err @@ -0,0 +1 @@ +Error: Specified qdisc not found. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.pcap new file mode 100644 index 000000000..170c55448 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-012/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/cmd.json new file mode 100644 index 000000000..59e3d20af --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/cmd.json @@ -0,0 +1,54 @@ +{ + "axes": { + "fix": "w9-pct", + "json": "0", + "words": "class add dev d0 parent 1: classid 1:10 htb rate 10%" + }, + "cmd": "tc class add dev d0 parent 1: classid 1:10 htb rate 10%", + "desc": "negative: opt=plain cmd=ng:w9-pct:class_add_dev_d0_parent_1:_classid_1:10_htb_rate_10%: a percent rate on a dummy with no speed, rc 1 (W9)", + "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": "tcqwrite/ng-013", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.err new file mode 100644 index 000000000..019f8151d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.err @@ -0,0 +1,26 @@ +property "speed" in file /sys/class/net/d0/speed is currently unknown +Failed to parse /sys/class/net/d0/speed +Illegal "rate" +Usage: ... qdisc add ... htb [default N] [r2q N] + [direct_qlen P] [offload] + default minor id of class to which unclassified packets are sent {0} + r2q DRR quantums are computed as rate in Bps/r2q {10} + debug string of 16 numbers each 0-3 {0} + + direct_qlen Limit of the direct queue {in packets} + offload enable hardware offload +... class add ... htb rate R1 [burst B1] [mpu B] [overhead O] + [prio P] [slot S] [pslot PS] + [ceil R2] [cburst B2] [mtu MTU] [quantum Q] + rate rate allocated to this class (class can still borrow) + burst max bytes burst which can be accumulated during idle period {computed} + mpu minimum packet size used in rate computations + overhead per-packet size overhead used in rate computations + linklay adapting to a linklayer e.g. atm + ceil definite upper class rate (no borrows) {rate} + cburst burst but for ceil {computed} + mtu max packet size we create rate map for {1600} + prio priority of leaf; lower are served first {0} + quantum how much bytes to serve from leaf at once {use r2q} + +TC HTB version 3.3 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-013/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/cmd.json new file mode 100644 index 000000000..67c7ffee6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/cmd.json @@ -0,0 +1,50 @@ +{ + "axes": { + "fix": "htboffload", + "json": "0", + "words": "qdisc add dev d0 root handle 1: htb offload" + }, + "cmd": "tc qdisc add dev d0 root handle 1: htb offload", + "desc": "negative: opt=plain cmd=ng:htboffload:qdisc_add_dev_d0_root_handle_1:_htb_offload: offload needs hw-tc-offload: ENOTSUP, rc 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": 2, + "errno": "ENOTSUP", + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-014", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.err new file mode 100644 index 000000000..f3233a4e8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.err @@ -0,0 +1 @@ +Error: hw-tc-offload ethtool feature flag must be on. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.pcap new file mode 100644 index 000000000..3adb0bcf6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-014/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/cmd.json new file mode 100644 index 000000000..73364e4d6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/cmd.json @@ -0,0 +1,49 @@ +{ + "axes": { + "fix": "dupdev", + "json": "0", + "words": "qdisc add dev d0 dev d0 root pfifo" + }, + "cmd": "tc qdisc add dev d0 dev d0 root pfifo", + "desc": "negative: opt=plain cmd=ng:dupdev:qdisc_add_dev_d0_dev_d0_root_pfifo: dev twice: duparg", + "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": "tcqwrite/ng-015", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.err new file mode 100644 index 000000000..a0be6c05f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.err @@ -0,0 +1 @@ +Error: duplicate "dev": "d0" is the second value. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-015/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/cmd.json new file mode 100644 index 000000000..e293471a2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/cmd.json @@ -0,0 +1,49 @@ +{ + "axes": { + "fix": "dupparent", + "json": "0", + "words": "qdisc add dev d0 root root pfifo" + }, + "cmd": "tc qdisc add dev d0 root root pfifo", + "desc": "negative: opt=plain cmd=ng:dupparent:qdisc_add_dev_d0_root_root_pfifo: root 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": 255, + "refused_by": "iproute2" + }, + "id": "tcqwrite/ng-016", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + } + ], + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.err new file mode 100644 index 000000000..13e1a2f21 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.err @@ -0,0 +1 @@ +Error: "root" is duplicate parent ID diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-016/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/cmd.json new file mode 100644 index 000000000..a75e9a327 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/cmd.json @@ -0,0 +1,54 @@ +{ + "axes": { + "fix": "classhandle", + "json": "0", + "words": "class add dev d0 parent 1: handle 1:10 htb rate 1mbit" + }, + "cmd": "tc class add dev d0 parent 1: handle 1:10 htb rate 1mbit", + "desc": "negative: opt=plain cmd=ng:classhandle:class_add_dev_d0_parent_1:_handle_1:10_htb_rate_1mbit: class handle: try classid", + "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": "tcqwrite/ng-017", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb default 10" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb default 10", + "rc": 0 + } + ], + "rc": 255, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.err new file mode 100644 index 000000000..5d644e99a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.err @@ -0,0 +1 @@ +Error: try "classid" instead of "handle" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.pcap new file mode 100644 index 000000000..dcb4ca923 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.rc new file mode 100644 index 000000000..ace9d0362 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-017/ip.rc @@ -0,0 +1 @@ +255 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/cmd.json new file mode 100644 index 000000000..f1ad2f56c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/cmd.json @@ -0,0 +1,41 @@ +{ + "axes": { + "fix": "nodev", + "json": "0", + "words": "qdisc add dev nosuch root handle 1: pfifo" + }, + "cmd": "tc qdisc add dev nosuch root handle 1: pfifo", + "desc": "negative: opt=plain cmd=ng:nodev:qdisc_add_dev_nosuch_root_handle_1:_pfifo: a missing device: Cannot find device, 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": { + "errno": "ENODEV", + "rc": 1, + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-018", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "proto": "route", + "result": { + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.err new file mode 100644 index 000000000..11be93da0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.err @@ -0,0 +1 @@ +Cannot find device "nosuch" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.pcap new file mode 100644 index 000000000..4b523b330 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-018/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/b.txt new file mode 100644 index 000000000..a58461df4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/b.txt @@ -0,0 +1,2 @@ +qdisc add dev d0 root handle 1: pfifo limit zz +qdisc add dev d0 root handle 1: pfifo diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/cmd.json new file mode 100644 index 000000000..50b898225 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "batch": "fail-force", + "fix": "batch", + "json": "0", + "words": "-force -batch b.txt" + }, + "cmd": "tc -force -batch b.txt", + "desc": "negative: opt=plain cmd=ng:batch:batch:fail-force: with -force the failing write is passed and the next one sent; 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": "ack-then-fail" + }, + "id": "tcqwrite/ng-019", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "printf '%s\\n' 'qdisc add dev d0 root handle 1: pfifo limit zz' 'qdisc add dev d0 root handle 1: pfifo' > b.txt" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'qdisc add dev d0 root handle 1: pfifo limit zz' 'qdisc add dev d0 root handle 1: pfifo' > b.txt", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.err new file mode 100644 index 000000000..a2a698589 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.err @@ -0,0 +1,2 @@ +pfifo: Illegal value for "limit": "zz" +Command failed b.txt:1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.pcap new file mode 100644 index 000000000..1b46257b2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-019/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/cmd.json new file mode 100644 index 000000000..5a29f2f25 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "htb-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: htb direct_qlen 50" + }, + "cmd": "tc qdisc change dev d0 root handle 1: htb direct_qlen 50", + "desc": "negative: opt=plain cmd=ng:htb-change:qdisc_change_dev_d0_root_handle_1:_htb_direct_qlen_50: htb has no change op: EINVAL, rc 2 (K44)", + "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": 2, + "errno": "EINVAL", + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-020", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.err new file mode 100644 index 000000000..79d8203ad --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.err @@ -0,0 +1 @@ +Error: Change operation not supported by specified qdisc. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.pcap new file mode 100644 index 000000000..d64176fbe Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-020/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/cmd.json new file mode 100644 index 000000000..74936b298 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "htb-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: htb direct_qlen 50" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: htb direct_qlen 50", + "desc": "negative: opt=plain cmd=ng:htb-replace:qdisc_replace_dev_d0_root_handle_1:_htb_direct_qlen_50: htb has no change op: EINVAL, rc 2 (K44)", + "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": 2, + "errno": "EINVAL", + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-021", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.err new file mode 100644 index 000000000..79d8203ad --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.err @@ -0,0 +1 @@ +Error: Change operation not supported by specified qdisc. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.pcap new file mode 100644 index 000000000..ff4ec9fa6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-021/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/cmd.json new file mode 100644 index 000000000..9689d93bf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "htb-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: htb direct_qlen 50" + }, + "cmd": "tc qdisc link dev d0 root handle 1: htb direct_qlen 50", + "desc": "negative: opt=plain cmd=ng:htb-link:qdisc_link_dev_d0_root_handle_1:_htb_direct_qlen_50: htb has no change op: EINVAL, rc 2 (K44)", + "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": 2, + "errno": "EINVAL", + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-022", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: htb" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: htb", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.err new file mode 100644 index 000000000..79d8203ad --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.err @@ -0,0 +1 @@ +Error: Change operation not supported by specified qdisc. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.pcap new file mode 100644 index 000000000..002c618a7 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-022/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/cmd.json new file mode 100644 index 000000000..69f1091d0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "sfq-change", + "json": "0", + "words": "qdisc change dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop" + }, + "cmd": "tc qdisc change dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop", + "desc": "negative: opt=plain cmd=ng:sfq-change:qdisc_change_dev_d0_root_handle_1:_sfq_headdrop_redflowlimit_100000_min_8000_max_60000_probability_0.2_ecn_harddrop: sfq has no change op: EINVAL, rc 2 (K44)", + "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": 2, + "errno": "EINVAL", + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-023", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: sfq" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: sfq", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.err new file mode 100644 index 000000000..79d8203ad --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.err @@ -0,0 +1 @@ +Error: Change operation not supported by specified qdisc. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.pcap new file mode 100644 index 000000000..00b56004b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-023/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/cmd.json new file mode 100644 index 000000000..546a3ce2e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "sfq-replace", + "json": "0", + "words": "qdisc replace dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop" + }, + "cmd": "tc qdisc replace dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop", + "desc": "negative: opt=plain cmd=ng:sfq-replace:qdisc_replace_dev_d0_root_handle_1:_sfq_headdrop_redflowlimit_100000_min_8000_max_60000_probability_0.2_ecn_harddrop: sfq has no change op: EINVAL, rc 2 (K44)", + "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": 2, + "errno": "EINVAL", + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-024", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: sfq" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: sfq", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.err new file mode 100644 index 000000000..79d8203ad --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.err @@ -0,0 +1 @@ +Error: Change operation not supported by specified qdisc. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.pcap new file mode 100644 index 000000000..4e6540769 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-024/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/cmd.json new file mode 100644 index 000000000..65ae69f04 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/cmd.json @@ -0,0 +1,55 @@ +{ + "axes": { + "fix": "sfq-link", + "json": "0", + "words": "qdisc link dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop" + }, + "cmd": "tc qdisc link dev d0 root handle 1: sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop", + "desc": "negative: opt=plain cmd=ng:sfq-link:qdisc_link_dev_d0_root_handle_1:_sfq_headdrop_redflowlimit_100000_min_8000_max_60000_probability_0.2_ecn_harddrop: sfq has no change op: EINVAL, rc 2 (K44)", + "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": 2, + "errno": "EINVAL", + "refused_by": "kernel" + }, + "id": "tcqwrite/ng-025", + "modules": [ + "sch_prio", + "sch_fq_codel", + "sch_fq", + "sch_htb", + "sch_tbf", + "sch_sfq", + "sch_netem", + "sch_ingress" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: sfq" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: sfq", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.err new file mode 100644 index 000000000..79d8203ad --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.err @@ -0,0 +1 @@ +Error: Change operation not supported by specified qdisc. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.pcap new file mode 100644 index 000000000..38a1b6dcc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcqwrite/ng-025/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/xtcpnl_rtattr_encode.go b/pkg/xtcpnl/xtcpnl_rtattr_encode.go index 20ef93ba0..cd246a70f 100644 --- a/pkg/xtcpnl/xtcpnl_rtattr_encode.go +++ b/pkg/xtcpnl/xtcpnl_rtattr_encode.go @@ -354,6 +354,9 @@ func BuildRequest(msgType, flags uint16, seq uint32, familyHdr, attrs []byte) ([ // set` and `del` (ip/iptoken.c:173), the only `ip` command that sends it. // RTM_NEWNSID is `ip netns set` (set_netns_id_from_name, lib/namespace.c), // with no DEL beside it: a namespace's nsid goes when the namespace does. +// The qdisc and class pairs are tc's: do_qdisc and do_class send +// RTM_NEWQDISC/RTM_NEWTCLASS for add, change, replace and link, and +// RTM_DELQDISC/RTM_DELTCLASS for delete (tc/tc_qdisc.c, tc/tc_class.c). func IsAdmittedWriteType(msgType uint16) bool { switch msgType { case uint16(unix.RTM_NEWROUTE), uint16(unix.RTM_DELROUTE), @@ -365,7 +368,9 @@ func IsAdmittedWriteType(msgType uint16) bool { uint16(unix.RTM_NEWADDRLABEL), uint16(unix.RTM_DELADDRLABEL), uint16(unix.RTM_SETNEIGHTBL), uint16(unix.RTM_SETSTATS), uint16(unix.RTM_NEWLINKPROP), uint16(unix.RTM_DELLINKPROP), - uint16(unix.RTM_SETLINK), uint16(unix.RTM_NEWNSID): + uint16(unix.RTM_SETLINK), uint16(unix.RTM_NEWNSID), + uint16(unix.RTM_NEWQDISC), uint16(unix.RTM_DELQDISC), + uint16(unix.RTM_NEWTCLASS), uint16(unix.RTM_DELTCLASS): return true } return false diff --git a/pkg/xtcpnl/xtcpnl_tc_qencode.go b/pkg/xtcpnl/xtcpnl_tc_qencode.go new file mode 100644 index 000000000..3aa9530f0 --- /dev/null +++ b/pkg/xtcpnl/xtcpnl_tc_qencode.go @@ -0,0 +1,193 @@ +package xtcpnl + +import ( + "encoding/binary" + + "github.com/randomizedcoder/xtcp2/pkg/cint" +) + +// This file is the encode half of xtcpnl_tc_qopt.go: an Append per struct a +// tc qdisc or class write carries, laid out field for field as +// include/uapi/linux/pkt_sched.h has it at v7.4-rc4, so decode(Append(x)) is +// x. They encode and nothing more; the attribute each goes in, and the +// order, are the tc parser's business (tc/q_*.c at iproute2 v7.2.0). +// +// They are not behind a write tag: laying out a struct sends nothing, and the +// round-trip tests want every build. + +// TcEstimatorSizeCst is sizeof(struct tc_estimator). +const TcEstimatorSizeCst = 2 + +// TcEstimator is struct tc_estimator (pkt_sched.h:46), TCA_RATE's payload: +// the interval as a power of two of a quarter second, and the EWMA log. +type TcEstimator struct { + Interval int8 + EwmaLog uint8 +} + +// DecodeTcEstimator decodes a struct tc_estimator. +func DecodeTcEstimator(b []byte) (TcEstimator, error) { + if err := tcNeed(b, TcEstimatorSizeCst, "tc_estimator"); err != nil { + return TcEstimator{}, err + } + r := tcRd{b: b} + return TcEstimator{Interval: cint.SChar(r.u8()), EwmaLog: r.u8()}, nil +} + +// Append lays out e (pkt_sched.h:46). +func (e TcEstimator) Append(b []byte) []byte { + return append(b, cint.SCharBits(e.Interval), e.EwmaLog) +} + +func appendU16(b []byte, v uint16) []byte { return binary.LittleEndian.AppendUint16(b, v) } +func appendU32(b []byte, v uint32) []byte { return binary.LittleEndian.AppendUint32(b, v) } +func appendU64(b []byte, v uint64) []byte { return binary.LittleEndian.AppendUint64(b, v) } +func appendS16(b []byte, v int16) []byte { return appendU16(b, cint.ShortBits(v)) } +func appendS32(b []byte, v int32) []byte { return appendU32(b, cint.Bits(v)) } +func appendS64(b []byte, v int64) []byte { return appendU64(b, cint.U64Bits(v)) } + +// Append lays out r, struct tc_ratespec (pkt_sched.h:91). +func (r TcRateSpec) Append(b []byte) []byte { + b = append(b, r.CellLog, r.Linklayer) + b = appendU16(b, r.Overhead) + b = appendS16(b, r.CellAlign) + b = appendU16(b, r.Mpu) + return appendU32(b, r.Rate) +} + +// Append lays out s, struct tc_sizespec (pkt_sched.h:102). +func (s TcSizespec) Append(b []byte) []byte { + b = append(b, s.CellLog, s.SizeLog) + b = appendS16(b, s.CellAlign) + b = appendS32(b, s.Overhead) + b = appendU32(b, s.Linklayer) + b = appendU32(b, s.Mpu) + b = appendU32(b, s.Mtu) + return appendU32(b, s.Tsize) +} + +// Append lays out q, struct tc_fifo_qopt (pkt_sched.h:124). +func (q TcFifoQopt) Append(b []byte) []byte { return appendU32(b, q.Limit) } + +// Append lays out q, struct tc_prio_qopt (pkt_sched.h:148): bands, then +// the sixteen-byte priomap. +func (q TcPrioQopt) Append(b []byte) []byte { + b = appendS32(b, q.Bands) + return append(b, q.Priomap[:]...) +} + +// Append lays out o, struct tc_htb_opt (pkt_sched.h:409). +func (o TcHtbOpt) Append(b []byte) []byte { + b = o.Rate.Append(b) + b = o.Ceil.Append(b) + b = appendU32(b, o.Buffer) + b = appendU32(b, o.Cbuffer) + b = appendU32(b, o.Quantum) + b = appendU32(b, o.Level) + return appendU32(b, o.Prio) +} + +// Append lays out g, struct tc_htb_glob (pkt_sched.h:418). +func (g TcHtbGlob) Append(b []byte) []byte { + b = appendU32(b, g.Version) + b = appendU32(b, g.Rate2Quantum) + b = appendU32(b, g.Defcls) + b = appendU32(b, g.Debug) + return appendU32(b, g.DirectPkts) +} + +// Append lays out q, struct tc_tbf_qopt (pkt_sched.h:183). +func (q TcTbfQopt) Append(b []byte) []byte { + b = q.Rate.Append(b) + b = q.Peakrate.Append(b) + b = appendU32(b, q.Limit) + b = appendU32(b, q.Buffer) + return appendU32(b, q.Mtu) +} + +// Append lays out q, struct tc_sfq_qopt (pkt_sched.h:213). +func (q TcSfqQopt) Append(b []byte) []byte { + b = appendU32(b, q.Quantum) + b = appendS32(b, q.PerturbPeriod) + b = appendU32(b, q.Limit) + b = appendU32(b, q.Divisor) + return appendU32(b, q.Flows) +} + +// Append lays out s, struct tc_sfqred_stats (pkt_sched.h:221). +func (s TcSfqredStats) Append(b []byte) []byte { + for _, v := range [...]uint32{s.ProbDrop, s.ForcedDrop, s.ProbMark, s.ForcedMark, s.ProbMarkHead, s.ForcedMarkHead} { + b = appendU32(b, v) + } + return b +} + +// Append lays out q, struct tc_sfq_qopt_v1 (pkt_sched.h:230), the stats +// included: sfq_parse_opt sends the whole struct (tc/q_sfq.c). +func (q TcSfqQoptV1) Append(b []byte) []byte { + b = q.V0.Append(b) + b = appendU32(b, q.Depth) + b = appendU32(b, q.Headdrop) + b = appendU32(b, q.Limit) + b = appendU32(b, q.QthMin) + b = appendU32(b, q.QthMax) + b = append(b, q.Wlog, q.Plog, q.ScellLog, q.Flags) + b = appendU32(b, q.MaxP) + return q.Stats.Append(b) +} + +// Append lays out q, struct tc_netem_qopt (pkt_sched.h:503). +func (q TcNetemQopt) Append(b []byte) []byte { + for _, v := range [...]uint32{q.Latency, q.Limit, q.Loss, q.Gap, q.Duplicate, q.Jitter} { + b = appendU32(b, v) + } + return b +} + +// Append lays out c, struct tc_netem_corr (pkt_sched.h:512). +func (c TcNetemCorr) Append(b []byte) []byte { + b = appendU32(b, c.DelayCorr) + b = appendU32(b, c.LossCorr) + return appendU32(b, c.DupCorr) +} + +// Append lays out p, struct tc_netem_reorder or tc_netem_corrupt +// (pkt_sched.h:518). +func (p TcNetemProbCorr) Append(b []byte) []byte { + b = appendU32(b, p.Probability) + return appendU32(b, p.Correlation) +} + +// Append lays out r, struct tc_netem_rate (pkt_sched.h:528). +func (r TcNetemRate) Append(b []byte) []byte { + b = appendU32(b, r.Rate) + b = appendS32(b, r.PacketOverhead) + b = appendU32(b, r.CellSize) + return appendS32(b, r.CellOverhead) +} + +// Append lays out s, struct tc_netem_slot (pkt_sched.h:535). +func (s TcNetemSlot) Append(b []byte) []byte { + b = appendS64(b, s.MinDelay) + b = appendS64(b, s.MaxDelay) + b = appendS32(b, s.MaxPackets) + b = appendS32(b, s.MaxBytes) + b = appendS64(b, s.DistDelay) + return appendS64(b, s.DistJitter) +} + +// Append lays out g, struct tc_netem_gimodel (pkt_sched.h:553). +func (g TcNetemGimodel) Append(b []byte) []byte { + for _, v := range [...]uint32{g.P13, g.P31, g.P32, g.P14, g.P23} { + b = appendU32(b, v) + } + return b +} + +// Append lays out g, struct tc_netem_gemodel (pkt_sched.h:562). +func (g TcNetemGemodel) Append(b []byte) []byte { + for _, v := range [...]uint32{g.P, g.R, g.H, g.K1} { + b = appendU32(b, v) + } + return b +} diff --git a/pkg/xtcpnl/xtcpnl_tc_qencode_test.go b/pkg/xtcpnl/xtcpnl_tc_qencode_test.go new file mode 100644 index 000000000..1f4a78c71 --- /dev/null +++ b/pkg/xtcpnl/xtcpnl_tc_qencode_test.go @@ -0,0 +1,111 @@ +package xtcpnl + +import ( + "math" + "reflect" + "testing" +) + +// TestTcQencodeRoundTrip is each tc struct's Append against its decoder: +// decode(Append(x)) is x and the length is the struct's size (gotc 17P). +// +// go test ./pkg/xtcpnl/ -run TestTcQencodeRoundTrip +func TestTcQencodeRoundTrip(t *testing.T) { + rate := TcRateSpec{CellLog: 3, Linklayer: 2, Overhead: 10, CellAlign: -1, Mpu: 64, Rate: 125000} + maxRate := TcRateSpec{CellLog: math.MaxUint8, Linklayer: math.MaxUint8, Overhead: math.MaxUint16, + CellAlign: math.MinInt16, Mpu: math.MaxUint16, Rate: math.MaxUint32} + type enc interface{ Append([]byte) []byte } + tests := []struct { + description string + x enc + size int + decode func([]byte) (any, error) + }{ + {"positive: tc_ratespec", rate, TcRateSpecSizeCst, + func(b []byte) (any, error) { r := tcRd{b: b}; return r.rateSpec(), tcNeed(b, TcRateSpecSizeCst, "") }}, + {"positive: tc_sizespec with a negative overhead", TcSizespec{CellLog: 5, SizeLog: 2, CellAlign: -1, + Overhead: -4, Linklayer: 2, Mpu: 64, Mtu: 2048, Tsize: 128}, TcSizespecSizeCst, + func(b []byte) (any, error) { return DecodeTcSizespec(b) }}, + {"positive: tc_estimator with a negative interval", TcEstimator{Interval: -2, EwmaLog: 3}, TcEstimatorSizeCst, + func(b []byte) (any, error) { return DecodeTcEstimator(b) }}, + {"positive: tc_fifo_qopt", TcFifoQopt{Limit: 100}, TcFifoQoptSizeCst, + func(b []byte) (any, error) { return DecodeTcFifoQopt(b) }}, + {"positive: tc_prio_qopt", TcPrioQopt{Bands: 3, Priomap: [16]uint8{1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}}, + TcPrioQoptSizeCst, func(b []byte) (any, error) { return DecodeTcPrioQopt(b) }}, + {"positive: tc_htb_opt", TcHtbOpt{Rate: rate, Ceil: maxRate, Buffer: 1, Cbuffer: 2, Quantum: 1500, Level: 0, Prio: 7}, + TcHtbOptSizeCst, func(b []byte) (any, error) { return DecodeTcHtbOpt(b) }}, + {"positive: tc_htb_glob", TcHtbGlob{Version: 3, Rate2Quantum: 20, Defcls: 0x10, DirectPkts: 50}, + TcHtbGlobSizeCst, func(b []byte) (any, error) { return DecodeTcHtbGlob(b) }}, + {"positive: tc_tbf_qopt", TcTbfQopt{Rate: rate, Peakrate: rate, Limit: 10000, Buffer: 80000, Mtu: 2000}, + TcTbfQoptSizeCst, func(b []byte) (any, error) { return DecodeTcTbfQopt(b) }}, + {"positive: tc_sfq_qopt", TcSfqQopt{Quantum: 1514, PerturbPeriod: -1, Limit: 127, Divisor: 1024, Flows: 128}, + TcSfqQoptSizeCst, func(b []byte) (any, error) { return DecodeTcSfqQopt(b) }}, + {"positive: tc_sfq_qopt_v1 with stats", TcSfqQoptV1{V0: TcSfqQopt{Quantum: 1514, Limit: 127}, Depth: 127, + Headdrop: 1, Limit: 100000, QthMin: 8000, QthMax: 60000, Wlog: 1, Plog: 2, ScellLog: 3, Flags: 3, + MaxP: 858993459, Stats: TcSfqredStats{1, 2, 3, 4, 5, 6}}, TcSfqQoptV1SizeCst, + func(b []byte) (any, error) { return DecodeTcSfqQoptV1(b) }}, + {"positive: tc_netem_qopt", TcNetemQopt{Latency: 1, Limit: 1000, Loss: 2, Gap: 3, Duplicate: 4, Jitter: 5}, + TcNetemQoptSizeCst, func(b []byte) (any, error) { return DecodeTcNetemQopt(b) }}, + {"positive: tc_netem_corr", TcNetemCorr{1, 2, 3}, TcNetemCorrSizeCst, + func(b []byte) (any, error) { return DecodeTcNetemCorr(b) }}, + {"positive: tc_netem_reorder", TcNetemProbCorr{Probability: math.MaxUint32, Correlation: 7}, TcNetemProbCorrSizeCst, + func(b []byte) (any, error) { return DecodeTcNetemProbCorr(b) }}, + {"positive: tc_netem_rate with negative overheads", TcNetemRate{Rate: 125000, PacketOverhead: -20, CellSize: 100, + CellOverhead: -5}, TcNetemRateSizeCst, func(b []byte) (any, error) { return DecodeTcNetemRate(b) }}, + {"positive: tc_netem_slot", TcNetemSlot{MinDelay: 800000, MaxDelay: 1000000, MaxPackets: 10, MaxBytes: 3000, + DistDelay: -1, DistJitter: math.MinInt64}, TcNetemSlotSizeCst, + func(b []byte) (any, error) { return DecodeTcNetemSlot(b) }}, + {"positive: tc_netem_gimodel", TcNetemGimodel{1, 2, 3, 4, 5}, TcNetemGimodelSizeCst, + func(b []byte) (any, error) { return DecodeTcNetemGimodel(b) }}, + {"positive: tc_netem_gemodel", TcNetemGemodel{1, 2, 3, 4}, TcNetemGemodelSizeCst, + func(b []byte) (any, error) { return DecodeTcNetemGemodel(b) }}, + {"boundary: tc_ratespec at every maximum", maxRate, TcRateSpecSizeCst, + func(b []byte) (any, error) { r := tcRd{b: b}; return r.rateSpec(), tcNeed(b, TcRateSpecSizeCst, "") }}, + {"boundary: the zero tc_htb_opt", TcHtbOpt{}, TcHtbOptSizeCst, + func(b []byte) (any, error) { return DecodeTcHtbOpt(b) }}, + {"corner: tc_estimator at the signed char minimum", TcEstimator{Interval: math.MinInt8, EwmaLog: math.MaxUint8}, + TcEstimatorSizeCst, func(b []byte) (any, error) { return DecodeTcEstimator(b) }}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + prefix := []byte{0xaa} + b := tc.x.Append(prefix) + if len(b)-1 != tc.size { + t.Fatalf("Append wrote %d bytes, want %d", len(b)-1, tc.size) + } + if b[0] != 0xaa { + t.Fatal("Append changed what was already in the slice") + } + got, err := tc.decode(b[1:]) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, tc.x) { + t.Errorf("decode(Append(x)) = %+v, want %+v", got, tc.x) + } + }) + } +} + +// TestDecodeTcEstimator is the decoder's length check. +func TestDecodeTcEstimator(t *testing.T) { + tests := []struct { + description string + in []byte + expected TcEstimator + ok bool + }{ + {"positive: interval 0 ewma 3", []byte{0, 3}, TcEstimator{0, 3}, true}, + {"negative: one byte is short", []byte{0}, TcEstimator{}, false}, + {"boundary: interval -2 is 0xfe", []byte{0xfe, 2}, TcEstimator{-2, 2}, true}, + {"corner: trailing bytes are ignored", []byte{3, 3, 9}, TcEstimator{3, 3}, true}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + got, err := DecodeTcEstimator(tc.in) + if (err == nil) != tc.ok || got != tc.expected { + t.Errorf("got %+v, %v; want %+v ok=%t", got, err, tc.expected, tc.ok) + } + }) + } +} diff --git a/pkg/xtcpnl/xtcpnl_tc_write.go b/pkg/xtcpnl/xtcpnl_tc_write.go new file mode 100644 index 000000000..1f02d4eb6 --- /dev/null +++ b/pkg/xtcpnl/xtcpnl_tc_write.go @@ -0,0 +1,251 @@ +//go:build gotc_write + +// gotc_write builds this for gotc's qdisc and class writes. Like goip's +// write builders it is compiled only behind its tag, so the default build +// of this package cannot lay out a tc write at all. + +package xtcpnl + +import ( + "encoding/binary" + "errors" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "golang.org/x/sys/unix" +) + +// This file encodes the request `tc qdisc` and `tc class` add, change, +// replace, link and delete send: tc_qdisc_modify (tc/tc_qdisc.c:43) and +// tc_class_modify (tc/tc_class.c:52) at iproute2 v7.2.0. The tcmsg comes +// first, then the attributes in the order those functions write them, +// whatever the argv order was: +// +// qdisc: TCA_KIND, TCA_RATE, TCA_INGRESS_BLOCK, TCA_EGRESS_BLOCK, +// the kind's parse_qopt attributes, TCA_STAB {BASE, DATA} +// class: TCA_KIND, TCA_RATE, the kind's parse_copt attributes +// +// The kind's own attributes are its parser's business (gotc's q_*.go), so +// they come in through Opts, which writes into the same builder. +// +// Nothing here sends. BuildTcWriteRequest goes through BuildWriteRequest, +// and gotc compares the bytes with a replay or writes them to a file +// (gotc-status.md, increment 17: dry-run, as goip's decision 5). + +const ( + // TcQdiscWriteBufCst is TCA_BUF_MAX (tc/tc_common.h:3), the + // buf[] after the tcmsg in tc_qdisc_modify's request. + TcQdiscWriteBufCst = 64 * 1024 + // TcClassWriteBufCst is tc_class_modify's char buf[4096]: a class + // write has a sixteenth of a qdisc write's room (lead W6). + TcClassWriteBufCst = 4096 + // tcReqHdrCst is sizeof(struct nlmsghdr) + sizeof(struct tcmsg), + // what addattr_l's maxlen counts before the attributes. + tcReqHdrCst = NlMsgHdrSizeCst + TcMsgSizeCst +) + +var ( + // ErrTcWriteType is a TcWrite whose MsgType is not one of + // RTM_NEWQDISC, RTM_DELQDISC, RTM_NEWTCLASS or RTM_DELTCLASS. + ErrTcWriteType = errors.New("xtcpnl: a tc write is RTM_NEW/DELQDISC or RTM_NEW/DELTCLASS") + // ErrTcWriteStab is a TcWrite whose StabData length is not the + // sizespec's tsize: tc sends tsize __u16s. + ErrTcWriteStab = errors.New("xtcpnl: TCA_STAB_DATA is not tsize entries") +) + +// TcWrite is one qdisc or class write as tc_qdisc_modify or +// tc_class_modify assembles it. +type TcWrite struct { + // MsgType is RTM_NEWQDISC or RTM_DELQDISC (qdisc), RTM_NEWTCLASS or + // RTM_DELTCLASS (class). + MsgType uint16 + // Flags are the NLM_F_* bits besides NLM_F_REQUEST, as do_qdisc and + // do_class pass them: EXCL|CREATE for add, 0 for change, 0 for + // delete; replace is CREATE|REPLACE for a qdisc and CREATE alone for a + // class; link (qdisc only) is REPLACE. tc's rtnl_talk adds NLM_F_ACK. + Flags uint16 + + // The struct tcmsg; tcm_family is always AF_UNSPEC. + Ifindex int32 + Handle uint32 + Parent uint32 + Info uint32 + + // Kind is TCA_KIND, sent as strlen+1 when non-empty. + Kind string + // Est is TCA_RATE, sent when EwmaLog is non-zero (`if + // (est.ewma_log)`). + Est TcEstimator + // IngressBlock and EgressBlock are sent when non-zero (qdisc only). + IngressBlock uint32 + EgressBlock uint32 + + // Opts writes the kind's attributes, TCA_OPTIONS and anything beside + // it, in parse_qopt or parse_copt order. Nil writes none. + Opts func(ab *AttrBuilder) error + + // HasStab sends TCA_STAB (check_size_table_opts was true): BASE is + // Stab, and DATA is StabData when it is non-nil. + HasStab bool + Stab TcSizespec + StabData []uint16 +} + +// IsTcQdiscWrite reports whether msgType is a qdisc write. +func IsTcQdiscWrite(msgType uint16) bool { + return msgType == uint16(unix.RTM_NEWQDISC) || msgType == uint16(unix.RTM_DELQDISC) +} + +func isTcClassWrite(msgType uint16) bool { + return msgType == uint16(unix.RTM_NEWTCLASS) || msgType == uint16(unix.RTM_DELTCLASS) +} + +// TcWriteRoom is the attribute room a write of msgType has: the request +// buffer after the tcmsg (TCA_BUF_MAX for a qdisc, 4096 for a class). +func TcWriteRoom(msgType uint16) int { + if IsTcQdiscWrite(msgType) { + return TcQdiscWriteBufCst + } + return TcClassWriteBufCst +} + +// TcMaxlenRoom is the room left under a parser's own addattr maxlen, which +// counts the nlmsghdr and tcmsg: q_prio's addattr_nest_compat(n, 1024, …) +// fails once 16+20+attributes would pass 1024, whatever the buffer is. +func TcMaxlenRoom(maxlen, written int) int { + return maxlen - tcReqHdrCst - written +} + +// EncodeTcMsg lays out a struct tcmsg: family, two pad bytes and a pad +// byte, ifindex, handle, parent, info. +// It returns an array so a request costs no allocation for it. +func EncodeTcMsg(w *TcWrite) [TcMsgSizeCst]byte { + var arr [TcMsgSizeCst]byte + b := append(arr[:0], unix.AF_UNSPEC, 0, 0, 0) // tcm_family, tcm__pad1, tcm__pad2 + b = binary.LittleEndian.AppendUint32(b, cint.Bits(w.Ifindex)) + b = binary.LittleEndian.AppendUint32(b, w.Handle) + b = binary.LittleEndian.AppendUint32(b, w.Parent) + b = binary.LittleEndian.AppendUint32(b, w.Info) + return [TcMsgSizeCst]byte(b) +} + +// BuildTcWriteRequest lays out w in tc_qdisc_modify's or tc_class_modify's +// order. An attribute that does not fit the buffer is an error, where tc +// prints "addattr_l ERROR" and sends what it has (W6): gotc refuses a +// request tc would truncate rather than send it. +func BuildTcWriteRequest(w *TcWrite, seq uint32) ([]byte, error) { + qdisc := IsTcQdiscWrite(w.MsgType) + if !qdisc && !isTcClassWrite(w.MsgType) { + return nil, ErrTcWriteType + } + // One allocation holds the builder and its buffer: Opts is a call the + // compiler cannot see into, so the builder it is handed escapes. + r := new(tcWriteBuf) + r.ab = NewAttrBuilder(r.raw[:TcWriteRoom(w.MsgType)]) + if err := w.putFrame(&r.ab, qdisc); err != nil { + return nil, err + } + hdr := EncodeTcMsg(w) + return BuildWriteRequest(w.MsgType, w.Flags, seq, hdr[:], r.ab.Bytes()) +} + +// tcWriteBuf is a request's attribute builder and the buffer it writes, +// sized for the larger (qdisc) room. +type tcWriteBuf struct { + ab AttrBuilder + raw [TcQdiscWriteBufCst]byte +} + +func (w *TcWrite) putFrame(ab *AttrBuilder, qdisc bool) error { + if w.Kind != "" { + if err := ab.PutString(TcaKind, w.Kind); err != nil { + return err + } + } + if w.Est.EwmaLog != 0 { + var e [TcEstimatorSizeCst]byte + if err := ab.PutBytes(TcaRate, w.Est.Append(e[:0])); err != nil { + return err + } + } + if qdisc { + for _, blk := range [...]struct { + t uint16 + v uint32 + }{{TcaIngressBlock, w.IngressBlock}, {TcaEgressBlock, w.EgressBlock}} { + if blk.v == 0 { + continue + } + if err := ab.PutU32(blk.t, blk.v); err != nil { + return err + } + } + } + if w.Opts != nil { + if err := w.Opts(ab); err != nil { + return err + } + } + if qdisc && w.HasStab { + return w.putStab(ab) + } + return nil +} + +// putStab is TCA_STAB: a nest of TCA_STAB_BASE (the sizespec) and, when +// tc_calc_size_table made one, TCA_STAB_DATA (tsize __u16s). +func (w *TcWrite) putStab(ab *AttrBuilder) error { + if w.StabData != nil && len(w.StabData) != int(w.Stab.Tsize) { + return ErrTcWriteStab + } + m, err := ab.BeginNest(TcaStab) + if err != nil { + return err + } + var base [TcSizespecSizeCst]byte + if err := ab.PutBytes(TcaStabBase, w.Stab.Append(base[:0])); err != nil { + return err + } + if w.StabData != nil { + p, err := ab.reserve(TcaStabData, 2*len(w.StabData)) + if err != nil { + return err + } + for i, v := range w.StabData { + binary.LittleEndian.PutUint16(p[2*i:], v) + } + } + return ab.EndNest(m) +} + +// NestCompat is an open addattr_nest_compat: the outer attribute holding a +// struct, and the empty nest after it. +type NestCompat struct { + outer, inner NestMark +} + +// BeginNestCompat is addattr_nest_compat (lib/libnetlink.c:1424): an +// attribute carrying data, then a bare nest header of the same type, both +// to be closed by EndNestCompat. q_prio sends TCA_OPTIONS this way, with +// tc_prio_qopt as the data. +func (a *AttrBuilder) BeginNestCompat(atype uint16, data []byte) (NestCompat, error) { + start := a.n + if err := a.PutBytes(atype, data); err != nil { + return NestCompat{}, err + } + in, err := a.BeginNest(atype) + if err != nil { + a.n = start + return NestCompat{}, err + } + return NestCompat{outer: NestMark{off: start}, inner: in}, nil +} + +// EndNestCompat is addattr_nest_compat_end (lib/libnetlink.c:1434): the +// outer attribute's rta_len becomes everything to the cursor, and the +// inner nest's rta_len everything after its own header, 4 when empty. +func (a *AttrBuilder) EndNestCompat(c NestCompat) error { + if err := a.EndNest(c.outer); err != nil { + return err + } + return a.EndNest(c.inner) +} diff --git a/pkg/xtcpnl/xtcpnl_tc_write_test.go b/pkg/xtcpnl/xtcpnl_tc_write_test.go new file mode 100644 index 000000000..b7fd2d64b --- /dev/null +++ b/pkg/xtcpnl/xtcpnl_tc_write_test.go @@ -0,0 +1,250 @@ +//go:build gotc_write + +package xtcpnl + +import ( + "bytes" + "encoding/binary" + "encoding/hex" + "errors" + "testing" + + "golang.org/x/sys/unix" +) + +const tdTcqwrite = "testdata/7_3_1/ws/tcqwrite/" + +// tcWriteCaptured is the first qdisc or class write in a tcqwrite row's +// capture: the request tc 7.2.0 sent. +func tcWriteCaptured(t testing.TB, id string) []byte { + t.Helper() + for _, m := range pcapNlMsgs(t, tdTcqwrite+id+"/ip.pcap") { + if m.h.Flags&unix.NLM_F_REQUEST == 0 || !IsAdmittedWriteType(m.h.Type) { + continue + } + b := make([]byte, NlMsgHdrSizeCst, NlMsgHdrSizeCst+len(m.body)) + binary.LittleEndian.PutUint32(b[0:], uint32(NlMsgHdrSizeCst+len(m.body))) + binary.LittleEndian.PutUint16(b[4:], m.h.Type) + binary.LittleEndian.PutUint16(b[6:], m.h.Flags) + return append(b, m.body...) + } + t.Fatalf("%s: no tc write in the capture", id) + return nil +} + +// tcSameRequest compares two requests with seq and pid left out. +func tcSameRequest(got, want []byte) bool { + if len(got) != len(want) || len(got) < NlMsgHdrSizeCst { + return false + } + return bytes.Equal(got[:8], want[:8]) && bytes.Equal(got[NlMsgHdrSizeCst:], want[NlMsgHdrSizeCst:]) +} + +// tcCapturedIfindex is the tcmsg ifindex of a captured request: d0's index +// in its row's namespace. +func tcCapturedIfindex(req []byte) int32 { + return int32(binary.LittleEndian.Uint32(req[NlMsgHdrSizeCst+4:])) +} + +// tcCapturedStabData is the TCA_STAB_DATA payload of a captured request, +// so the stab case checks the nest's layout with the table tc computed +// (the table's values are internal/gotc's TestTcEstimatorTables). +func tcCapturedStabData(t *testing.T, req []byte) []uint16 { + t.Helper() + attrs := req[NlMsgHdrSizeCst+TcMsgSizeCst:] + for len(attrs) >= RTAttrSizeCst { + l := int(binary.LittleEndian.Uint16(attrs)) + typ := binary.LittleEndian.Uint16(attrs[2:]) + if typ == TcaStab { + in := attrs[RTAttrSizeCst:l] + for len(in) >= RTAttrSizeCst { + il := int(binary.LittleEndian.Uint16(in)) + if binary.LittleEndian.Uint16(in[2:]) == TcaStabData { + p := in[RTAttrSizeCst:il] + out := make([]uint16, len(p)/2) + for i := range out { + out[i] = binary.LittleEndian.Uint16(p[2*i:]) + } + return out + } + in = in[il+FourByteAlignPadding(il):] + } + } + attrs = attrs[l+FourByteAlignPadding(l):] + } + t.Fatal("no TCA_STAB_DATA") + return nil +} + +func tcOpts(v []byte) func(*AttrBuilder) error { + return func(ab *AttrBuilder) error { return ab.PutBytes(TcaOptions, v) } +} + +const ( + tcAdd = unix.NLM_F_EXCL | unix.NLM_F_CREATE | unix.NLM_F_ACK + tcReplace = unix.NLM_F_CREATE | unix.NLM_F_REPLACE | unix.NLM_F_ACK + tcLink = unix.NLM_F_REPLACE | unix.NLM_F_ACK + tcChange = unix.NLM_F_ACK + tcRoot = 0xffffffff +) + +// TestBuildTcWrite is BuildTcWriteRequest against the requests tc sent for +// tcqwrite rows: the frame (tcmsg, kind, estimator, blocks, stab) and +// each verb's flags, with a kind's options given as tc encoded them. +// +// go test -tags gotc_write ./pkg/xtcpnl/ -run TestBuildTcWrite +func TestBuildTcWrite(t *testing.T) { + fifo100 := TcFifoQopt{Limit: 100}.Append(nil) + prio := TcPrioQopt{Bands: 3, Priomap: [16]uint8{0, 1, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}}.Append(nil) + tests := []struct { + description string + id string + w TcWrite + stabData bool // take TCA_STAB_DATA from the capture + }{ + {"positive: add pfifo limit 100", "ec-002", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0x10000, Parent: tcRoot, Kind: "pfifo", Opts: tcOpts(fifo100)}, false}, + {"positive: change is ACK alone", "ec-003", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcChange, + Handle: 0x10000, Parent: tcRoot, Kind: "pfifo", Opts: tcOpts(fifo100)}, false}, + {"positive: replace is CREATE|REPLACE", "ec-004", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcReplace, + Handle: 0x10000, Parent: tcRoot, Kind: "pfifo", Opts: tcOpts(fifo100)}, false}, + {"positive: link is REPLACE alone", "ec-005", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcLink, + Handle: 0x10000, Parent: tcRoot, Kind: "pfifo", Opts: tcOpts(fifo100)}, false}, + {"positive: delete root has no attributes", "ec-006", TcWrite{MsgType: unix.RTM_DELQDISC, + Flags: unix.NLM_F_ACK, Parent: tcRoot}, false}, + {"positive: prio is a compat nest", "ec-020", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0x10000, Parent: tcRoot, Kind: "prio", Opts: func(ab *AttrBuilder) error { + c, err := ab.BeginNestCompat(TcaOptions, prio) + if err != nil { + return err + } + return ab.EndNestCompat(c) + }}, false}, + // ingress_parse_opt and clsact_parse_opt only check argv; neither + // writes TCA_OPTIONS. + {"positive: ingress sends no TCA_OPTIONS", "ec-073", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0xffff0000, Parent: 0xfffffff1, Kind: "ingress"}, false}, + // TC_H_CLSACT is TC_H_INGRESS (pkt_sched.h), so clsact's handle and + // parent are ingress's. + {"positive: clsact with both blocks", "ec-077", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0xffff0000, Parent: 0xfffffff1, Kind: "clsact", IngressBlock: 5, EgressBlock: 6}, false}, + {"positive: estimator 1s 8s", "ec-081", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0x10000, Parent: tcRoot, Kind: "pfifo", Est: TcEstimator{Interval: 0, EwmaLog: 3}}, false}, + {"positive: stab atm with a table", "ec-083", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0x10000, Parent: tcRoot, Kind: "pfifo", HasStab: true, + Stab: TcSizespec{CellLog: 5, CellAlign: -1, Overhead: 20, Linklayer: 2, Mpu: 64, Mtu: 2048, Tsize: 128}}, true}, + // tc_calc_size_table zeroes mtu, tsize, cell_log and cell_align and + // leaves linklayer as parse_size_table left it: 0 when none was given. + {"boundary: stab of overhead alone has no DATA", "ec-084", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0x10000, Parent: tcRoot, Kind: "pfifo", HasStab: true, + Stab: TcSizespec{Overhead: 4}}, false}, + {"corner: handle 5: is overwritten by ingress (W2)", "ec-079", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0xffff0000, Parent: 0xfffffff1, Kind: "ingress"}, false}, + {"corner: handle 0: handle 1: sends 1: (W3)", "ec-089", TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, + Handle: 0x10000, Parent: tcRoot, Kind: "pfifo"}, false}, + {"positive: class del", "ec-098", TcWrite{MsgType: unix.RTM_DELTCLASS, Flags: unix.NLM_F_ACK, + Handle: 0x10010}, false}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + want := tcWriteCaptured(t, tc.id) + w := tc.w + w.Ifindex = tcCapturedIfindex(want) + if tc.stabData { + w.StabData = tcCapturedStabData(t, want) + } + got, err := BuildTcWriteRequest(&w, 0) + if err != nil { + t.Fatal(err) + } + if !tcSameRequest(got, want) { + t.Errorf("request differs\n got %s\nwant %s", hex.EncodeToString(got), hex.EncodeToString(want)) + } + }) + } +} + +// TestBuildTcWriteRefusals is the builder's own refusals. +func TestBuildTcWriteRefusals(t *testing.T) { + big := make([]byte, TcClassWriteBufCst) + tests := []struct { + description string + w TcWrite + expected error + }{ + {"negative: a route type is not a tc write", TcWrite{MsgType: unix.RTM_NEWROUTE}, ErrTcWriteType}, + {"negative: a GET is not a tc write", TcWrite{MsgType: unix.RTM_GETQDISC}, ErrTcWriteType}, + {"negative: DATA that is not tsize entries", TcWrite{MsgType: unix.RTM_NEWQDISC, HasStab: true, + Stab: TcSizespec{Tsize: 4}, StabData: []uint16{1, 2}}, ErrTcWriteStab}, + {"boundary: a class write past its 4096 bytes (W6)", TcWrite{MsgType: unix.RTM_NEWTCLASS, + Kind: "htb", Opts: tcOpts(big)}, ErrAttrNoSpace}, + {"boundary: the same options fit a qdisc write", TcWrite{MsgType: unix.RTM_NEWQDISC, + Kind: "htb", Opts: tcOpts(big)}, nil}, + {"corner: stab on a class is not sent", TcWrite{MsgType: unix.RTM_NEWTCLASS, HasStab: true, + Stab: TcSizespec{Tsize: 4}, StabData: []uint16{1, 2}}, nil}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + _, err := BuildTcWriteRequest(&tc.w, 0) + if !errors.Is(err, tc.expected) { + t.Errorf("err %v, want %v", err, tc.expected) + } + }) + } +} + +// TestTcWriteAdmitted is the four tc write types through the write gate. +func TestTcWriteAdmitted(t *testing.T) { + tests := []struct { + description string + msgType uint16 + expected bool + }{ + {"positive: RTM_NEWQDISC", unix.RTM_NEWQDISC, true}, + {"positive: RTM_DELQDISC", unix.RTM_DELQDISC, true}, + {"positive: RTM_NEWTCLASS", unix.RTM_NEWTCLASS, true}, + {"positive: RTM_DELTCLASS", unix.RTM_DELTCLASS, true}, + {"negative: RTM_GETQDISC", unix.RTM_GETQDISC, false}, + {"negative: RTM_NEWTFILTER is not yet", unix.RTM_NEWTFILTER, false}, + {"boundary: RTM_NEWCHAIN is not yet", unix.RTM_NEWCHAIN, false}, + {"corner: RTM_NEWACTION is not yet", unix.RTM_NEWACTION, false}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := IsAdmittedWriteType(tc.msgType); got != tc.expected { + t.Errorf("IsAdmittedWriteType(%d) = %t, want %t", tc.msgType, got, tc.expected) + } + }) + } +} + +// TestBuildTcWriteAllocs pins the allocations per request: the attribute +// buffer and the laid-out message. +func TestBuildTcWriteAllocs(t *testing.T) { + fifo := TcFifoQopt{Limit: 100}.Append(nil) + w := TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, Ifindex: 2, Handle: 0x10000, Parent: tcRoot, + Kind: "pfifo", Est: TcEstimator{EwmaLog: 3}, Opts: tcOpts(fifo)} + n := testing.AllocsPerRun(100, func() { + if _, err := BuildTcWriteRequest(&w, 1); err != nil { + t.Fatal(err) + } + }) + if n > 2 { + t.Errorf("%v allocations per request, want at most 2", n) + } +} + +// BenchmarkBuildTcWrite is a pfifo add with an estimator. +// +// go test -tags gotc_write ./pkg/xtcpnl/ -run '^$' -bench BuildTcWrite -benchmem +func BenchmarkBuildTcWrite(b *testing.B) { + fifo := TcFifoQopt{Limit: 100}.Append(nil) + w := TcWrite{MsgType: unix.RTM_NEWQDISC, Flags: tcAdd, Ifindex: 2, Handle: 0x10000, Parent: tcRoot, + Kind: "pfifo", Est: TcEstimator{EwmaLog: 3}, Opts: tcOpts(fifo)} + b.ReportAllocs() + for b.Loop() { + if _, err := BuildTcWriteRequest(&w, 1); err != nil { + b.Fatal(err) + } + } +} diff --git a/pkg/xtcpnl/xtcpnl_write_gate_test.go b/pkg/xtcpnl/xtcpnl_write_gate_test.go index 422643c13..d91ee399c 100644 --- a/pkg/xtcpnl/xtcpnl_write_gate_test.go +++ b/pkg/xtcpnl/xtcpnl_write_gate_test.go @@ -26,7 +26,9 @@ import ( // RTM_SETNEIGHTBL and RTM_SETSTATS with ntable change and stats set (G3-T05), // the link property pair with link property add and del (G3-T06), and // RTM_SETLINK with token set and del (G4-T03), and RTM_NEWNSID with netns -// set (G4-T04); `link set` still sends RTM_NEWLINK. +// set (G4-T04); `link set` still sends RTM_NEWLINK. The qdisc and class +// pairs joined with gotc's tc write builder (gotc 17P), whose parity target +// is the captured ws/tcqwrite corpus. var admittedWriteTypes = map[uint16]bool{ uint16(unix.RTM_NEWROUTE): true, uint16(unix.RTM_DELROUTE): true, @@ -48,6 +50,10 @@ var admittedWriteTypes = map[uint16]bool{ uint16(unix.RTM_DELLINKPROP): true, uint16(unix.RTM_SETLINK): true, uint16(unix.RTM_NEWNSID): true, + uint16(unix.RTM_NEWQDISC): true, + uint16(unix.RTM_DELQDISC): true, + uint16(unix.RTM_NEWTCLASS): true, + uint16(unix.RTM_DELTCLASS): true, } // TestBuildWriteRequestAdmitsOnlyListedWrites walks every named rtnetlink type diff --git a/pkg/xtcpnl/xtcpnl_write_request.go b/pkg/xtcpnl/xtcpnl_write_request.go index ef4c6331c..e2973d883 100644 --- a/pkg/xtcpnl/xtcpnl_write_request.go +++ b/pkg/xtcpnl/xtcpnl_write_request.go @@ -1,8 +1,9 @@ -//go:build goip_write || treatment +//go:build goip_write || treatment || gotc_write // goip_write builds this for goip's write verbs. treatment builds it, and only // the route and rule builders, for internal/goip/actuate; link, address, nsid, -// genl and xfrm writes stay goip_write-only (FP-8b). +// genl and xfrm writes stay goip_write-only (FP-8b). gotc_write builds it for +// gotc's qdisc and class writes (xtcpnl_tc_write.go). package xtcpnl diff --git a/tools/nlcapgen/main.go b/tools/nlcapgen/main.go index d687bfdf2..8ba3e6ef9 100644 --- a/tools/nlcapgen/main.go +++ b/tools/nlcapgen/main.go @@ -159,6 +159,7 @@ var families = map[string]func() []*space{ "tcmonitor": func() []*space { return []*space{tcmonitorSpace()} }, "tcsched": func() []*space { return []*space{tcschedSpace()} }, "tcaqm": func() []*space { return []*space{tcaqmSpace()} }, + "tcqwrite": func() []*space { return []*space{tcqwriteSpace()} }, } // namedFamilies are families of named rows, written out as they are diff --git a/tools/nlcapgen/matrix_tcqwrite.go b/tools/nlcapgen/matrix_tcqwrite.go new file mode 100644 index 000000000..ae75e0dcf --- /dev/null +++ b/tools/nlcapgen/matrix_tcqwrite.go @@ -0,0 +1,237 @@ +package main + +import ( + "slices" + "strings" +) + +// The qdisc and class write space (gotc 17C): `tc qdisc add|change| +// replace|link|delete` and `tc class add|change|replace|delete` of the +// thirteen kinds of increment 9 (pfifo, bfifo, pfifo_head_drop, prio, +// pfifo_fast, fq_codel, fq, htb, tbf, sfq, netem, ingress, clsact), in one +// corpus directory, ws/tcqwrite. +// +// tc's side is tc_qdisc.c's tc_qdisc_modify and tc_class.c's +// tc_class_modify, the units parsers of tc_util.c, tc_core.c and +// tc_stab.c, and each kind's parse_qopt/parse_copt. The kernel's side is +// net/sched/sch_api.c (tc_modify_qdisc, tc_get_qdisc, tc_ctl_tclass) and +// each sch_.c init and change. +// +// Each write is the captured command; its setup is in Pre, and a readback +// (`tc -d qdisc show`, plus `tc -d class show` for classes) records what +// the kernel kept. The rows pin the plan's leads +// (docs/netlink/upstream/iproute2-tc-write.md): help that carries on (W1), +// ingress and clsact ending the frame (W2), the zero-handle duplicate +// (W3), parse_qopt's rc 1 (W4), class Garbage with no newline (W5), the +// estimator's argv step (W7), a kind with no parse_qopt (W8) and a percent +// rate on a dummy (W9). +// +// Writes are plain only: tc prints nothing for a write, so -j adds +// nothing. Determinism: explicit handles, fixed MACs, no packets. + +// tcQwriteModules are the qdisc modules the rows use. +var tcQwriteModules = []string{ + "sch_prio", "sch_fq_codel", "sch_fq", "sch_htb", "sch_tbf", "sch_sfq", "sch_netem", "sch_ingress", +} + +// tcQwriteDev is the dummy every row writes to. +var tcQwriteDev = []string{tcDummies("d0")} + +// tcQwritePre is the dummy plus setup lines. +func tcQwritePre(lines ...string) []string { + return append(append([]string{}, tcQwriteDev...), lines...) +} + +// tcQwriteRoot is a root qdisc of handle 1: on d0, as a pre step. +func tcQwriteRoot(qdisc string) string { return "tc qdisc add dev d0 root handle 1: " + qdisc } + +// tcQwriteKinds is each kind's add body (after "root handle 1:"), the +// option variants each documented option at least once. +var tcQwriteKinds = []struct { + name string // the value name's prefix + body []string +}{ + {"pfifo", []string{"pfifo", "pfifo limit 100"}}, + {"bfifo", []string{"bfifo", "bfifo limit 10kb"}}, + {"phd", []string{"pfifo_head_drop limit 50"}}, + {"prio", []string{"prio", "prio bands 5", "prio bands 3 priomap 0 1 2 2 1 2 0 0 1 1 1 1 1 1 1 1"}}, + {"pfast", []string{"pfifo_fast"}}, + {"fqcodel", []string{ + "fq_codel", + "fq_codel limit 1000 flows 512 target 4ms interval 50ms quantum 1514 ecn", + "fq_codel noecn ce_threshold 2ms ce_threshold_selector 0x01/0x03 memory_limit 16Mb drop_batch 32", + }}, + {"fq", []string{ + "fq", + "fq limit 1000 flow_limit 50 quantum 3028 initial_quantum 15140 maxrate 1gbit buckets 256 nopacing", + "fq pacing refill_delay 50ms low_rate_threshold 1Mbit orphan_mask 511 timer_slack 20us ce_threshold 4ms horizon 2s horizon_drop", + "fq horizon_cap weights 589824 196608 65536 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1", + }}, + {"htb", []string{"htb", "htb default 10 r2q 20", "htb direct_qlen 50"}}, + {"tbf", []string{ + "tbf rate 1mbit burst 10kb latency 50ms", + "tbf rate 10mbit burst 20kb/8 limit 30000 peakrate 12mbit mtu 2000 mpu 64", + "tbf rate 5gbit burst 1mb latency 1s", + "tbf rate 1Mbps burst 10k latency 70ms linklayer atm overhead 10", + }}, + {"sfq", []string{ + "sfq", + "sfq perturb 10 quantum 1514 limit 100 divisor 512 depth 64 flows 128", + "sfq headdrop redflowlimit 100000 min 8000 max 60000 probability 0.2 ecn harddrop", + }}, + {"netem", []string{ + "netem delay 100ms", + "netem delay 100ms 10ms 25% loss 1% 30% duplicate 1% corrupt 0.1% reorder 25% 50% gap 5", + "netem delay 10ms 2ms distribution normal", + "netem loss state 1% 10% 5% 1% 2% limit 3000", + "netem loss gemodel 1% 10% 70% 0.1% ecn", + "netem rate 1mbit 20 100 5 slot 800us 1ms packets 10 bytes 3000", + "netem slot distribution pareto 1ms 100us", + "netem delay 1s seed 7", + }}, +} + +// tcQwriteVerbs are the qdisc verbs other than add, each run on a root +// qdisc an add made first. +var tcQwriteVerbs = []struct { + verb string + kind brKind +}{ + {"change", brPos}, {"replace", brPos}, {"link", brCorner}, {"delete", brPos}, +} + +// tcqwriteSpace: the qdisc and class writes of the increment-9 kinds. +func tcqwriteSpace() *space { + var cmds []value + rb := map[string][]readback{} + add := func(kind brKind, name, words string, pre []string, class bool) { + val := bc(kind, name, words, pre) + cmds = append(cmds, val) + r := []readback{{Name: "dump", Cmd: "tc -d qdisc show dev d0"}} + if class { + r = append(r, readback{Name: "class", Cmd: "tc -d class show dev d0"}) + } + rb[val.Name] = r + } + // sfq and htb have no kernel qdisc change op: change, replace and link on + // them are the kernel's EINVAL, "Change operation not supported by specified qdisc." (K44). + var verbBad []badValue + noChange := expect{RC: intp(2), Errno: "EINVAL", RefusedBy: refKernel} + // Each kind's add bodies, then the other verbs on its first body. + for _, k := range tcQwriteKinds { + for i, body := range k.body { + add(brPos, k.name+string(rune('0'+i)), "qdisc add dev d0 root handle 1: "+body, tcQwriteDev, false) + } + for _, vb := range tcQwriteVerbs { + body := k.body[len(k.body)-1] + words := "qdisc " + vb.verb + " dev d0 root handle 1: " + body + if vb.verb == "delete" { + words = "qdisc delete dev d0 root" + } + if (k.name == "sfq" || k.name == "htb") && vb.verb != "delete" { + verbBad = append(verbBad, brBad(k.name+"-"+vb.verb, words, tcQwritePre(tcQwriteRoot(k.body[0])), noChange, + k.name+" has no change op: EINVAL, rc 2 (K44)")) + continue + } + add(vb.kind, k.name+"-"+vb.verb, words, tcQwritePre(tcQwriteRoot(k.body[0])), false) + } + } + // ingress and clsact: the frame ends at the kind (W2). + add(brPos, "ingress", "qdisc add dev d0 ingress", tcQwriteDev, false) + add(brPos, "ingress-blk", "qdisc add dev d0 ingress_block 5 ingress", tcQwriteDev, false) + add(brPos, "ingress-del", "qdisc del dev d0 ingress", tcQwritePre("tc qdisc add dev d0 ingress"), false) + add(brPos, "clsact", "qdisc add dev d0 clsact", tcQwriteDev, false) + add(brPos, "clsact-blk", "qdisc add dev d0 ingress_block 5 egress_block 6 clsact", tcQwriteDev, false) + add(brPos, "clsact-del", "qdisc delete dev d0 clsact", tcQwritePre("tc qdisc add dev d0 clsact"), false) + add(brCorner, "w2-handle", "qdisc add dev d0 handle 5: ingress", tcQwriteDev, false) + // The common frame: parent, estimator, stab, prefixes. + htbPre := tcQwritePre(tcQwriteRoot("htb default 10")) + add(brPos, "parent", "qdisc add dev d0 parent 1:10 handle 10: pfifo limit 10", + tcQwritePre(tcQwriteRoot("htb default 10"), "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit"), false) + add(brPos, "est", "qdisc add dev d0 root handle 1: estimator 1s 8s pfifo", tcQwriteDev, false) // W7 + add(brCorner, "est-prefix", "qdisc add dev d0 root handle 1: est 250ms 1s pfifo", tcQwriteDev, false) + add(brPos, "stab", "qdisc add dev d0 root handle 1: stab overhead 20 linklayer atm mtu 2048 tsize 128 mpu 64 pfifo", + tcQwriteDev, false) + add(brBoundary, "stab0", "qdisc add dev d0 root handle 1: stab overhead 4 pfifo", tcQwriteDev, false) + add(brPos, "stab-eth", "qdisc add dev d0 root handle 1: stab linklayer ethernet overhead 14 tbf rate 1mbit burst 10kb latency 50ms", + tcQwriteDev, false) + add(brCorner, "verb-prefix", "qdisc a dev d0 root handle 1: pfifo", tcQwriteDev, false) + add(brCorner, "nohandle", "qdisc add dev d0 root pfifo", tcQwriteDev, false) + add(brCorner, "w1-help", "qdisc add dev d0 root handle 1: help pfifo", tcQwriteDev, false) // W1 + add(brCorner, "w3-zero", "qdisc add dev d0 root handle 0: handle 1: pfifo", tcQwriteDev, false) + // htb classes. + add(brPos, "class-add", "class add dev d0 parent 1: classid 1:10 htb rate 1mbit", htbPre, true) + add(brPos, "class-full", "class add dev d0 parent 1: classid 1:10 htb rate 1mbit ceil 2mbit burst 15k cburst 20k prio 2 quantum 1500 mtu 1600 mpu 64 overhead 4", + htbPre, true) + add(brBoundary, "class-64", "class add dev d0 parent 1: classid 1:10 htb rate 40gbit ceil 50gbit", htbPre, true) + add(brPos, "class-est", "class add dev d0 parent 1: classid 1:10 estimator 1s 4s htb rate 1mbit", htbPre, true) + add(brPos, "class-atm", "class add dev d0 parent 1: classid 1:10 htb rate 1mbit linklayer atm", htbPre, true) + add(brPos, "class-root", "class add dev d0 root classid 1:1 htb rate 5mbit", htbPre, true) + classPre := append(append([]string{}, htbPre...), "tc class add dev d0 parent 1: classid 1:10 htb rate 1mbit") + add(brPos, "class-change", "class change dev d0 parent 1: classid 1:10 htb rate 2mbit ceil 3mbit", classPre, true) + add(brPos, "class-replace", "class replace dev d0 parent 1: classid 1:10 htb rate 3mbit", classPre, true) + add(brPos, "class-del", "class del dev d0 classid 1:10", classPre, true) + add(brCorner, "class-help", "class add dev d0 parent 1: classid 1:20 help htb rate 1mbit", htbPre, true) // W1 + // Batches: two writes, then a write that fails and one after it. + cmds = append(cmds, + bb(brPos, "batch", "two", "", false, batchFile( + "qdisc add dev d0 root handle 1: htb default 10", + "class add dev d0 parent 1: classid 1:10 htb rate 1mbit"), tcQwriteDev), + ) + rb[cmds[len(cmds)-1].Name] = []readback{{Name: "dump", Cmd: "tc -d qdisc show dev d0"}, {Name: "class", Cmd: "tc -d class show dev d0"}} + exists := expect{RC: intp(2), Errno: "EEXIST", RefusedBy: refKernel} + bad := slices.Concat([]badValue{ + brBad("exists", "qdisc add dev d0 root handle 1: pfifo", tcQwritePre(tcQwriteRoot("pfifo")), exists, + "add over an existing root: the kernel's EEXIST, rc 2"), + brBad("nochange", "qdisc change dev d0 root handle 1: pfifo limit 5", tcQwriteDev, + expect{RC: intp(2), Errno: "ENOENT", RefusedBy: refKernel}, "change with no such qdisc (K44)"), + brBad("deldefault", "qdisc del dev d0 root", tcQwriteDev, + expect{RC: intp(2), Errno: "ENOENT", RefusedBy: refKernel}, "delete of the default root (K44)"), + brBad("classless", "class add dev d0 parent 1: classid 1:10 pfifo", tcQwritePre(tcQwriteRoot("pfifo")), + expect{RC: intp(1), RefusedBy: refIproute2}, "Qdisc \"pfifo\" is classless, rc 1 (W4)"), + brBad("badopt", "qdisc add dev d0 root handle 1: pfifo limit zz", tcQwriteDev, + expect{RC: intp(1), RefusedBy: refIproute2}, "a parse_qopt failure returns 1 (W4)"), + brBad("badunit", "qdisc add dev d0 root handle 1: tbf rate 1zbit burst 10kb latency 50ms", tcQwriteDev, + expect{RC: intp(1), RefusedBy: refIproute2}, "a bad rate unit"), + brBad("nokind", "qdisc add dev d0 root handle 1: nosuchkind", tcQwriteDev, + expect{RC: intp(2), Errno: "ENOENT", RefusedBy: refKernel}, "an unknown kind: tc sends it and the kernel refuses"), + brBad("w5-classless", "class add dev d0 parent 1: classid 1:10 nosuchkind rate 1", htbPre, expect{RC: intp(1), RefusedBy: refIproute2}, + "an unknown class kind is \"classless\", rc 1, not W5's Garbage"), + brBad("qunknown", "qdisc add dev d0 root handle 1: nosuchkind rate 1", tcQwriteDev, expect{RC: intp(1), RefusedBy: refIproute2}, + "Unknown qdisc, hence option unparsable, rc 1"), + brBad("w8-clsact", "qdisc add dev d0 clsact foo", tcQwriteDev, expect{RC: intp(1), RefusedBy: refIproute2}, + "clsact's own parse_qopt refuses foo, rc 1 (not W8)"), + brBad("w2-after", "qdisc add ingress dev d0", tcQwriteDev, expect{RC: intp(1), RefusedBy: refIproute2}, + "the words after ingress go to its parse_qopt: What is \"dev\"?, rc 1 (W2)"), + brBad("noroot", "qdisc add dev d0 handle 1: pfifo", tcQwriteDev, + expect{RC: intp(2), Errno: "ENOENT", RefusedBy: refKernel}, "no parent: Specified qdisc not found (K44)"), + brBad("w9-pct", "class add dev d0 parent 1: classid 1:10 htb rate 10%", htbPre, expect{RC: intp(1), RefusedBy: refIproute2}, + "a percent rate on a dummy with no speed, rc 1 (W9)"), + brBad("htboffload", "qdisc add dev d0 root handle 1: htb offload", tcQwriteDev, + expect{RC: intp(2), Errno: "ENOTSUP", RefusedBy: refKernel}, "offload needs hw-tc-offload: ENOTSUP, rc 2"), + brBad("dupdev", "qdisc add dev d0 dev d0 root pfifo", tcQwriteDev, tcTool, "dev twice: duparg"), + brBad("dupparent", "qdisc add dev d0 root root pfifo", tcQwriteDev, tcTool, "root twice"), + brBad("classhandle", "class add dev d0 parent 1: handle 1:10 htb rate 1mbit", htbPre, tcTool, + "class handle: try classid"), + brBad("nodev", "qdisc add dev nosuch root handle 1: pfifo", nil, tcNodev, "a missing device: Cannot find device, rc 1"), + bbBad("batch", "fail-force", "-force", false, batchFile( + "qdisc add dev d0 root handle 1: pfifo limit zz", + "qdisc add dev d0 root handle 1: pfifo"), tcQwriteDev, tcAck1, + "with -force the failing write is passed and the next one sent; rc 1"), + }, verbBad) + sp := &space{ + Name: "tcqwrite", + Axes: []axis{{Name: "opt", Values: []value{v("plain", "", f("json", "0"))}}, {Name: "cmd", Values: cmds}}, + Bad: bad, + } + sp.NegBase = func([]value) bool { return true } + sp.Build = func(vals []value) row { + r := tcBuildMods(tcQwriteModules, vals) + r.Readback = rb[vals[len(vals)-1].Name] + return r + } + return sp +} + +// tcQwriteWords is a write row's words, for tests. +func tcQwriteWords(r row) string { return strings.TrimPrefix(r.Cmd, "tc ") } diff --git a/tools/nlcapgen/matrix_tcqwrite_test.go b/tools/nlcapgen/matrix_tcqwrite_test.go new file mode 100644 index 000000000..b66fa35c9 --- /dev/null +++ b/tools/nlcapgen/matrix_tcqwrite_test.go @@ -0,0 +1,141 @@ +package main + +import ( + "bytes" + "strings" + "testing" +) + +// TestTcQwriteSpace pins the qdisc and class write rows (gotc 17C): every +// increment-9 kind's add bodies, the other verbs on each, the frame's +// options, htb classes, a batch and the refusals. +// +// go test ./tools/nlcapgen/ -run TestTcQwriteSpace +func TestTcQwriteSpace(t *testing.T) { + rows, err := matrixRows(families["tcqwrite"](), matrixOpts{Seed: 1}) + if err != nil { + t.Fatal(err) + } + if err := checkRows(rows); err != nil { + t.Fatal(err) + } + if len(rows) != 125 { + t.Errorf("%d rows, want 125 (100 commands plain, 25 negatives)", len(rows)) + } + byCmd := map[string]row{} + for _, r := range rows { + if !strings.HasPrefix(r.ID, "tcqwrite/") { + t.Errorf("%s: not in tcqwrite/", r.ID) + } + if r.InitNS || r.Serial || r.Proto != "route" { + t.Errorf("%s: initns %t serial %t proto %q", r.ID, r.InitNS, r.Serial, r.Proto) + } + for _, m := range r.Modules { + if !tdcGuestModules[m] { + t.Errorf("%s: module %s is not one the guest has", r.ID, m) + } + } + // Every write targets d0 (or the missing nosuch), made in the row's + // own namespace: no row touches lo or another netns. + if w := tcQwriteWords(r); strings.Contains(w, "dev lo") || strings.Contains(r.Cmd, "-netns") { + t.Errorf("%s: writes outside its dummy: %q", r.ID, r.Cmd) + } + if r.Expect.RefusedBy == refNone && len(r.Readback) == 0 { + t.Errorf("%s: a positive write with no readback", r.ID) + } + k := r.Cmd + "|" + r.Axes["fix"] + if _, dup := byCmd[k]; dup { + t.Errorf("%s: %q twice", r.ID, k) + } + byCmd[k] = r + } + has := func(sub string) bool { + for _, r := range rows { + if strings.Contains(r.Cmd, sub) { + return true + } + } + return false + } + + tests := []struct { + description string + sub string // a substring some row's command holds + expected bool + }{ + // Positive: each kind is added. + {"positive: pfifo add", "root handle 1: pfifo limit 100", true}, + {"positive: bfifo add", "root handle 1: bfifo limit 10kb", true}, + {"positive: pfifo_head_drop add", "pfifo_head_drop limit 50", true}, + {"positive: prio priomap", "prio bands 3 priomap", true}, + {"positive: pfifo_fast add", "root handle 1: pfifo_fast", true}, + {"positive: fq_codel options", "fq_codel limit 1000 flows 512", true}, + {"positive: fq options", "fq limit 1000 flow_limit 50", true}, + {"positive: htb qdisc", "root handle 1: htb default 10 r2q 20", true}, + {"positive: tbf peakrate", "peakrate 12mbit mtu 2000", true}, + {"positive: sfq red mode", "sfq headdrop redflowlimit", true}, + {"positive: netem distribution", "distribution normal", true}, + {"positive: ingress", "qdisc add dev d0 ingress", true}, + {"positive: clsact blocks", "ingress_block 5 egress_block 6 clsact", true}, + // Positive: verbs. + {"positive: change", "qdisc change dev d0 root handle 1: netem", true}, + {"positive: replace", "qdisc replace dev d0 root handle 1: netem", true}, + {"negative: htb has no change op", "qdisc change dev d0 root handle 1: htb", true}, + {"positive: link", "qdisc link dev d0 root handle 1: tbf", true}, + {"positive: delete", "qdisc delete dev d0 root", true}, + {"positive: class change", "class change dev d0", true}, + {"positive: class del", "class del dev d0 classid 1:10", true}, + // Leads. + {"lead: W1 help", "root handle 1: help pfifo", true}, + {"lead: W2 handle then ingress", "handle 5: ingress", true}, + {"lead: W2 words after ingress", "qdisc add ingress dev d0", true}, + {"lead: W3 zero handle", "handle 0: handle 1:", true}, + {"lead: W4 parse failure", "pfifo limit zz", true}, + {"lead: W5 class garbage", "classid 1:10 nosuchkind", true}, + {"lead: W7 estimator", "estimator 1s 8s", true}, + {"lead: W8 no parse_qopt", "clsact foo", true}, + {"lead: W9 percent", "htb rate 10%", true}, + // Boundary and corner. + {"boundary: htb rate64", "rate 40gbit ceil 50gbit", true}, + {"boundary: stab with only overhead", "stab overhead 4 pfifo", true}, + {"corner: verb by prefix", "qdisc a dev d0", true}, + // Negative: nothing reads. + {"negative: no show command is captured", "qdisc show", false}, + {"negative: no packets are sent", "ping", false}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + if got := has(tc.sub); got != tc.expected { + t.Errorf("a row with %q: %t, want %t", tc.sub, got, tc.expected) + } + }) + } + + // Every kind has every verb. + fixes := map[string]bool{} + for _, r := range rows { + fixes[r.Axes["fix"]] = true + } + for _, k := range tcQwriteKinds { + for _, vb := range tcQwriteVerbs { + if !fixes[k.name+"-"+vb.verb] { + t.Errorf("%s has no %s row", k.name, vb.verb) + } + } + } + + // Generation is deterministic. + var a, b bytes.Buffer + for i, buf := range []*bytes.Buffer{&a, &b} { + rs, err := matrixRows(families["tcqwrite"](), matrixOpts{Seed: 1}) + if err != nil { + t.Fatalf("run %d: %v", i, err) + } + if err := writeRows(buf, nil, rs); err != nil { + t.Fatal(err) + } + } + if !bytes.Equal(a.Bytes(), b.Bytes()) { + t.Error("two generations differ") + } +}