mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	test-install: Run lxc-attach with --clear-env.
The host environment variables (especially PATH) should not be allowed to pollute the test and could interfere with it. This allows test-install to run on a NixOS host. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							ab211c7acf
						
					
				
				
					commit
					9b5f9858fb
				
			@@ -45,7 +45,7 @@ done
 | 
				
			|||||||
message="$(cat <<EOF
 | 
					message="$(cat <<EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Container:
 | 
					Container:
 | 
				
			||||||
  sudo lxc-attach -n $CONTAINER_NAME
 | 
					  sudo lxc-attach --clear-env -n $CONTAINER_NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Unpacked tree:
 | 
					Unpacked tree:
 | 
				
			||||||
  sudo ls $shared_dir/mnt/zulip-server
 | 
					  sudo ls $shared_dir/mnt/zulip-server
 | 
				
			||||||
@@ -73,7 +73,7 @@ lxc-copy --ephemeral --keepdata -n "$BASE_CONTAINER_NAME" -N "$CONTAINER_NAME" \
 | 
				
			|||||||
"$THIS_DIR"/lxc-wait -n "$CONTAINER_NAME"
 | 
					"$THIS_DIR"/lxc-wait -n "$CONTAINER_NAME"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
run() {
 | 
					run() {
 | 
				
			||||||
    lxc-attach -n "$CONTAINER_NAME" -- "$@"
 | 
					    lxc-attach --clear-env -n "$CONTAINER_NAME" -- "$@"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
run eatmydata -- /mnt/src/zulip-server/scripts/setup/install --self-signed-cert "${INSTALLER_ARGS[@]}"
 | 
					run eatmydata -- /mnt/src/zulip-server/scripts/setup/install --self-signed-cert "${INSTALLER_ARGS[@]}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,7 +29,7 @@ fi
 | 
				
			|||||||
# We poll.
 | 
					# We poll.
 | 
				
			||||||
for _ in {1..60}; do
 | 
					for _ in {1..60}; do
 | 
				
			||||||
    echo "lxc-wait: $CONTAINER_NAME: polling for boot..." >&2
 | 
					    echo "lxc-wait: $CONTAINER_NAME: polling for boot..." >&2
 | 
				
			||||||
    runlevel="$(lxc-attach -n "$CONTAINER_NAME" -- runlevel 2>/dev/null)" \
 | 
					    runlevel="$(lxc-attach --clear-env -n "$CONTAINER_NAME" -- runlevel 2>/dev/null)" \
 | 
				
			||||||
        || { sleep 1; continue; }
 | 
					        || { sleep 1; continue; }
 | 
				
			||||||
    if [ "$runlevel" != "${0%[0-9]}" ]; then
 | 
					    if [ "$runlevel" != "${0%[0-9]}" ]; then
 | 
				
			||||||
        echo "lxc-wait: $CONTAINER_NAME: booted!" >&2
 | 
					        echo "lxc-wait: $CONTAINER_NAME: booted!" >&2
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,7 +34,7 @@ lxc-start -n "$CONTAINER_NAME"
 | 
				
			|||||||
"$THIS_DIR"/lxc-wait -n "$CONTAINER_NAME"
 | 
					"$THIS_DIR"/lxc-wait -n "$CONTAINER_NAME"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
run() {
 | 
					run() {
 | 
				
			||||||
    lxc-attach -n "$CONTAINER_NAME" -- "$@"
 | 
					    lxc-attach --clear-env -n "$CONTAINER_NAME" -- "$@"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
run passwd -d root
 | 
					run passwd -d root
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user