]> git.proxmox.com Git - mirror_ovs.git/blame - tests/test-stream.c
oss-fuzz: Fix miniflow_target.c.
[mirror_ovs.git] / tests / test-stream.c
CommitLineData
cfef5ae8
IM
1/*
2 * Copyright (c) 2018 Ilya Maximets <i.maximets@samsung.com>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <config.h>
18
19#include "fatal-signal.h"
20#include "openvswitch/vlog.h"
21#include "stream.h"
22#include "util.h"
23
24VLOG_DEFINE_THIS_MODULE(test_stream);
25
26int
27main(int argc, char *argv[])
28{
29 int error;
30 struct stream *stream;
31
32 fatal_ignore_sigpipe();
33 set_program_name(argv[0]);
34
35 if (argc < 2) {
36 ovs_fatal(0, "usage: %s REMOTE", argv[0]);
37 }
38
39 error = stream_open_block(stream_open(argv[1], &stream, DSCP_DEFAULT),
77f42ca5 40 10000, &stream);
cfef5ae8
IM
41 if (error) {
42 VLOG_ERR("stream_open_block(%s) failure: %s",
43 argv[1], ovs_strerror(error));
44 }
45 return (error || !stream) ? 1 : 0;
46}