1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 07:15:41 +00:00

cleanup tests using SSH

This commit is contained in:
Ivan Mikushin
2016-03-31 18:56:18 -07:00
parent 2dd57c5f3a
commit e2f3ac78a7
6 changed files with 31 additions and 29 deletions

View File

@@ -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