![]() |
OpenWeave, Simüle edilmiş Happy topolojileri üzerinde Weave işlevselliğini test etmek için bir dizi Python betiği içerir. Bu test durumları, topolojinin ağ bağlantısı ve Weave dağıtımı için uygun şekilde yapılandırılmasını sağlar.
Test durumda betiklerinizin OpenWeave depoda bulunan /src/test-apps/happy/tests
. İki tür test vardır:
Çalıştırmak
- OpenWeave'i yükleyin. OpenWeave Bkz Yapı talimatları için rehber.
- Happy'i yükleyin. Mutlu Bkz Kurulum talimatları için rehber.
- Hedef test senaryosunu içeren dizine gidin. Örneğin, bir yankı profili test durumda çalıştırmak için:
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"
Özel topoloji durumu dosyanıza işaret etmek için topoloji yolunu güncelleyin:
self.topology_file = "~/my_topology.json"
Alternatif olarak, özel topoloji durum dosyanızı OpenWeave'de bulunanlarla aynı konuma yerleştirin:
self.topology_file = os.path.dirname(os.path.realpath(__file__)) + \ "/../../../topologies/standalone/my_topology.json"