Testing the factory module with backup retention.

-- Testcase --
{% include("./cmd/cmd.uc", { TRACE_CALLS: "stdout" }) %}
-- End --

-- Environment --
{ "id": 1, "cmd": { "command": "factory", "payload": {"keep_redirector": true } } }
-- End --

-- Expect stdout --
[call] fs.stat path </etc/ucentral/cert.key>
[call] fs.stat path </etc/ucentral/cert.pem>
[call] fs.stat path </etc/ucentral/redirector.json>
[call] fs.stat path </etc/ucentral/dev-id>
[call] fs.readlink path </etc/ucentral/ucentral.active>
[call] system command <[ "tar", "czf", "/sysupgrade.tgz", "/etc/config/ucentral", "/etc/ucentral/cert.key", "/etc/ucentral/cert.pem", "/etc/ucentral/redirector.json", "/etc/ucentral/dev-id", "/etc/ucentral/ucentral.active", "/etc/ucentral/ucentral.active-link" ]> timeout <null>
[call] system command <[ "jffs2reset", "-r", "-y", "-k" ]> timeout <null>
-- End --


Testing the factory module without backup retention.

-- Testcase --
{% include("./cmd/cmd.uc", { TRACE_CALLS: "stdout" }) %}
-- End --

-- Environment --
{ "id": 1, "cmd": { "command": "factory", "payload": {"keep_redirector": false } } }
-- End --

-- Expect stdout --
[call] system command <[ "jffs2reset", "-r", "-y" ]> timeout <null>
-- End --


-- File fs/stat~_etc_ucentral_cert_key.json --
{}
-- End --

-- File fs/stat~_etc_ucentral_cert_pem.json --
{}
-- End --

-- File fs/stat~_etc_ucentral_redirector_json.json --
{}
-- End --

-- File fs/stat~_etc_ucentral_dev-id.json --
{}
-- End --
