2022-10-11 22:38:26 +02:00
|
|
|
/* jslint node:true */
|
|
|
|
|
/* global it:false */
|
|
|
|
|
/* global before:false */
|
|
|
|
|
/* global after:false */
|
|
|
|
|
/* global describe:false */
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const common = require('./common.js'),
|
|
|
|
|
docker = require('../docker.js'),
|
|
|
|
|
expect = require('expect.js');
|
|
|
|
|
|
|
|
|
|
describe('docker', function () {
|
|
|
|
|
const { setup, cleanup } = common;
|
|
|
|
|
|
|
|
|
|
before(setup);
|
|
|
|
|
after(cleanup);
|
|
|
|
|
|
|
|
|
|
it('can df', async function () {
|
|
|
|
|
const output = await docker.df();
|
|
|
|
|
expect(output).to.be.ok();
|
|
|
|
|
});
|
2024-12-14 14:00:05 +01:00
|
|
|
|
|
|
|
|
it('parseImageRef', async function () {
|
2024-12-14 14:10:29 +01:00
|
|
|
expect(docker.parseImageRef('cloudron/base')).to.eql({ fullRepositoryName: 'cloudron/base', registry: null, tag: null, digest: null });
|
|
|
|
|
expect(docker.parseImageRef('cloudron/base:4.2.0')).to.eql({ fullRepositoryName: 'cloudron/base', registry: null, tag: '4.2.0', digest: null });
|
|
|
|
|
expect(docker.parseImageRef('cloudron/base@sha256:xx')).to.eql({ fullRepositoryName: 'cloudron/base', registry: null, tag: null, digest: 'xx' });
|
|
|
|
|
expect(docker.parseImageRef('cloudron/base:4.2.0@sha256:xx')).to.eql({ fullRepositoryName: 'cloudron/base', registry: null, tag: '4.2.0', digest: 'xx' });
|
|
|
|
|
expect(docker.parseImageRef('registry.com/cloudron/base:4.2.0@sha256:xx')).to.eql({ fullRepositoryName: 'registry.com/cloudron/base', registry: 'registry.com', tag: '4.2.0', digest: 'xx' });
|
2025-01-03 10:09:00 +01:00
|
|
|
expect(docker.parseImageRef('registry.com/base:4.2.0@sha256:xx')).to.eql({ fullRepositoryName: 'registry.com/base', registry: 'registry.com', tag: '4.2.0', digest: 'xx' }); // optional namespace
|
2024-12-14 14:00:05 +01:00
|
|
|
});
|
2022-10-11 22:38:26 +02:00
|
|
|
});
|