2019-09-12 15:26:21 +00:00
|
|
|
process.env.ROOT_MOUNTPOINT = './test/data';
|
|
|
|
process.env.BOOT_MOUNTPOINT = '/mnt/boot';
|
|
|
|
process.env.CONFIG_JSON_PATH = '/config.json';
|
|
|
|
process.env.DATABASE_PATH = './test/data/database.sqlite';
|
|
|
|
process.env.DATABASE_PATH_2 = './test/data/database2.sqlite';
|
|
|
|
process.env.DATABASE_PATH_3 = './test/data/database3.sqlite';
|
|
|
|
process.env.LED_FILE = './test/data/led_file';
|
|
|
|
|
2020-05-28 17:15:33 +00:00
|
|
|
import * as fs from 'fs';
|
|
|
|
|
|
|
|
// Make sure they are no database files left over from
|
|
|
|
// previous runs
|
|
|
|
try {
|
|
|
|
fs.unlinkSync(process.env.DATABASE_PATH);
|
|
|
|
} catch {
|
|
|
|
/* noop */
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
fs.unlinkSync(process.env.DATABASE_PATH_2);
|
|
|
|
} catch {
|
|
|
|
/* noop */
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
fs.unlinkSync(process.env.DATABASE_PATH_3);
|
|
|
|
} catch {
|
|
|
|
/* noop */
|
|
|
|
}
|
2020-06-02 13:29:05 +00:00
|
|
|
fs.writeFileSync(
|
|
|
|
'./test/data/config.json',
|
|
|
|
fs.readFileSync('./test/data/testconfig.json'),
|
|
|
|
);
|
2019-09-12 15:26:21 +00:00
|
|
|
|
2020-10-30 21:38:19 +00:00
|
|
|
import './lib/mocked-dbus';
|
2020-08-13 12:25:39 +00:00
|
|
|
import './lib/mocked-dockerode';
|
|
|
|
import './lib/mocked-iptables';
|
|
|
|
import './lib/mocked-event-tracker';
|