Skip to content
Snippets Groups Projects
Commit bd1bd7cf authored by Julien David's avatar Julien David
Browse files

Update gitlab ci

parent 40b89ddb
No related branches found
No related tags found
No related merge requests found
image: alpine
stages:
- build
- test
job:build:
stage: build
script:
- apk update
- apk add python3
- apk add py-pip
- pip install pytest mysql-connector-python get_docker_secret docker
job:test:unit:
before_script:
- echo "Install Dependancies"
- sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
- apk update
- apk add python3
- apk add py-pip
- pip install pytest mysql-connector-python get_docker_secret docker
- pip install pytest mysql-connector-python get_docker_secret docker flake8
- echo "Start Tests"
script:
- cd tests
- pytest -v
- cd ..
- flake8 --max-line-length=120 softwares/server/*
after_script:
- echo "Tests have been done"
#authors : Julien David & Ismail MOUMNI
# Authors : Julien David & Ismail MOUMNI
import socket
# SERVER PORT
__RDOS_Port__ = 9393
# Creating Socket IP4 TCP
def server_conn(address, PORT):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as serv:
#BINDING
serv.bind((address,PORT))
# Listening to 1 CLient
# BINDING
serv.bind((address, PORT))
# Listening to 1 CLient
serv.listen()
#accepting the connection from client and getting client IP
# Accepting the connection from client and getting client IP
conn, addr = serv.accept()
with conn:
# Sending
conn.send(bytes("Bonjour !!","utf-8"))
print('Connexion acceptée depuis l IP : ',addr)
# Sending
conn.send(bytes("Bonjour !!", "utf-8"))
print('Connexion acceptée depuis l IP : ', addr)
# Receiving Data from Client
data = conn.recv(1024)
print(data)
serv.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment