Run some tests.
This commit is contained in:
parent
48eb1a1cbe
commit
c263886829
|
|
@ -26,6 +26,12 @@ def main(args=None):
|
||||||
|
|
||||||
if action == 'ping':
|
if action == 'ping':
|
||||||
asyncio.run(call_ping(options))
|
asyncio.run(call_ping(options))
|
||||||
|
if action == 'uptime':
|
||||||
|
asyncio.run(call_uptime())
|
||||||
|
if action == 'build_info':
|
||||||
|
asyncio.run(call_build_info())
|
||||||
|
if action == 'env':
|
||||||
|
asyncio.run(call_env())
|
||||||
|
|
||||||
async def call_ping(options):
|
async def call_ping(options):
|
||||||
if len(options) != 1 or options[0] == "":
|
if len(options) != 1 or options[0] == "":
|
||||||
|
|
@ -39,4 +45,23 @@ async def call_ping(options):
|
||||||
async with session.get('http://localhost:8080/ping', json=request) as resp:
|
async with session.get('http://localhost:8080/ping', json=request) as resp:
|
||||||
print(await resp.text())
|
print(await resp.text())
|
||||||
|
|
||||||
|
async def call_uptime():
|
||||||
|
print("Calling uptime.")
|
||||||
|
|
||||||
|
async with aiohttp.ClientSession() as session:
|
||||||
|
async with session.get('http://localhost:8080/uptime') as resp:
|
||||||
|
print(await resp.text())
|
||||||
|
|
||||||
|
async def call_build_info():
|
||||||
|
print("Calling build_info.")
|
||||||
|
|
||||||
|
async with aiohttp.ClientSession() as session:
|
||||||
|
async with session.get('http://localhost:8080/build_info') as resp:
|
||||||
|
print(await resp.text())
|
||||||
|
|
||||||
|
async def call_env():
|
||||||
|
print("Calling env.")
|
||||||
|
|
||||||
|
async with aiohttp.ClientSession() as session:
|
||||||
|
async with session.get('http://localhost:8080/env') as resp:
|
||||||
|
print(await resp.text())
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ from ament_index_python import get_package_share_directory
|
||||||
import yaml
|
import yaml
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
facts = Facts()
|
facts = Facts()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue