#langracket;; Load personally identifying data required by tests from a file so
;; that it's not part of the repo and so that users may customize.
;;
;; This includes things like AWS names for buckets and domains, email
;; addresses to test using SES, and so on.
;;
;; We provide a function to call to get each piece of test data. The
;; data will be loaded from file the first time such a call is made.
;; If no such calls are made, the file won't be loaded, meaning this
;; will work fine when used in production and not running unit tests.
(definedata-file (build-path (find-system-path'home-dir)
".aws-tests-data"))
(define-syntax (def/provstx)
(syntax-casestx ()
[(_name)
(with-syntax ([name/str#'(symbol->string'name)])
#'(begin
(define (name)
(get-test-dataname/str))
(providename)))]))
(define (load-test-data-from-file)
(for/hash ([x (in-list (file->linesdata-file#:mode'text#:line-mode'any))])
(matchx
[(pregexp"^\\s*([^#]+?)\\s*=\\s*([^#]+?)$" (list_kv))
(valueskv)]
[else
(values00)])))
(defineget-test-data
(let ([h#f]) ;don't try to load file unless we are actually called
(lambda (name)
(unlessh
(set!h (load-test-data-from-file)))
(hash-refhname
(lambda ()
(errorname"not defined in ~/.aws-run-tests-data"))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by s3.rkt
(def/provtest/bucket) ;do NOT use leading /
(def/provtest/path) ;DO use leading /
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by ses.rkt
;; You must set this to an email address verified with SES, for
;; example using verify-email-address.
(def/provtest/verified-sender)
;; This should be an address you have NOT verified.
(def/provtest/unverified-sender)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by ses.rkt and sns.rkt
;; Set this to some email address at which you don't mind getting some
;; test emails.
(def/provtest/recipient)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by sdb.rkt
;; This domain will get munged -- data added/deleted, and in fact the
;; entire domain will be created/deleted -- so pick an SDB domain name
;; you're not using in production!
(def/provtest/domain)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by sns.rkt
;; This topic will get munged -- data added/deleted, and in fact the
;; entire topic will be created/deleted -- so pick an SDB topic name
;; you're not using in production!
(def/provtest/topic)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by sqs.rkt
;; This queue will get munged -- messages added/removed, and in fact
;; the entire queue will be created/deleted -- so pick an SQS queue
;; name you're not using in production!
(def/provtest/queue)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by cw.rkt
(def/provtest/namespace)
(def/provtest/metric)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by glacier.rkt
(def/provtest/vault)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by dyamo.rkt
(def/provtest/dynamo-table)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; used by r53.rkt
(def/provtest/domain.com)