mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 10:33:52 +01:00
Problem: VMCI tests are not skipped outside VMs
Solution: check CID and skip if unavailable
This commit is contained in:
parent
acfdf67127
commit
ccdc2f7583
@ -38,8 +38,11 @@ SETUP_TEARDOWN_TESTCONTEXT
|
|||||||
|
|
||||||
void test_pair_vmci ()
|
void test_pair_vmci ()
|
||||||
{
|
{
|
||||||
|
unsigned int cid = VMCISock_GetLocalCID ();
|
||||||
|
if (cid == VMADDR_CID_ANY)
|
||||||
|
TEST_IGNORE_MESSAGE ("VMCI environment unavailable, skipping test");
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << "vmci://" << VMCISock_GetLocalCID () << ":" << 5560;
|
s << "vmci://" << cid << ":" << 5560;
|
||||||
std::string endpoint = s.str ();
|
std::string endpoint = s.str ();
|
||||||
|
|
||||||
void *sb = test_context_socket (ZMQ_PAIR);
|
void *sb = test_context_socket (ZMQ_PAIR);
|
||||||
|
@ -38,8 +38,11 @@ SETUP_TEARDOWN_TESTCONTEXT
|
|||||||
|
|
||||||
void test_reqrep_vmci ()
|
void test_reqrep_vmci ()
|
||||||
{
|
{
|
||||||
|
unsigned int cid = VMCISock_GetLocalCID ();
|
||||||
|
if (cid == VMADDR_CID_ANY)
|
||||||
|
TEST_IGNORE_MESSAGE ("VMCI environment unavailable, skipping test");
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << "vmci://" << VMCISock_GetLocalCID () << ":" << 5560;
|
s << "vmci://" << cid << ":" << 5560;
|
||||||
std::string endpoint = s.str ();
|
std::string endpoint = s.str ();
|
||||||
|
|
||||||
void *sb = test_context_socket (ZMQ_DEALER);
|
void *sb = test_context_socket (ZMQ_DEALER);
|
||||||
|
Loading…
Reference in New Issue
Block a user