Skip to content
Snippets Groups Projects
Commit 87b463d4 authored by Peter Senna Tschudin's avatar Peter Senna Tschudin
Browse files

Use portable path and stop using ssh-copy-id


This merge includes:
 0c7a9d45 for using portable string
 representation for file path

 f956e3b0 for removing the usage of
 ssh-copy-id script

Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@collabora.com>
parents 7743e46f 65c39f6c
No related branches found
No related tags found
1 merge request!195Merge pending fixes to the psdk test
Pipeline #136184 passed with warnings
Pipeline: apertis-tests

#136186

    ......@@ -23,6 +23,7 @@
    from psdk_commands import PsdkCommands
    from argparse import ArgumentParser
    from pathlib import Path
    import os.path
    ......@@ -55,9 +56,8 @@ class PsdkTest(object):
    def __init__(self, test_type, image_release, image_path, debug):
    self.test_type = test_type
    self.release = image_release
    self.image_path = image_path
    self.pdisk_path = os.path.join(os.path.dirname(image_path),
    "test-sdk-persistent-disk.vdi")
    self.image_path = str(image_path)
    self.pdisk_path = str(image_path.parent / "test-sdk-persistent-disk.vdi")
    self.old_sdk = "apertis-psdk-test-old-sdk"
    self.new_sdk = "apertis-psdk-test-new-sdk"
    self.user_test_file = "psdk_test_file"
    ......@@ -166,7 +166,8 @@ if __name__ == '__main__':
    args = parser.parse_args()
    if not os.path.isfile(args.IMAGE_PATH):
    image_path = Path(args.IMAGE_PATH)
    if not image_path.exists():
    print("File %s does not exist" % args.IMAGE_PATH)
    print("Please pass a valid SDK image path")
    exit(1)
    ......@@ -177,7 +178,7 @@ if __name__ == '__main__':
    print("Image: " + args.IMAGE_PATH)
    print()
    psdk_test = PsdkTest(args.TEST_TYPE, args.IMAGE_RELEASE, args.IMAGE_PATH,
    psdk_test = PsdkTest(args.TEST_TYPE, args.IMAGE_RELEASE, image_path,
    args.debug)
    try:
    while True:
    ......
    ......@@ -51,7 +51,7 @@ class PsdkCommands(object):
    else:
    _run_command(cmd, ssh, output)
    def _ssh(self, lst=[], copy_id=False, copy_file=False):
    def _ssh(self, lst=[], copy_file=False):
    ssh_opts = [ "-o", "StrictHostKeyChecking=no",
    "-o", "UserKnownHostsFile=/dev/null",
    "-o", "LogLevel=ERROR" ]
    ......@@ -59,8 +59,7 @@ class PsdkCommands(object):
    return [ "scp", "-i", self.ssh_id_file,
    "-P", self.local_port ] + ssh_opts + lst
    else:
    cmd = "ssh-copy-id" if copy_id else "ssh"
    return [ cmd, self.local_host, "-i", self.ssh_id_file, "-p",
    return [ "ssh", self.local_host, "-i", self.ssh_id_file, "-p",
    self.local_port ] + ssh_opts + lst
    def create_vm(self, vm):
    ......@@ -133,7 +132,8 @@ class PsdkCommands(object):
    self._run([ self.vbox_manage, "unregistervm", vm, "--delete" ])
    def copy_ssh_key(self):
    self._run(self._ssh(copy_id=True), ssh=True)
    kdir = (self.local_host + ":/home/user/.ssh/")
    self._run(self._ssh(["-rp", "ssh/", kdir], copy_file=True), ssh=True)
    def clean(self):
    print("Cleaning environment ...")
    ......
    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEJw7Nz6/jghVPCZa+8MFTajN4vUZh3aukPeonmlp6RYwIvnnDBWBxBQpRyhfRsNDAMsSvmmH4AL9eaEbCNUgMQbw2oYKup28Qe65gizyfnJE69fuxZ++XCHemvbE7s9II/V1LxGSH2wkjliM0/uKHXzZap2pJdwbWwDm/vQAVLUNR/kYiMUg50niRKZsfUSvLF5m6CzcsH8ElbVegv+g96Eo+5+tIWO9E2PtMixcjLIJRNStU2Z2+OD6o1FZtK4gEPCUODCcjxYpYBDdGh6OdXINCShZdQwOrsfPPVCSknN4wxVedHeU6M+N8y4q3SBPsznY4nHr0+ghro+EM2PvF user@apertis
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment