Files
dnsmasq-webui/testdata
alex 439192058e Add 16 dnsmasq options, fix srv→srv-host, expand tests
- DnsmasqConfKeys: add ReadEthers, DhcpOptionForce, DhcpMac, DhcpNameMatch,
  DhcpIgnoreNames, Ipset, Nftset, MxTarget, TftpNoFail, TftpNoBlocksize,
  DhcpRapidCommit, Localmx, Selfmx, EnableRa, LogDhcp, DhcpScript.
  Fix SRV option key: srv → srv-host (dnsmasq uses srv-host).
- Effective config: new multi-value, flags, single-value fields and sources;
  ConfigSetCache, EffectiveConfigFieldBuilder, Registry, Tooltips updated.
- Tests: split DnsmasqConfIncludeParserTests into focused classes
  (CoreBehaviour, Include, HostsAndLease, SingleValue, Records, Interfaces,
  ServerAndResolv, DhcpTftpDnssec, Flags, OfficialExample, NewOptions).
  Rename *_ParsesRealExample to *_WhenSet_ReturnsValue(s).
  Add DnsmasqConfIncludeParserOfficialExampleTests (dnsmasq.official.conf.example).
  Add DnsmasqConfIncludeParserNewOptionsTests (positive tests for 16 options).
  EffectiveDnsmasqConfigTests: extend CreateConfig for new constructor params.
- Testdata: add dnsmasq.official.conf.example; update README.
2026-02-12 02:14:33 +10:00
..
2026-01-31 03:06:46 +10:00

# Test data

Source for the Docker test harness: `scripts/prepare-test-mount.sh` syncs this dir to `testdata-mount/`, which is bind-mounted as `/data`. Unit tests use the copy in the test output dir (copied at build via the .csproj).

## Layout

| File / dir | Purpose |
|------------|--------|
| **dnsmasq-test.conf** | Harness main config (`/data/dnsmasq-test.conf`). DNS + DHCP; `conf-dir=/data/dnsmasq.d`, multiple server/addn-hosts/address/dhcp-range. |
| **dnsmasq.conf** | Minimal main (conf-dir only). Used by unit tests when conf-dir is absent. |
| **dnsmasq.conf.example** | Short commented reference (option categories). Not used by harness. |
| **dnsmasq.official.conf.example** | Official example from [imp/dnsmasq](https://github.com/imp/dnsmasq); all options commented. Used by unit tests to assert parser handles full example. |
| **dnsmasq.d/** | Included configs (conf-dir; alphabetical order). In the harness, "Config files (load order)" should list main, then these, then zz-dnsmasq-webui.conf. |
| **dnsmasq.d/01-other.conf** | `domain=local`. Not managed. |
| **dnsmasq.d/02-servers.conf** | Extra `server=` / `local=` (readonly in UI). |
| **dnsmasq.d/03-more.conf** | `resolv-file=`, `dhcp-option=`. Not managed. |
| **dnsmasq.d/dhcp.conf** | `dhcp-host=`; managed by app in real use, used as-is in harness. |
| **hosts** | First addn-hosts file; system hosts when `Dnsmasq:SystemHostsPath` points here. |
| **hosts.extra** | Second addn-hosts file. |
| **resolv.dnsmasq** | Minimal file for resolv-file= in 03-more.conf; must exist so dnsmasq does not fail/warn. |
| **leases** | Sample DHCP leases for unit tests only; not synced to the harness. The harness uses the path from config (`dhcp-leasefile=` in dnsmasq-test.conf); the app discovers and monitors that file; dnsmasq creates it when DHCP clients obtain addresses. |

Harness usage (start/stop/tidy): see **agents.md** in the repo root.

**Manual check for conf-dir fix:** After starting the harness, open the app and confirm "Config files (load order)" shows: main (`/data/dnsmasq-test.conf`), then conf-dir files (`01-other.conf`, `02-servers.conf`, `03-more.conf`, `dhcp.conf`), then managed (`zz-dnsmasq-webui.conf`). Unit test `GetIncludedPathsWithSource_ConfDirAndConfFile_ReturnsAllFilesInLoadOrderWithSources` asserts the same layout (main + conf-dir + conf-file) with sources.