diff --git a/scripts/run b/scripts/run index 96caa7b9..6632c6e1 100755 --- a/scripts/run +++ b/scripts/run @@ -1,6 +1,5 @@ #!/bin/bash set -e -set -x cd $(dirname $0)/.. @@ -195,6 +194,7 @@ if [ "$QEMU" == "1" ]; then KVM_ENABLE="-enable-kvm" CPU="-cpu host" fi + set -x exec qemu-system-${QEMUARCH} -serial stdio \ -rtc base=utc,clock=host \ ${KVM_ENABLE} \ @@ -202,7 +202,7 @@ if [ "$QEMU" == "1" ]; then ${machine["$ARCH"]} \ -kernel ${KERNEL} \ -initrd ${INITRD} \ - -m 1024 \ + -m 2048 \ ${network["$ARCH"]} \ $(eval "${cd["$ARCH"]} ${CCIMG}") \ $(eval "${hd["$ARCH"]} ${HD}") \ @@ -240,6 +240,7 @@ elif [ "$QIND" == "1" ]; then SSH_PUB_ENABLE="--ssh-pub /stuff/rancher.key.pub" fi + set -x docker create --name=${NAME} -it ${KVM_ENABLE} \ rancher/qind \ --hostname "rancher-dev" \ diff --git a/tests/integration/rostest/test_01_cloud_config.py b/tests/integration/rostest/test_01_cloud_config.py index 18fc5ed3..35c1c7e8 100644 --- a/tests/integration/rostest/test_01_cloud_config.py +++ b/tests/integration/rostest/test_01_cloud_config.py @@ -75,15 +75,12 @@ def test_services_include(qemu, cloud_config): @pytest.mark.timeout(40) def test_docker_tls_args(qemu, cloud_config): - u.wait_for_ssh(qemu, ssh_command) - - subprocess.check_call( - ssh_command + ['sudo', 'ros', 'tls', 'gen'], - stderr=subprocess.STDOUT, universal_newlines=True) - - subprocess.check_call( - ssh_command + ['docker', '--tlsverify', 'version'], - stderr=subprocess.STDOUT, universal_newlines=True) + SSH(qemu, ssh_command).check_call(''' +set -e -x +sudo ros tls gen +sleep 3 +docker --tlsverify version + '''.strip()) @pytest.mark.timeout(40) @@ -99,9 +96,9 @@ def test_rancher_network(qemu, cloud_config): def test_docker_not_pid_one(qemu): - SSH(qemu, ssh_command=ssh_command).check_call('bash', '-c', ''' - set -e -x - for i in $(pidof docker); do - [ $i != 1 ] - done + SSH(qemu, ssh_command).check_call(''' +set -e -x +for i in $(pidof docker); do + [ $i != 1 ] +done '''.strip()) diff --git a/tests/integration/rostest/test_06_subdir.py b/tests/integration/rostest/test_06_subdir.py index 078f7640..4d8aad40 100644 --- a/tests/integration/rostest/test_06_subdir.py +++ b/tests/integration/rostest/test_06_subdir.py @@ -11,9 +11,9 @@ def qemu(request): def test_system_docker_survives_custom_docker_install(qemu): - SSH(qemu).check_call('bash', '-c', ''' - set -x -e - mkdir x - sudo mount $(sudo ros dev LABEL=RANCHER_STATE) x - [ -d x/ros_subdir/home/rancher ] + SSH(qemu).check_call(''' +set -x -e +mkdir x +sudo mount $(sudo ros dev LABEL=RANCHER_STATE) x +[ -d x/ros_subdir/home/rancher ] '''.strip()) diff --git a/tests/integration/rostest/test_07_oem.py b/tests/integration/rostest/test_07_oem.py index 33723333..aea8767e 100644 --- a/tests/integration/rostest/test_07_oem.py +++ b/tests/integration/rostest/test_07_oem.py @@ -12,12 +12,13 @@ def qemu(request): def test_oem(qemu): - SSH(qemu).check_call('sudo', 'bash', '-c', ''' + try: + SSH(qemu).check_call(''' set -x set -e sudo mkfs.ext4 -L RANCHER_OEM /dev/vda sudo mount /dev/vda /mnt -cat > /tmp/oem-config.yml << "EOF" +cat > /tmp/oem-config.yml << EOF #cloud-config rancher: upgrade: @@ -25,11 +26,14 @@ rancher: EOF sudo cp /tmp/oem-config.yml /mnt sudo umount /mnt -sudo reboot >/dev/null 2>&1 &'''.strip()) +sudo reboot + '''.strip()) + except: + pass - time.sleep(1) + time.sleep(3) - SSH(qemu).check_call('bash', '-c', ''' + SSH(qemu).check_call(''' set -x if [ ! -e /usr/share/ros/oem/oem-config.yml ]; then echo Failed to find /usr/share/ros/oem/oem-config.yml diff --git a/tests/integration/rostest/test_08_ssh_key_merge.py b/tests/integration/rostest/test_08_ssh_key_merge.py index e3d6f9c9..0e49d365 100644 --- a/tests/integration/rostest/test_08_ssh_key_merge.py +++ b/tests/integration/rostest/test_08_ssh_key_merge.py @@ -11,7 +11,7 @@ def qemu(request): def test_ssh_key_merging(qemu): - SSH(qemu).check_call('bash', '-c', '''cat > test-merge << "SCRIPT" + SSH(qemu).check_call('''cat > test-merge << "SCRIPT" set -x -e rm /var/lib/rancher/conf/cloud-config.yml diff --git a/tests/integration/rostest/test_09_network.py b/tests/integration/rostest/test_09_network.py index 8ab98857..a4f17948 100644 --- a/tests/integration/rostest/test_09_network.py +++ b/tests/integration/rostest/test_09_network.py @@ -21,7 +21,7 @@ def qemu(request): def test_network_conf(qemu): - SSH(qemu).check_call('bash', '-c', '''cat > test-merge << "SCRIPT" + SSH(qemu).check_call('''cat > test-merge << "SCRIPT" set -x -e ip link show dev br0 @@ -37,7 +37,7 @@ sudo bash test-merge def test_network_dns_ros_set(qemu): - SSH(qemu).check_call('bash', '-c', ''' + SSH(qemu).check_call(''' set -x -e sudo ros config set rancher.network.dns.search '[a,b]'