vlan03.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. # Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
  4. # Copyright (c) 2015-2017 Oracle and/or its affiliates.
  5. # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
  6. #
  7. # Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual
  8. # sub-nets between two hosts, then will compare TCP performance
  9. # with and without VLAN using ping or netstress test.
  10. #
  11. # Test-case 2: The same as above but must fail, because VLAN allows
  12. # to communicate only within the same VLAN segment.
  13. p0="protocol 802.1Q"
  14. p1="protocol 802.1ad"
  15. lb0="loose_binding off"
  16. lb1="loose_binding on"
  17. rh0="reorder_hdr off"
  18. rh1="reorder_hdr on"
  19. virt_type="vlan"
  20. TST_NEEDS_TMPDIR=1
  21. TST_TEST_DATA=",$p0 $lb0 $rh1,$p1 $lb1 $rh1"
  22. TST_TEST_DATA_IFS=","
  23. TST_TESTFUNC=do_test
  24. TST_SETUP=virt_lib_setup
  25. TST_CLEANUP=virt_cleanup
  26. . virt_lib.sh
  27. do_test()
  28. {
  29. virt_check_cmd virt_add ltp_v0 id 0 $2 || return
  30. tst_res TINFO "networks with the same VLAN ID must work"
  31. virt_setup "id 4094 $2" "id 4094 $2"
  32. virt_netperf_msg_sizes
  33. virt_cleanup_rmt
  34. tst_res TINFO "different VLAN ID shall not work together"
  35. virt_setup "id 4093 $2" "id 4094 $2"
  36. virt_minimize_timeout
  37. virt_compare_netperf "fail"
  38. virt_cleanup_rmt
  39. }
  40. tst_run