2024-09-11 11:14:03 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
import enum
|
|
|
|
|
import itertools
|
|
|
|
|
import json
|
|
|
|
|
import os
|
|
|
|
|
import re
|
|
|
|
|
import sys
|
|
|
|
|
from dataclasses import KW_ONLY, dataclass, field
|
|
|
|
|
from functools import partial, partialmethod
|
|
|
|
|
from operator import itemgetter
|
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
|
|
import defl
|
|
|
|
|
from defl import CLIError, DotDict, Null, Path, Undefined, cl, log
|
|
|
|
|
from defl._run_ import *
|
|
|
|
|
from defl._assert_ import Assert
|
|
|
|
|
from defl._typing_ import *
|
|
|
|
|
from defl.testing_ import Tester
|
|
|
|
|
|
|
|
|
|
tester = Tester(name=__file__)
|
|
|
|
|
|
2025-03-09 09:17:53 -04:00
|
|
|
|
2024-09-11 11:14:03 -04:00
|
|
|
@tester.add()
|
|
|
|
|
def dig():
|
|
|
|
|
a = defl.dig('whoami.cloudflare', qClass='ch', qType='txt', resolver='1.0.0.1')
|
|
|
|
|
Assert(len(a)) == 1
|
|
|
|
|
a = defl.dig('google.com')
|
|
|
|
|
Assert(len(a)) == 1
|
|
|
|
|
|
2025-03-09 09:17:53 -04:00
|
|
|
|
|
|
|
|
@tester.add()
|
|
|
|
|
def pingWait() -> N:
|
|
|
|
|
defl.pingWait(sendEnv=N, sendTo='1.1.1.1')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@tester.add()
|
|
|
|
|
def pingWait() -> N:
|
|
|
|
|
try:
|
|
|
|
|
defl.pingWait(sendEnv=N, sendTo='10.6.3.9', waitTime=1)
|
|
|
|
|
raise NotImplementedError('')
|
|
|
|
|
except defl.PingTimeoutError:
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
2024-09-11 11:14:03 -04:00
|
|
|
log.info(tester.run())
|
|
|
|
|
tester.exitWithStatus()
|