gnu: tests: Fix unbound variable.
Record type descriptors were made private in
a143e92446
, but a usage of them was
forgotten in the tests files.
* gnu/tests/web.scm (patchwork-initial-database-setup-service): Use
accessors to access field values instead of unexported type descriptor.
This commit is contained in:
parent
bea2134fe1
commit
5cd9cd644c
1 changed files with 36 additions and 35 deletions
|
@ -521,42 +521,43 @@ HTTP-PORT."
|
||||||
;;; Patchwork
|
;;; Patchwork
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define patchwork-initial-database-setup-service
|
(define (patchwork-initial-database-setup-service configuration)
|
||||||
(match-lambda
|
(define start-gexp
|
||||||
(($ <patchwork-database-configuration>
|
#~(lambda ()
|
||||||
engine name user password host port)
|
(let ((pid (primitive-fork))
|
||||||
|
(postgres (getpwnam "postgres")))
|
||||||
|
(if (eq? pid 0)
|
||||||
|
(dynamic-wind
|
||||||
|
(const #t)
|
||||||
|
(lambda ()
|
||||||
|
(setgid (passwd:gid postgres))
|
||||||
|
(setuid (passwd:uid postgres))
|
||||||
|
(primitive-exit
|
||||||
|
(if (and
|
||||||
|
(zero?
|
||||||
|
(system* #$(file-append postgresql "/bin/createuser")
|
||||||
|
#$(patchwork-database-configuration-user
|
||||||
|
configuration)))
|
||||||
|
(zero?
|
||||||
|
(system* #$(file-append postgresql "/bin/createdb")
|
||||||
|
"-O"
|
||||||
|
#$(patchwork-database-configuration-user
|
||||||
|
configuration)
|
||||||
|
#$(patchwork-database-configuration-name
|
||||||
|
configuration))))
|
||||||
|
0
|
||||||
|
1)))
|
||||||
|
(lambda ()
|
||||||
|
(primitive-exit 1)))
|
||||||
|
(zero? (cdr (waitpid pid)))))))
|
||||||
|
|
||||||
(define start-gexp
|
(shepherd-service
|
||||||
#~(lambda ()
|
(requirement '(postgres))
|
||||||
(let ((pid (primitive-fork))
|
(provision '(patchwork-postgresql-user-and-database))
|
||||||
(postgres (getpwnam "postgres")))
|
(start start-gexp)
|
||||||
(if (eq? pid 0)
|
(stop #~(const #f))
|
||||||
(dynamic-wind
|
(respawn? #f)
|
||||||
(const #t)
|
(documentation "Setup patchwork database.")))
|
||||||
(lambda ()
|
|
||||||
(setgid (passwd:gid postgres))
|
|
||||||
(setuid (passwd:uid postgres))
|
|
||||||
(primitive-exit
|
|
||||||
(if (and
|
|
||||||
(zero?
|
|
||||||
(system* #$(file-append postgresql "/bin/createuser")
|
|
||||||
#$user))
|
|
||||||
(zero?
|
|
||||||
(system* #$(file-append postgresql "/bin/createdb")
|
|
||||||
"-O" #$user #$name)))
|
|
||||||
0
|
|
||||||
1)))
|
|
||||||
(lambda ()
|
|
||||||
(primitive-exit 1)))
|
|
||||||
(zero? (cdr (waitpid pid)))))))
|
|
||||||
|
|
||||||
(shepherd-service
|
|
||||||
(requirement '(postgres))
|
|
||||||
(provision '(patchwork-postgresql-user-and-database))
|
|
||||||
(start start-gexp)
|
|
||||||
(stop #~(const #f))
|
|
||||||
(respawn? #f)
|
|
||||||
(documentation "Setup patchwork database.")))))
|
|
||||||
|
|
||||||
(define (patchwork-os patchwork)
|
(define (patchwork-os patchwork)
|
||||||
(simple-operating-system
|
(simple-operating-system
|
||||||
|
|
Reference in a new issue