1. Marcin Kasperski
  2. perl/keyring/osxkeychain

Commits

Marcin Kasperski  committed 6b14ed9

tests

  • Participants
  • Parent commits 8d10d28
  • Branches default

Comments (0)

Files changed (1)

File t/11-parse_password_out_of_output.t

View file
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More tests => 11;
+
+use Passwd::Keyring::OSXKeychain;
+
+is(
+    Passwd::Keyring::OSXKeychain::_parse_password_from_find_output(<<'END'),
+keychain: "/Users/myUser/Library/Keychains/login.keychain"
+class: "genp"
+attributes:
+    0x00000007 <blob>="server.com"
+    0x00000008 <blob>=<NULL>
+    "acct"<blob>="userIDtoServer.com"
+    "cdat"<timedate>=0x33313024C53131693134253345315F00  "20041201142351A\123"
+    "crtr"<uint32>=<NULL>
+    "cusi"<sint32>=<NULL>
+    "desc"<blob>=<NULL>
+    "gena"<blob>=<NULL>
+    "icmt"<blob>=<NULL>
+    "invi"<sint32>=<NULL>
+    "mdat"<timedate>=0x33313024C53131693134253345315F00  "20041201142351A\123"
+    "nega"<sint32>=<NULL>
+    "prot"<blob>=<NULL>
+    "scrp"<sint32>=<NULL>
+    "svce"<blob>="server.com"
+    "type"<uint32>=<NULL>
+password: "myPassword"
+END
+    "myPassword",
+    "simple password parse");
+        
+is(
+    Passwd::Keyring::OSXKeychain::_parse_password_from_find_output(<<'END'),
+keychain: "/Users/User/Library/Keychains/login.keychain"
+class: "inet"
+attributes:
+0x00000007 <blob>="192.168.x.x"
+0x00000008 <blob>=<NULL>
+"acct"<blob>="User"
+"atyp"<blob>=<NULL>
+"cdat"<timedate>=0x32303131304356876580313734375A0 0 "20110129201747Z\000"
+"crtr"<uint32>=<NULL>
+"cusi"<sint32>=<NULL>
+"desc"<blob>="Netzwerkkennwort"
+"icmt"<blob>=<NULL>
+"invi"<sint32>=<NULL>
+"mdat"<timedate>=0x32303131308970393230123430305A0 0 "20110209203400Z\000"
+"nega"<sint32>=<NULL>
+"path"<blob>="User"
+"port"<uint32>=0x00000000
+"prot"<blob>=<NULL>
+"ptcl"<uint32>="smb "
+"scrp"<sint32>=<NULL>
+"sdmn"<blob>=<NULL>
+"srvr"<blob>="192.168.x.x"
+"type"<uint32>=<NULL>
+password: "passwort"
+END
+    "passwort",
+    "simple password parse");