[vs]: fail the build when build kvm image fails (#2297)

Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
lguohan 2018-11-25 11:33:00 -08:00 committed by GitHub
parent 9c6ba9484b
commit f09488473d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -87,6 +87,11 @@ elif [ "$IMAGE_TYPE" = "kvm" ]; then
SONIC_USERNAME=$USERNAME PASSWD=$PASSWORD sudo -E ./build_kvm_image.sh $KVM_IMAGE_DISK $onie_recovery_image $OUTPUT_ONIE_IMAGE $KVM_IMAGE_DISK_SIZE
if [ $? -ne 0 ]; then
echo "Error : build kvm image failed"
exit 1
fi
[ -r $KVM_IMAGE_DISK ] || {
echo "Error : $KVM_IMAGE_DISK not generated!"
exit 1

View File

@ -56,7 +56,7 @@ prepare_installer_disk
-vga std \
-drive file=$DISK,media=disk,if=virtio,index=0 \
-drive file=$INSTALLER_DISK,if=virtio,index=1 \
-serial telnet:localhost:$KVM_PORT,server > $kvm_log 2>&1 &
-serial telnet:127.0.0.1:$KVM_PORT,server > $kvm_log 2>&1 &
kvm_pid=$!

View File

@ -24,7 +24,7 @@ def main():
cmd_prompt = "%s@sonic:~\$ $" % args.u
grub_selection = "The highlighted entry will be executed"
p = pexpect.spawn("telnet localhost %s" % args.p, timeout=600, logfile=sys.stdout)
p = pexpect.spawn("telnet 127.0.0.1 %s" % args.p, timeout=600, logfile=sys.stdout)
# select ONIE embed
p.expect(grub_selection)