commit b8c2215fda6bdb4b303900fc8b1e3e2f94d5e54c
Author: Stefan Nica <snica@suse.com>
Date:   Wed Sep 9 14:06:48 2020 +0200

    Enable tests to run on a SUSE container
    
    Those changes are required to be able to run the harbor tests on a
    container running SLES or openSUSE 15.

Index: harbor-2.1.2/tests/apitests/python/library/cnab.py
===================================================================
--- harbor-2.1.2.orig/tests/apitests/python/library/cnab.py
+++ harbor-2.1.2/tests/apitests/python/library/cnab.py
@@ -20,7 +20,7 @@ def load_bundle(service_image, invocatio
 
 def cnab_fixup_bundle(bundle_file, target, auto_update_bundle = True):
     fixed_bundle_file = "./tests/apitests/python/bundle_data/fixed-bundle.json"
-    command = ["sudo", "cnab-to-oci", "--log-level", "debug", "fixup", bundle_file, "--target", target, "--bundle", fixed_bundle_file]
+    command = ["cnab-to-oci", "--log-level", "debug", "fixup", bundle_file, "--target", target, "--bundle", fixed_bundle_file]
     if auto_update_bundle == True:
          command.append("--auto-update-bundle")
          #fixed_bundle_file = bundle_file
Index: harbor-2.1.2/tests/apitests/python/library/containerd.py
===================================================================
--- harbor-2.1.2.orig/tests/apitests/python/library/containerd.py
+++ harbor-2.1.2/tests/apitests/python/library/containerd.py
@@ -5,13 +5,13 @@ import json
 import docker_api
 
 def ctr_images_pull(username, password, oci):
-    command = ["sudo", "ctr", "images", "pull","--snapshotter", "native", "-u", username+":"+password, oci]
+    command = ["containerd-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 = ["sudo", "ctr", "images", "list", "--q"]
+    command = ["containerd-ctr", "images", "list", "--q"]
     print("Command: ", command)
     ret = base.run_command(command)
     print("Command return: ", ret)
Index: harbor-2.1.2/tests/apitests/python/library/docker_api.py
===================================================================
--- harbor-2.1.2.orig/tests/apitests/python/library/docker_api.py
+++ harbor-2.1.2/tests/apitests/python/library/docker_api.py
@@ -22,7 +22,7 @@ def docker_login_cmd(harbor_host, userna
     if  username == "" or password == "":
         print("[Warnig]: No docker credential was provided.")
         return
-    command = ["sudo", "docker", "login", harbor_host, "-u", username, "-p", password]
+    command = ["docker", "login", harbor_host, "-u", username, "-p", password]
     print( "Docker Login Command: ", command)
     base.run_command(command)
     if enable_manifest == True:
@@ -33,13 +33,13 @@ def docker_login_cmd(harbor_host, userna
             raise Exception("Failed to update docker config, error is {} {}.".format(exc.returncode, exc.output))
 
 def docker_manifest_create(index, manifests):
-    command = ["sudo", "docker","manifest","create", "--amend", index]
+    command = ["docker","manifest","create", "--amend", index]
     command.extend(manifests)
     print( "Docker Manifest Command: ", command)
     base.run_command(command)
 
 def docker_manifest_push(index):
-    command = ["sudo", "docker","manifest","push",index]
+    command = ["docker","manifest","push",index]
     print( "Docker Manifest Command: ", command)
     ret = base.run_command(command)
     index_sha256=""
Index: harbor-2.1.2/tests/apitests/python/update_docker_cfg.sh
===================================================================
--- harbor-2.1.2.orig/tests/apitests/python/update_docker_cfg.sh
+++ harbor-2.1.2/tests/apitests/python/update_docker_cfg.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ $(cat /$HOME/.docker/config.json |grep experimental |wc -l) -eq 0 ];then
-    sudo sed -i '$d' /$HOME/.docker/config.json
-    sudo sed -i '$d' /$HOME/.docker/config.json
-    sudo echo -e "},\n        \"experimental\": \"enabled\"\n}" >> /$HOME/.docker/config.json
+    sed -i '$d' /$HOME/.docker/config.json
+    sed -i '$d' /$HOME/.docker/config.json
+    echo -e "},\n        \"experimental\": \"enabled\"\n}" >> /$HOME/.docker/config.json
 fi
