diff --git a/tests/eclient/testdata/userdata.txt b/tests/eclient/testdata/userdata.txt index e7fd1d5f3..5de0d1bb0 100644 --- a/tests/eclient/testdata/userdata.txt +++ b/tests/eclient/testdata/userdata.txt @@ -3,11 +3,13 @@ {{$port := "2223"}} {{$userdata_file := "/tmp/userdata_file_eden_test"}} +{{define "ssh"}}ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i {{EdenConfig "eden.tests"}}/eclient/image/cert/id_rsa root@FWD_IP -p FWD_PORT{{end}} {{define "eclient_image"}}docker://{{EdenConfig "eden.eclient.image"}}:{{EdenConfig "eden.eclient.tag"}}{{end}} [!exec:bash] stop [!exec:sleep] stop [!exec:chmod] stop +[!exec:ssh] stop exec -t 10s bash generate_file.sh @@ -24,9 +26,28 @@ test eden.app.test -test.v -timewait 20m RUNNING eclient exec sleep 10 eden pod delete eclient -eden network delete n1 test eden.app.test -test.v -timewait 10m - eclient + +exec -t 10s bash generate_userdata.sh +eden pod deploy -n eclient --memory=512MB --networks=n1 {{template "eclient_image"}} -p {{$port}}:22 --metadata={{$userdata_file}} +test eden.app.test -test.v -timewait 20m RUNNING eclient + +exec -t 2m bash test_injected_file.sh "before_restart" + +exec -t 2m bash change_injected_file.sh "after_restart" + +eden pod restart eclient +test eden.app.test -test.v -timewait 20m RUNNING eclient + +exec -t 2m bash test_injected_file.sh "after_restart" + +eden pod delete eclient + +test eden.app.test -test.v -timewait 10m - eclient + +eden network delete n1 + test eden.network.test -test.v -timewait 10m - n1 -- eden-config.yml -- @@ -43,3 +64,39 @@ test: # allocate about 90014 of raw data printf 'variable=value\n%.0s' {1..6000} >{{$userdata_file}} printf 'variable=value' >>{{$userdata_file}} + +-- generate_userdata.sh -- +cat > {{$userdata_file}} < /etc/injected_file.txt" +$EDEN sdn fwd eth0 {{$port}} -- {{template "ssh"}} "echo $TEXT > /etc/injected_file.txt"