Skip to content
Permalink
Browse files

cmake: Add serial port for ppp in qemu

In order to simplify ppp testing, use ppp specific serial port
when starting qemu.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed Mar 26, 2019
1 parent 02239a9 commit 64bdad20b6c7b80686578fbaf1b869ce80db6dcb
Showing with 23 additions and 7 deletions.
  1. +23 −7 cmake/emu/qemu.cmake
@@ -75,12 +75,15 @@ endif()
# If we are running a networking application in QEMU, then set proper
# QEMU variables. This also allows two QEMUs to be hooked together and
# pass data between them. The QEMU flags are not set for standalone
# tests defined by CONFIG_NET_TEST.
# tests defined by CONFIG_NET_TEST. For PPP, the serial port file is
# not available if we run unit tests which define CONFIG_NET_TEST.
if(CONFIG_NETWORKING)
if(CONFIG_NET_QEMU_SLIP)
if((CONFIG_NET_SLIP_TAP) OR (CONFIG_IEEE802154_UPIPE))
set(QEMU_NET_STACK 1)
endif()
elseif((CONFIG_NET_QEMU_PPP) AND NOT (CONFIG_NET_TEST))
set(QEMU_NET_STACK 1)
endif()
endif()

@@ -143,15 +146,28 @@ elseif(QEMU_NET_STACK)
# appending the instance name to the pid file we can easily run more
# instances of the same sample.

if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(tmp_file unix:/tmp/slip.sock\${QEMU_INSTANCE})
if(CONFIG_NET_QEMU_PPP)
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(ppp_path unix:/tmp/ppp\${QEMU_INSTANCE})
else()
set(ppp_path unix:/tmp/ppp${QEMU_INSTANCE})
endif()

list(APPEND MORE_FLAGS_FOR_${target}
-serial ${ppp_path}
)
else()
set(tmp_file unix:/tmp/slip.sock${QEMU_INSTANCE})
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(tmp_file unix:/tmp/slip.sock\${QEMU_INSTANCE})
else()
set(tmp_file unix:/tmp/slip.sock${QEMU_INSTANCE})
endif()

list(APPEND MORE_FLAGS_FOR_${target}
-serial ${tmp_file}
)
endif()

list(APPEND MORE_FLAGS_FOR_${target}
-serial ${tmp_file}
)
endif()
endforeach()

0 comments on commit 64bdad2

Please sign in to comment.
You can’t perform that action at this time.