added the ability to prohibit network access for code submissions executed using Docker

This commit is contained in:
Hauke Klement
2015-03-17 17:14:25 +01:00
parent b1218e0b80
commit 15d8984a9e
12 changed files with 41 additions and 4 deletions

View File

@ -1,7 +1,7 @@
require 'rails_helper'
describe ExecutionEnvironment do
let(:execution_environment) { described_class.create }
let(:execution_environment) { described_class.create.tap { |execution_environment| execution_environment.update(network_enabled: nil) } }
it 'validates that the Docker image works', docker: true do
expect(execution_environment).to receive(:validate_docker_image?).and_return(true)
@ -32,6 +32,10 @@ describe ExecutionEnvironment do
expect(execution_environment.errors[:name]).to be_present
end
it 'validates the presence of the network enabled flag' do
expect(execution_environment.errors[:network_enabled]).to be_present
end
it 'validates the numericality of the permitted run time' do
execution_environment.update(permitted_execution_time: Math::PI)
expect(execution_environment.errors[:permitted_execution_time]).to be_present