mirror of
https://github.com/rancher/os.git
synced 2025-08-11 19:42:24 +00:00
Merge pull request #587 from imikushin/fix-135
installer: copy 1M zeroes to the target device before running fdisk
This commit is contained in:
commit
af1ee1c5f3
@ -28,11 +28,11 @@ if [ "$PARTITION_COUNT" -gt "1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
dd if=/dev/zero of=${DEVICE} bs=512 count=1
|
|
||||||
partprobe ${DEVICE}
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dd if=/dev/zero of=${DEVICE} bs=512 count=2048
|
||||||
|
partprobe ${DEVICE}
|
||||||
|
|
||||||
fdisk ${DEVICE} <<EOF
|
fdisk ${DEVICE} <<EOF
|
||||||
n
|
n
|
||||||
p
|
p
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import rancherostest.util as u
|
import rancherostest.util as u
|
||||||
import subprocess
|
import subprocess
|
||||||
import yaml
|
|
||||||
|
|
||||||
|
|
||||||
ssh_command = ['./scripts/ssh', '--qemu', '--key', './tests/integration/assets/test.key']
|
ssh_command = ['./scripts/ssh', '--qemu', '--key', './tests/integration/assets/test.key']
|
||||||
@ -13,11 +12,6 @@ def qemu(request):
|
|||||||
return u.run_qemu(request, ['--cloud-config', cloud_config_path])
|
return u.run_qemu(request, ['--cloud-config', cloud_config_path])
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
|
||||||
def cloud_config():
|
|
||||||
return yaml.load(open(cloud_config_path))
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.timeout(40)
|
@pytest.mark.timeout(40)
|
||||||
def test_reboot_with_container_running(qemu):
|
def test_reboot_with_container_running(qemu):
|
||||||
assert qemu is not None
|
assert qemu is not None
|
||||||
|
28
tests/integration/rancherostest/test_04_ros_install.py
Normal file
28
tests/integration/rancherostest/test_04_ros_install.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import pytest
|
||||||
|
import rancherostest.util as u
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
|
ssh_command = ['./scripts/ssh', '--qemu']
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="module")
|
||||||
|
def qemu(request):
|
||||||
|
return u.run_qemu(request, ['--no-format'])
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.timeout(40)
|
||||||
|
def test_ros_install_on_formatted_disk(qemu):
|
||||||
|
assert qemu is not None
|
||||||
|
u.wait_for_ssh(ssh_command)
|
||||||
|
subprocess.check_call(ssh_command + ['sudo', 'mkfs.ext4', '/dev/vda'],
|
||||||
|
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||||
|
|
||||||
|
subprocess.check_call(ssh_command + ['sudo', 'ros', 'install', '-f', '--no-reboot', '-d', '/dev/vda',
|
||||||
|
'-i', 'rancher/os:v0.4.0-dev-test.135'],
|
||||||
|
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||||
|
|
||||||
|
subprocess.call(ssh_command + ['sudo', 'reboot'],
|
||||||
|
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||||
|
|
||||||
|
u.wait_for_ssh(ssh_command)
|
Loading…
Reference in New Issue
Block a user