X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-bundle.c;h=5e5ef525e2a35b7429e8c4f05d612ee12af2af13;hb=5794e276b48638c7e44a763481aa051111de1676;hp=0e7525c3877c59e8b9910c9392662d35be5cab5b;hpb=4e022ec09e14ac89add74c1b4b8e3ff3873edbf0;p=sliver-openvswitch.git diff --git a/tests/test-bundle.c b/tests/test-bundle.c index 0e7525c38..5e5ef525e 100644 --- a/tests/test-bundle.c +++ b/tests/test-bundle.c @@ -1,4 +1,4 @@ -/* 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. @@ -23,7 +23,6 @@ #include "flow.h" #include "ofp-actions.h" #include "ofpbuf.h" -#include "random.h" #include "util.h" @@ -71,9 +70,14 @@ parse_bundle_actions(char *actions) struct ofpact_bundle *bundle; struct ofpbuf ofpacts; struct ofpact *action; + char *error; ofpbuf_init(&ofpacts, 0); - bundle_parse_load(actions, &ofpacts); + error = bundle_parse_load(actions, &ofpacts); + if (error) { + ovs_fatal(0, "%s", error); + } + action = ofpacts.data; bundle = ofpact_get_BUNDLE(xmemdup(action, action->len)); ofpbuf_uninit(&ofpacts); @@ -111,7 +115,6 @@ main(int argc, char *argv[]) int old_active; set_program_name(argv[0]); - random_init(); if (argc != 2) { ovs_fatal(0, "usage: %s bundle_action", program_name); @@ -135,9 +138,7 @@ main(int argc, char *argv[]) /* Generate flows. */ flows = xmalloc(N_FLOWS * sizeof *flows); for (i = 0; i < N_FLOWS; i++) { - random_bytes(&flows[i], sizeof flows[i]); - memset(flows[i].zeros, 0, sizeof flows[i].zeros); - flows[i].mpls_depth = 0; + flow_random_hash_fields(&flows[i]); flows[i].regs[0] = ofp_to_u16(OFPP_NONE); }