facebook / fboss

Facebook Open Switching System Software for controlling network switches.
Other
860 stars 295 forks source link

Unable to run SAI fake tests #88

Open ravi861 opened 4 years ago

ravi861 commented 4 years ago

When try to execute sai_test-fake-1.5.0, I encountered the following error.

[root@ccb9aa60476f fboss]# ./sai_test-fake-1.5.0 --gtest_filter=HwVlanTest.VlanApplyConfig
Note: Google Test filter = HwVlanTest.VlanApplyConfig
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from HwVlanTest
[ RUN      ] HwVlanTest.VlanApplyConfig
Not valid AgentConfig, fallback to parsing as SwitchConfig...
E0717 04:28:20.606528 358895 PlatformProductInfo.cpp:148] json parse error on line 0: expected json value
E0717 04:28:20.606630 358895 PlatformProductInfo.cpp:70] Failed initializing ProductInfo from /var/facebook/fboss/fruid.json, fall back to use fbwhoami: json parse error on line 0: expected json value
unknown file: Failure
C++ exception with description "invalid model name " thrown in SetUp().
[  FAILED  ] HwVlanTest.VlanApplyConfig (3 ms)
[----------] 1 test from HwVlanTest (3 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (3 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] HwVlanTest.VlanApplyConfig

 1 FAILED TEST

Upon copying a fruid.json from /tmp/fboss_bins-1cmivb7i6/share/th/fruid.json, the test seems to proceed further but then crashes.

[root@ccb9aa60476f fboss]# cp /tmp/fboss_bins-1cmivb7i6/share/th/fruid.json /var/facebook/fboss/.
[root@ccb9aa60476f fboss]#
[root@ccb9aa60476f fboss]#
[root@ccb9aa60476f fboss]#
[root@ccb9aa60476f fboss]# ./sai_test-fake-1.5.0 --gtest_filter=HwVlanTest.VlanApplyConfig
Note: Google Test filter = HwVlanTest.VlanApplyConfig
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from HwVlanTest
[ RUN      ] HwVlanTest.VlanApplyConfig
Not valid AgentConfig, fallback to parsing as SwitchConfig...
*** Aborted at 1594960127 (unix time) try "date -d @1594960127" if you are using GNU date ***
PC: @                0x0 (unknown)
*** SIGSEGV (@0x10000001f) received by PID 358898 (TID 0x7ffa017e8840) from PID 31; stack trace: ***
    @     0x7ffa00701546 google::(anonymous namespace)::FailureSignalHandler()
    @     0x7ff9ff76e630 (unknown)
    @           0x6eb916 facebook::fboss::SaiBcmPlatform::getHwConfig()
    @           0x6e29ba facebook::fboss::SaiPlatform::generateHwConfigFile()
    @           0xd05d6b facebook::fboss::Platform::init()
    @           0x6e1a6e facebook::fboss::initSaiPlatform()
    @           0x5b6593 facebook::fboss::SaiSwitchEnsemble::SaiSwitchEnsemble()
    @           0x5b60e2 facebook::fboss::createHwEnsemble()
    @           0x601cb9 facebook::fboss::HwTest::SetUp()
    @           0x6de6ea testing::internal::HandleExceptionsInMethodIfSupported<>()
    @           0x6d51d9 testing::Test::Run()
    @           0x6d54b2 testing::TestInfo::Run()
    @           0x6d5628 testing::TestSuite::Run()
    @           0x6d5c23 testing::internal::UnitTestImpl::RunAllTests()
    @           0x6dec2a testing::internal::HandleExceptionsInMethodIfSupported<>()
    @           0x6d5e75 testing::UnitTest::Run()
    @           0x4f2d9f main
    @     0x7ff9feb94555 __libc_start_main
    @           0x56467c (unknown)
    @                0x0 (unknown)
Segmentation fault

This possibly makes the application think it is some kind of HW platform.

Is there a sample fruid.json available to execute the fake SAI tests? 2a5e5b12414beedebc8bba86b2842cf169a0d149 is the commit used when building fboss.

Any help is much appreciated?

shri-khare commented 4 years ago

Don't think we support running fake tests like that:

ravi861 commented 4 years ago

Thank you for the response. It would help if you can publish a format for the fruid.json and agent.conf if you think that will help with a custom SAI and maybe what their purpose is.

pettershao-ragilenetworks commented 2 years ago

hi @shri-khare I need a agent.conf too,can you help share one, thanks!

[root@bogon fboss]# ./bin/wedge_agent -mode=wedge -mgmt_if=enp7s0 -config=/etc/coop/sample3.json
Not valid AgentConfig, fallback to parsing as SwitchConfig...
terminate called after throwing an instance of 'apache::thrift::bad_field_access'
  what():  accessing unset optional value
*** Aborted at 1634091526 (Unix time, try 'date -d @1634091526') ***
*** Signal 6 (SIGABRT) (0xa2e) received by PID 2606 (pthread TID 0x7f8aa9304800) (linux TID 2606) (maybe from PID 2606, UID 0) (code: -6), stack trace: ***
(error retrieving stack trace)
Aborted