added freebsd test cass. updated file paths to be os agnostic

This commit is contained in:
2022-09-06 21:48:03 -04:00
parent 9fa801908d
commit 8d77101cc2

View File

@@ -13,12 +13,15 @@ from kmip.pie import client
os_detected = platform.system()
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":
bitwarden_cli_executable = script_directory + "lib/bw.exe"
bitwarden_cli_executable = os.path.join(script_directory, "lib", "bw.exe")
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:
print("Your OS is not supported. Only Windows and Linux are currently supported.\nDetected OS: {0}".format(os_detected))
sys.exit(1)
@@ -256,8 +259,8 @@ if __name__ == "__main__":
logger = utils.build_console_logger(logging.INFO)
config = opts.config
passphrase = opts.message
print(script_directory + "/conf/client.conf")
client = client.ProxyKmipClient(config=config, config_file=script_directory + "/conf/client.conf")
print(pykmip_client_config_file)
client = client.ProxyKmipClient(config=config, config_file=pykmip_client_config_file)
client.open()
print(encrypt(client, "test"))
client.close()