diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9cb40d1..0657a45 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ cache: before_script: - docker info - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - - chmod 0755 ./images_build/client/unittest/bin/wait-for + - chmod 0755 ./images_build/client/dign_client/bin/wait-for - chmod 0755 ./images_build/server_web/certs/tool tags: - share diff --git a/cmake/Package.cmake b/cmake/Package.cmake index 010d2e1..3aa7756 100644 --- a/cmake/Package.cmake +++ b/cmake/Package.cmake @@ -22,7 +22,7 @@ set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PreunInstall.i set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PostunInstall.in) install(FILES compose/docker-compose.yml DESTINATION ./compose) -install(FILES images_build/client/unittest/etc/client.conf DESTINATION ./etc) +install(FILES images_build/client/dign_client/etc/client.conf DESTINATION ./etc) install(FILES service/tsg-diagnose.service DESTINATION /usr/lib/systemd/system) install(FILES images_build/server_dns/config/dnsmasq.conf DESTINATION /opt/tsg/tsg-diagnose/etc/) install(DIRECTORY images/ DESTINATION ./images) diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml index b8cc164..9eae29d 100644 --- a/compose/docker-compose.yml +++ b/compose/docker-compose.yml @@ -71,21 +71,21 @@ services: - /bin/sh - -c - | - /root/unittest/bin/wait-for 192.51.100.2:443 -t 60 -- echo "server web is up" - /root/unittest/bin/wait-for 192.51.100.5:8080 -t 60 -- echo "server dns is up" + /root/dign_client/bin/wait-for 192.51.100.2:443 -t 60 -- echo "server web is up" + /root/dign_client/bin/wait-for 192.51.100.5:8080 -t 60 -- echo "server dns is up" ifconfig eth0 hw ether 02:42:C0:A8:FD:03 arp -i eth0 -s 192.0.2.130 02:42:c0:a8:fd:82 arp -i eth0 -s 192.0.2.131 02:42:C0:A8:FD:83 arp -i eth0 -s 192.0.2.135 02:42:C0:A8:FD:85 - mkdir -p /root/result_tsg_diagnose/unittest + mkdir -p /root/result_tsg_diagnose/dign_client mkdir -p /root/result_tsg_diagnose/conn_traffic_status cp -rf /root/cafile_dict/certs/sets/current/gen/crt/ca-root.crt /usr/local/share/ca-certificates update-ca-certificates - cat /root/unittest/etc/hosts >> /etc/hosts - echo '0 2 * * * /usr/local/bin/python /root/unittest/clear_file_timeout.py' > /etc/crontabs/root - echo '0 2 * * * /usr/local/bin/python /root/unittest/clear_file_timeout.py -d /root/result_tsg_diagnose/conn_traffic_status' > /etc/crontabs/root + cat /root/dign_client/etc/hosts >> /etc/hosts + echo '0 2 * * * /usr/local/bin/python /root/dign_client/clear_file_timeout.py' > /etc/crontabs/root + echo '0 2 * * * /usr/local/bin/python /root/dign_client/clear_file_timeout.py -d /root/result_tsg_diagnose/conn_traffic_status' > /etc/crontabs/root crond - python /root/unittest/tsg_diagnose.py -l -w NEZHA + python /root/dign_client/tsg_diagnose.py -l -w NEZHA tail -f /dev/null diff --git a/images_build/client/Dockerfile b/images_build/client/Dockerfile index a146ee1..fce0a22 100644 --- a/images_build/client/Dockerfile +++ b/images_build/client/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.6.9-alpine3.10 -ADD unittest /root/unittest +ADD dign_client /root/dign_client RUN sed -i s@/dl-cdn.alpinelinux.org/@/mirrors.ustc.edu.cn/@g /etc/apk/repositories \ && apk update \ @@ -13,6 +13,6 @@ RUN sed -i s@/dl-cdn.alpinelinux.org/@/mirrors.ustc.edu.cn/@g /etc/apk/repositor && pip3 install pytelegraf \ && pip3 install dnspython -WORKDIR /root/unittest +WORKDIR /root/dign_client CMD tail -f /dev/null diff --git a/images_build/client/unittest/bin/clear_file_timeout.py b/images_build/client/dign_client/bin/clear_file_timeout.py similarity index 91% rename from images_build/client/unittest/bin/clear_file_timeout.py rename to images_build/client/dign_client/bin/clear_file_timeout.py index f977d2a..0f88292 100644 --- a/images_build/client/unittest/bin/clear_file_timeout.py +++ b/images_build/client/dign_client/bin/clear_file_timeout.py @@ -7,7 +7,7 @@ import argparse def get_suite_option(): parser = argparse.ArgumentParser(description="Tsg diagnose Tools - clear tsg diagnose result file", epilog = "Example:help") parser.add_argument('-t','--timeout', type = int, default = 604800,help='Specify the time to delete files that are not accessed in seconds ,the default is 604800 (7 days)') - parser.add_argument('-d','--dictpath', type = str, default = '/root/result_tsg_diagnose/unittest', help='Specify the folder to delete files, the default is /root/result_tsg_diagnose/unittest') + parser.add_argument('-d','--dictpath', type = str, default = '/root/result_tsg_diagnose/dign_client', help='Specify the folder to delete files, the default is /root/result_tsg_diagnose/dign_client') args = parser.parse_args() return args diff --git a/images_build/client/unittest/bin/client.py b/images_build/client/dign_client/bin/client.py similarity index 100% rename from images_build/client/unittest/bin/client.py rename to images_build/client/dign_client/bin/client.py diff --git a/images_build/client/unittest/bin/wait-for b/images_build/client/dign_client/bin/wait-for similarity index 100% rename from images_build/client/unittest/bin/wait-for rename to images_build/client/dign_client/bin/wait-for diff --git a/images_build/client/unittest/etc/client.conf b/images_build/client/dign_client/etc/client.conf similarity index 100% rename from images_build/client/unittest/etc/client.conf rename to images_build/client/dign_client/etc/client.conf diff --git a/images_build/client/unittest/etc/hosts b/images_build/client/dign_client/etc/hosts similarity index 100% rename from images_build/client/unittest/etc/hosts rename to images_build/client/dign_client/etc/hosts