def test_parse_image_meta_orphan(self): ''' Test the internal _parse_image_meta methode Feed it an 'orphan' image as we get it from from imgadm list -j ''' ret = { 'Error': 'This looks like an orphaned image, image payload was invalid.' } self.assertEqual(_parse_image_meta(image_orphan, True), ret)
def test_parse_image_meta_native(self): ''' Test the internal _parse_image_meta methode Feed it an 'native' image as we get it from from imgadm list -j ''' ret = { 'description': 'A SmartOS image pre-configured for building pkgsrc packages.', 'name': 'pkgbuild', 'os': 'smartos', 'published': '2018-04-09T08:25:52Z', 'source': 'https://images.joyent.com', 'version': '18.1.0' } self.assertEqual(_parse_image_meta(image_native, True), ret)
def test_parse_image_meta_native(self): """ Test the internal _parse_image_meta methode Feed it an 'native' image as we get it from from imgadm list -j """ ret = { "description": "A SmartOS image pre-configured for building pkgsrc packages.", "name": "pkgbuild", "os": "smartos", "published": "2018-04-09T08:25:52Z", "source": "https://images.joyent.com", "version": "18.1.0", } self.assertEqual(_parse_image_meta(image_native, True), ret)
def test_parse_image_meta_zvol(self): ''' Test the internal _parse_image_meta methode Feed it an 'zvol' image as we get it from from imgadm list -j ''' ret = { 'description': 'Ubuntu 18.04 LTS (20180808 64-bit). Certified Ubuntu Server ' 'Cloud Image from Canonical. For kvm and bhyve.', 'name': 'ubuntu-certified-18.04', 'os': 'linux', 'published': '2018-10-11T12:45:24.804Z', 'source': 'https://images.joyent.com', 'version': '20180808' } self.assertEqual(_parse_image_meta(image_zvol, True), ret)
def test_parse_image_meta_docker(self): """ Test the internal _parse_image_meta methode Feed it an 'docker' image as we get it from from imgadm list -j """ ret = { "description": ("Docker image imported from " "busybox42/zimbra-docker-centos:latest on " "2019-03-23T01:32:25.320Z."), "name": "busybox42/zimbra-docker-centos:latest", "os": "linux", "published": "2019-03-23T01:32:25.320Z", "source": "https://docker.io", "version": "62487cf6a7f6", } self.assertEqual(_parse_image_meta(image_docker, True), ret)
def test_parse_image_meta_zvol(self): """ Test the internal _parse_image_meta methode Feed it an 'zvol' image as we get it from from imgadm list -j """ ret = { "description": ("Ubuntu 18.04 LTS (20180808 64-bit). Certified Ubuntu Server " "Cloud Image from Canonical. For kvm and bhyve."), "name": "ubuntu-certified-18.04", "os": "linux", "published": "2018-10-11T12:45:24.804Z", "source": "https://images.joyent.com", "version": "20180808", } self.assertEqual(_parse_image_meta(image_zvol, True), ret)
def test_parse_image_meta_docker(self): ''' Test the internal _parse_image_meta methode Feed it an 'docker' image as we get it from from imgadm list -j ''' ret = { 'description': 'Docker image imported from ' 'busybox42/zimbra-docker-centos:latest on ' '2019-03-23T01:32:25.320Z.', 'name': 'busybox42/zimbra-docker-centos:latest', 'os': 'linux', 'published': '2019-03-23T01:32:25.320Z', 'source': 'https://docker.io', 'version': '62487cf6a7f6' } self.assertEqual(_parse_image_meta(image_docker, True), ret)
def test_parse_image_meta_lx(self): ''' Test the internal _parse_image_meta methode Feed it an 'lx' image as we get it from from imgadm list -j ''' ret = { 'description': 'Container-native Ubuntu 16.04 64-bit image. Built to run on ' 'containers with bare metal speed, while offering all the ' 'services of a typical unix host.', 'name': 'ubuntu-16.04', 'os': 'linux', 'published': '2016-06-01T02:17:41Z', 'source': 'https://images.joyent.com', 'version': '20160601' } self.assertEqual(_parse_image_meta(image_lx, True), ret)
def test_parse_image_meta_lx(self): """ Test the internal _parse_image_meta methode Feed it an 'lx' image as we get it from from imgadm list -j """ ret = { "description": ("Container-native Ubuntu 16.04 64-bit image. Built to run on " "containers with bare metal speed, while offering all the " "services of a typical unix host."), "name": "ubuntu-16.04", "os": "linux", "published": "2016-06-01T02:17:41Z", "source": "https://images.joyent.com", "version": "20160601", } self.assertEqual(_parse_image_meta(image_lx, True), ret)