harbor/tests/apitests/python/library/containerd.py
danfengliu 1801a3cee3 Add manifest and CNAB replication tests
1. Add manifest and CNAB replication tests;
2. Duplicate ORAS and sigularity tests from API test to nightly common
tests;
3. Optimize get dns code in CI;
4. Optimize E2E dockerfile;
5. Sample image size should be cover requirement for large size like 512M.

Signed-off-by: danfengliu <danfengl@vmware.com>
2021-04-02 15:39:30 +08:00

22 lines
682 B
Python

# -*- coding: utf-8 -*-
import base
import json
import docker_api
def ctr_images_pull(username, password, oci):
command = ["ctr", "images", "pull","--snapshotter", "native", "-u", username+":"+password, oci]
print("Command: ", command)
ret = base.run_command(command)
print("Command return: ", ret)
def ctr_images_list(oci_ref = None):
command = ["ctr", "images", "list", "--q"]
print("Command: ", command)
ret = base.run_command(command)
print("Command return: ", ret)
if oci_ref is not None and oci_ref not in ret.split("\n"):
raise Exception(r" Get OCI ref failed, expected ref is [{}], but return ref list is [{}]".format (ret))