added freebsd test cass. updated file paths to be os agnostic
This commit is contained in:
@@ -13,12 +13,15 @@ from kmip.pie import client
|
|||||||
|
|
||||||
os_detected = platform.system()
|
os_detected = platform.system()
|
||||||
script_directory = os.path.dirname(os.path.realpath(__file__))
|
script_directory = os.path.dirname(os.path.realpath(__file__))
|
||||||
secrets_ini_file = script_directory + "/secrets.ini"
|
secrets_ini_file = os.path.join(script_directory, "secrets.ini")
|
||||||
|
pykmip_client_config_file = os.path.join(script_directory, "conf", "client.conf")
|
||||||
|
|
||||||
if os_detected == "Windows":
|
if os_detected == "Windows":
|
||||||
bitwarden_cli_executable = script_directory + "lib/bw.exe"
|
bitwarden_cli_executable = os.path.join(script_directory, "lib", "bw.exe")
|
||||||
elif os_detected == "Linux":
|
elif os_detected == "Linux":
|
||||||
bitwarden_cli_executable = script_directory + "lib/bw"
|
bitwarden_cli_executable = os.path.join(script_directory, "lib", "bw")
|
||||||
|
elif os_detected == "FreeBSD":
|
||||||
|
bitwarden_cli_executable = os.path.join(script_directory, "lib", "bw")
|
||||||
else:
|
else:
|
||||||
print("Your OS is not supported. Only Windows and Linux are currently supported.\nDetected OS: {0}".format(os_detected))
|
print("Your OS is not supported. Only Windows and Linux are currently supported.\nDetected OS: {0}".format(os_detected))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@@ -256,8 +259,8 @@ if __name__ == "__main__":
|
|||||||
logger = utils.build_console_logger(logging.INFO)
|
logger = utils.build_console_logger(logging.INFO)
|
||||||
config = opts.config
|
config = opts.config
|
||||||
passphrase = opts.message
|
passphrase = opts.message
|
||||||
print(script_directory + "/conf/client.conf")
|
print(pykmip_client_config_file)
|
||||||
client = client.ProxyKmipClient(config=config, config_file=script_directory + "/conf/client.conf")
|
client = client.ProxyKmipClient(config=config, config_file=pykmip_client_config_file)
|
||||||
client.open()
|
client.open()
|
||||||
print(encrypt(client, "test"))
|
print(encrypt(client, "test"))
|
||||||
client.close()
|
client.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user