Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion bin/website/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,26 @@ ava.serial('website snapshot restore', async t => {
await tests.run(`website snapshot create --website ${website.name} --name ${snapshotName}`);
const websiteRestored = await tests.run(`website create --name ${tests.getName('restored', t.title)} ${commonCreateParams} --password ${password} --source-website ${website.id} --source-snapshot ${snapshotName}`);
await tests.run(`website snapshot delete --yes --website ${website.name} --snapshot ${snapshotName}`);
const contentRestored = await ssh.execResource(website, { password }, 'cat public/test.txt');
const contentRestored = await ssh.execResource(websiteRestored, { password }, 'cat public/test.txt');
t.true(contentRestored.trim() === content);
await tests.remove('website', website); // remove source of snapshot first
await tests.remove('website', websiteRestored);
});

ava.serial('website snapshot access via .zfs', async t => {
const password = await tests.getToken();
const website = await tests.run(`website create --name ${tests.getName(t.title)} ${commonCreateParams} --password ${password}`);
const content = await tests.getToken();
await putFileWebsite(website, { password }, 'public/test.txt', content);
const snapshotName = tests.getName('snapshot', t.title);
await tests.run(`website snapshot create --website ${website.name} --name ${snapshotName}`);
const contentRestored = await ssh.execResource(website, { password }, `cat /data/.zfs/snapshot/${snapshotName}/public/test.txt`);
t.true(contentRestored.trim() === content);
await tests.run(`website snapshot delete --yes --website ${website.name} --snapshot ${snapshotName}`);
await tests.remove('website', website);
});


ava.serial('website log', async t => {
const password = await tests.getToken();
const website = await tests.run(`website create --name ${tests.getName(t.title)} ${commonCreateParams} --password ${password}`);
Expand Down