* start two cns servers
* fix linter issues
* fix linter issue
* enhance echo server log
* fix Quang's comments
* gofumpt cns service.go
* fix defaultAPIServerAddress
* run servers asynchoronsly
* add server_test.go
* fix UT test
* enhance log
* fix log issue
* fix an issue
* add a check for defaultAPIServerURL
* fix GetOption func
* enhance comments
* fix defaultAPI URL to 127.0.0.1
* fix restapi method in echo server
* remove unnecessary log info
* fix comment1
* fix comments
* add context to control echo server
* fix TM's comments
* do not enable local server if user specifies cnsurl by -c option
* add -p port check when getting nodeURL
* fix comments and use -p select from customer to start local server
* fix a case when customer does not provide -p option
* fix the issue if customer also does not provide -p and -c option
* add UTs to launch server with different combinations
* fix linter issue for UTs
* fix UT linter issues
* UT needs to stop service
* remove duplicated test case
* comments fix
* fix linter issue
* fix Tim's comments
* fix comments
* fix linter issue
* handle type assertion
* Adding cnsURL and cnsPort options to test server
The startService function is a mistake that has been perpetuated through
time and needs to be removed. As a consequence of its existence, it
requires mixing concerns in all tests and stands in the way of
refactoring.
The addition of two type assertion checks caused this function to break,
because the corresponding options were not set in the Service's
configuration. This is a problem in itself--there's no reason the
options should be pulled out of a map[string]interface{}. Given this, we
can just set these two options in startService, committing sins to
offset the ones in service.(*HTTPRestService).Service.Options.
---------
Signed-off-by: Paul Yu <129891899+paulyufan2@users.noreply.github.com>
Co-authored-by: Tim Raymond <traymond@microsoft.com>
* disable cleaning up hns network and state files from windows cni
* fixed uts
* fixed ut
* remove the ut which is not needed anymore
* addressed comments
* updated same pattern for cnm
* added comments
* addressed comments