![]() |
OpenWeave شامل تعدادی اسکریپت پایتون برای آزمایش عملکرد Weave روی توپولوژی های شبیه سازی شده Happy است. این موارد آزمایشی از پیکربندی درست توپولوژی برای اتصال به شبکه و استقرار Weave اطمینان حاصل می کنند.
اسکریپت مورد آزمون در مخزن OpenWeave در یافت /src/test-apps/happy/tests
. دو تست وجود دارد:
اجرا کن
- OpenWeave را نصب کنید. OpenWeave مشاهده ساخت راهنمای دستورالعمل.
- نصب مبارک. مبارک مشاهده راه اندازی راهنمای دستورالعمل.
- به فهرست موجود در مورد مورد آزمایش بروید. به عنوان مثال، برای اجرای یک آزمون مورد مشخصات اکو:
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"