Testing/Validating uci-defaults scripts before deployment

With the release of 22.03, I'm planning on flashing my router (R7800) with a fresh image (not keeping settings from 21.02) to have a clean start.

As part of the process, I want to use uci-defaults scripts to have the router configure itself after I flash it, so that I don't manually have to manually configure all of the settings on my router. I think I have everything set up to a functional state, but I'm not entirely sure.

If I had a second router that was the same model, I would just use that test the image before putting it on my main router, but I don't.

Is there a way that I can test the scripts to make sure it sets everything up the way I want?

You can do the same uci calls outside of uci-defaults, but that isn't guaranteed to result in the same settings (as firstboot environment, with everything unset, isn't quite the same as an already partially configured system at runtime), testing on a different model or OpenWrt version likewise introduces some differences. At some point you need to test the real deal…

I wouldn’t have the complete system setup in uci defaults if it isn’t needed.

Only have absolute minimum system setup to start the system in uci defaults (for example setup dhcp client mode if needed so you can access the device) and make the rest with a setup script from working system.
Then you have a pretty safe fallback position with a reset button push!