git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix remote-snapshot with external nodes
[sliver-openvswitch.git]
/
tests
/
test-odp.c
diff --git
a/tests/test-odp.c
b/tests/test-odp.c
index
2b4cfe1
..
268a105
100644
(file)
--- a/
tests/test-odp.c
+++ b/
tests/test-odp.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2011, 2012
, 2013
Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-28,10
+28,11
@@
static int
parse_keys(void)
{
static int
parse_keys(void)
{
+ int exit_code = 0;
struct ds in;
ds_init(&in);
struct ds in;
ds_init(&in);
- vlog_set_levels_from_string("odp_util:console:dbg");
+ vlog_set_levels_from_string
_assert
("odp_util:console:dbg");
while (!ds_get_test_line(&in, stdin)) {
enum odp_key_fitness fitness;
struct ofpbuf odp_key;
while (!ds_get_test_line(&in, stdin)) {
enum odp_key_fitness fitness;
struct ofpbuf odp_key;
@@
-69,7
+70,13
@@
parse_keys(void)
/* Convert cls_rule back to odp_key. */
ofpbuf_uninit(&odp_key);
ofpbuf_init(&odp_key, 0);
/* Convert cls_rule back to odp_key. */
ofpbuf_uninit(&odp_key);
ofpbuf_init(&odp_key, 0);
- odp_flow_key_from_flow(&odp_key, &flow);
+ odp_flow_key_from_flow(&odp_key, &flow, flow.in_port);
+
+ if (odp_key.size > ODPUTIL_FLOW_KEY_BYTES) {
+ printf ("too long: %zu > %d\n",
+ odp_key.size, ODPUTIL_FLOW_KEY_BYTES);
+ exit_code = 1;
+ }
/* Convert odp_key to string. */
ds_init(&out);
/* Convert odp_key to string. */
ds_init(&out);
@@
-82,7
+89,7
@@
parse_keys(void)
}
ds_destroy(&in);
}
ds_destroy(&in);
- return
0
;
+ return
exit_code
;
}
static int
}
static int
@@
-91,7
+98,7
@@
parse_actions(void)
struct ds in;
ds_init(&in);
struct ds in;
ds_init(&in);
- vlog_set_levels_from_string("odp_util:console:dbg");
+ vlog_set_levels_from_string
_assert
("odp_util:console:dbg");
while (!ds_get_test_line(&in, stdin)) {
struct ofpbuf odp_actions;
struct ds out;
while (!ds_get_test_line(&in, stdin)) {
struct ofpbuf odp_actions;
struct ds out;