![]() |
OpenWeave에는 시뮬레이션 된 Happy 토폴로지에서 Weave 기능을 테스트하기위한 여러 Python 스크립트가 포함되어 있습니다. 이러한 테스트 사례는 토폴로지가 네트워크 연결 및 Weave 배포를 위해 올바르게 구성되었는지 확인합니다.
테스트 케이스 스크립트에서 OpenWeave 저장소에서 발견되는 /src/test-apps/happy/tests
. 두 가지 유형의 테스트가 있습니다.
운영
- OpenWeave를 설치합니다. OpenWeave의 참조 작성 지침에 대한 가이드.
- Happy를 설치하십시오. 해피 참조 설치 지침에 대한 가이드.
- 대상 테스트 케이스가 포함 된 디렉토리로 이동하십시오. 예를 들어, 에코 프로필 테스트 케이스 실행 :
cd <path-to-openweave-core>/src/test-apps/happy/tests/standalone/echo
python test_weave_echo_01.py
Change test topology
OpenWeave test cases run against the sample Happy topologies found in
/src/test-apps/happy/topologies/standalone
.
To use your own custom Happy topology in a test case:
- After constructing your custom topology, save it in JSON format. This saves
the topology state file in the
$HOME
directory:happy-state -s my_topology.json
In the test case script, locate the topology file being used. Topologies in test cases are typically assigned to the
self.topology_file
variable. For example,test_weave_echo_01.py
uses the following topology for a default OpenWeave build:self.topology_file = os.path.dirname(os.path.realpath(__file__)) + \ "/../../../topologies/standalone/three_nodes_on_thread_weave.json"
사용자 정의 토폴로지 상태 파일을 가리 키도록 토폴로지 경로를 업데이트하십시오.
self.topology_file = "~/my_topology.json"
또는 사용자 지정 토폴로지 상태 파일을 OpenWeave에 포함 된 것과 동일한 위치에 배치합니다.
self.topology_file = os.path.dirname(os.path.realpath(__file__)) + \ "/../../../topologies/standalone/my_topology.json"