2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 13:58:14 +00:00

tests-windows: Make flow extractor work on Windows

+Traceback (most recent call last):
+  File "../.././flowgen.py", line 204, in <module>
+    flows = os.fdopen(3, 'wb')
+OSError: [Errno 9] Bad file descriptor
./library.at:4: exit code was 1, expected 0

Unfortunately 3/4/5/.. FDs don't work on Windows. Switch to a filename open
instead of opening the FDs.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>
This commit is contained in:
Alin Gabriel Serdean
2018-03-08 02:24:19 +02:00
parent 7954d04a89
commit c2104b9bcd
2 changed files with 3 additions and 4 deletions

View File

@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import os
import socket import socket
import struct import struct
@@ -201,8 +200,8 @@ def output(attrs):
packets.write(packet) packets.write(packet)
flows = os.fdopen(3, 'wb') flows = open('flows', 'wb')
packets = os.fdopen(4, 'wb') packets = open('pcap', 'wb')
# Print pcap file header. # Print pcap file header.
packets.write(struct.pack('>LHHLLLL', packets.write(struct.pack('>LHHLLLL',

View File

@@ -1,7 +1,7 @@
AT_BANNER([library unit tests]) AT_BANNER([library unit tests])
AT_SETUP([flow extractor]) AT_SETUP([flow extractor])
AT_CHECK([$PYTHON $srcdir/flowgen.py >/dev/null 3>flows 4>pcap]) AT_CHECK([$PYTHON $srcdir/flowgen.py >/dev/null])
AT_CHECK([ovstest test-flows flows pcap], [0], [checked 247 packets, 0 errors AT_CHECK([ovstest test-flows flows pcap], [0], [checked 247 packets, 0 errors
]) ])
AT_CLEANUP AT_CLEANUP