File tree Expand file tree Collapse file tree 7 files changed +29
-17
lines changed Expand file tree Collapse file tree 7 files changed +29
-17
lines changed Original file line number Diff line number Diff line change 11language : c
22services : docker
33install :
4- - wget https://raw.githubusercontent.com/xenserver/xenserver-build-env/master/utils/travis-build-repo.sh
5- script : bash travis-build-repo.sh
4+ - wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-docker.sh
5+ - wget https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env
6+ - source xs-opam-ci.env
7+ script : bash -ex .travis-docker.sh
68sudo : true
79env :
8- global :
9- - REPO_PACKAGE_NAME=forkexecd
10- - REPO_CONFIGURE_CMD=true
11- - REPO_BUILD_CMD='make'
12- - REPO_TEST_CMD='make test'
10+ global :
11+ - PINS="forkexec:. xapi-forkexecd:."
12+ jobs :
13+ - PACKAGE="xapi-forkexecd"
Original file line number Diff line number Diff line change 2020 dune clean
2121
2222test :
23- dune runtest --profile=release
23+ dune runtest --profile=release --no-buffer
2424
2525# requires odoc
2626doc :
Original file line number Diff line number Diff line change @@ -70,13 +70,18 @@ let getpid (_sock, pid) = pid
7070
7171type 'a result = Success of string * 'a | Failure of string * exn
7272
73- let temp_dir = " /var/run/nonpersistent/forkexecd/"
73+ let temp_dir_server = " /var/run/nonpersistent/forkexecd/"
74+ let temp_dir =
75+ try
76+ Unix. access temp_dir_server [Unix. W_OK ; Unix. R_OK ; Unix. X_OK ];
77+ Some temp_dir_server
78+ with _ -> None
7479
7580(* * Creates a temporary file and opens it for logging. The fd is passed to the function
7681 'f'. The logfile is guaranteed to be closed afterwards, and unlinked if either the delete flag is set or the call fails. If the
7782 function 'f' throws an error then the log file contents are read in *)
7883let with_logfile_fd ?(delete = true ) prefix f =
79- let logfile = Filename. temp_file ~ temp_dir prefix " .log" in
84+ let logfile = Filename. temp_file ? temp_dir prefix " .log" in
8085 let read_logfile () =
8186 let contents = Xapi_stdext_unix.Unixext. string_of_file logfile in
8287 Unix. unlink logfile;
Original file line number Diff line number Diff line change @@ -107,6 +107,6 @@ type 'a result =
107107val with_logfile_fd : ?delete : bool -> string -> (Unix .file_descr -> 'a ) -> 'a result
108108
109109(* * Temporary directory used for communication *)
110- val temp_dir : string
110+ val temp_dir_server : string
111111
112112
Original file line number Diff line number Diff line change 11open Fe_debug
22
33let setup sock cmdargs id_to_fd_map syslog_stdout redirect_stderr_to_stdout env =
4- let fd_sock_path = Printf. sprintf " %s/fd_%s" Forkhelpers. temp_dir
4+ let fd_sock_path = Printf. sprintf " %s/fd_%s" Forkhelpers. temp_dir_server
55 (Uuidm. to_string (Uuidm. create `V4 )) in
66 let fd_sock = Fecomms. open_unix_domain_sock () in
77 Xapi_stdext_unix.Unixext. unlink_safe fd_sock_path;
@@ -44,7 +44,7 @@ let _ =
4444 Sys. set_signal Sys. sigpipe (Sys. Signal_ignore );
4545
4646 let main_sock = Fecomms. open_unix_domain_sock_server " /var/xapi/forker/main" in
47- Xapi_stdext_unix.Unixext. mkdir_rec (Forkhelpers. temp_dir ) 0o755 ;
47+ Xapi_stdext_unix.Unixext. mkdir_rec (Forkhelpers. temp_dir_server ) 0o755 ;
4848
4949 Daemon. notify Daemon.State. Ready |> ignore;
5050
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ type config = {
1717}
1818
1919let min_fds = 7
20- let max_fds = 1024 - 8 (* fe daemon has a bunch for its own use *)
20+ let max_fds = 1024 - 11 (* fe daemon has a bunch for its own use *)
2121
2222let all_combinations fds =
2323 let y = {
@@ -114,12 +114,13 @@ let test_exitcode () =
114114 Printf. printf " \n Completed exitcode tests\n "
115115
116116let master fds =
117+ Printf. printf " \n Performing timeout tests\n %!" ;
117118 test_delay () ;
118119 test_notimeout () ;
119- Printf. printf " \n Completed timeout test\n " ;
120+ Printf. printf " \n Completed timeout test\n %! " ;
120121 test_exitcode () ;
121122 let combinations = shuffle (all_combinations fds) in
122- Printf. printf " Starting %d tests\n " (List. length combinations);
123+ Printf. printf " Starting %d tests\n %! " (List. length combinations);
123124 let i = ref 0 in
124125 let update_progress f x =
125126 incr i;
Original file line number Diff line number Diff line change 11#! /bin/sh
22
33../src/fe_main.exe &
4- for x in ` seq 1 10` ; do
4+ MAIN=$!
5+ cleanup () {
6+ kill $MAIN
7+ }
8+ trap cleanup EXIT
9+ for _ in $( seq 1 10) ; do
510 test -S /var/xapi/forker/main || sleep 1
611done
712./fe_test.exe 16
You can’t perform that action at this time.
0 commit comments